Query data in the humio Repository

Many of the queries you want to run on the data in the humio repository are included in the humio/insights. This section contains examples of queries that might be useful to run in the humio Repository.

View segment block sizes on a dataspace

logscale
class=*SegmentFileImporter* dataspace=$DATASPACE_NAME
| "segment ready for global"
| groupby(dataspace, function=[avg(blocks, as=avg_blocks), percentile(blocks, percentiles=[50]), max(blocks, as=max_blocks), count(as=count)])
| round(avg_blocks)
| sort(dataspace, order=asc)
| rename(_50, as=med_blocks)
| select([dataspace, avg_blocks, med_blocks, max_blocks, count])

The query above, when run with a wildcard (*) for dataspace, gives a result similar to the following:

dataspaceavg_blocksmed_blocksmax_blockscount
humio80852.651775392431293076752
humio-activity63.9609462244260185125
humio-audit3712.0404237125533981448
humio-fleet1612.0404237125533984411
humio-metrics6235.9831543944818713512
humio-usage4512.0404237125533981444

Find the unsync partitions in Kafka

logscale
kind=logs #repo=$REPONAME class = c.h.j.KafkaStatusLoggerJob
| /kafka status topic_name=\'(?<topicName>(.+))\' topic_partition=(?<topicPart>(.+)) topic_leader=(.+) topic_num_out_of_sync_replicas=(?<numUnsync>(.+)) topic_out_of_sync_replicas=/i
// | topicName="global-events"
// | topicName="humio-ingest"
| topicName="transientChatter-events"
| numUnsync > 0
| format("%s,%d", field=[topicName, topicPart], as="name")
| timechart(name)

Monitor S3 archiving job backlog

This query shows a continuously increasing backlog for the S3 Archiving job. Since that job can postpone merges, it can result in disk overflow.

logscale
#kind=logs #vhost=* /S3Archiving/i "Backlog for dataspace" | timechart(#vhost, function=max(count))

Show offline nodes

logscale
#type=humio #kind=logs class=/ClusterHostAliveStats/  "AliveStats on me" | age > 7200000 /* =2hours */ | timechart(hostId, function=count(hostId,distinct=true), limit=50, minSpan=4h)

Show repositories with ingest greater than 32MB

logscale
#kind=req* method=POST //| timechart(status, function=max(contentLength))
| contentLength > 32000000 | len:=contentLength/(1024*1024)
| groupBy("repo", function=[count(), max(len), avg(len)])

Calculate ingest queue average compression

logscale
#type=humio #kind=metrics | name=/^ingest-writer-(?<un>un)?compressed-bytes$/
| case { un=* | un:=m1; comp:=m1 }
| timechart(function=[sum(un,as=un),sum(comp,as=comp)], minSpan=1m)
| ratio:=un/comp | drop([un,comp])

This query gives a result similar to the following:

_bucketratio
17324505000001.608886671332077
17324514000001.6095566354846649

Measure ingest latency per host

logscale
#type=humio @host=* | name="event-latency"
| timechart(@host, function=[max(max, as=max)], limit=20)
|  max:=max/1000

This query gives a result similar to the following:

_bucket@hostmax
1732450500000example.testing:80801.346
1732451400000example.testing:80800.838

Measure ingest in bytes

logscale
#type=humio | metric_type=METER | @host=?{host=new*} @host=?{host=*} | name=/^ingest-bytes\/(?<dataspace>.*)$/
| timechart( span=60s,
       function={ groupby([dataspace, #host], function=avg(m1)) | sum(_avg)},
       unit="bytes/sec to bytes/day")

This query gives a result similar to the following:

_bucketsum
17324505000004995149903.207501
17324514000005769455633.238956

Measure parser throttling

This query shows how close (in percent) the system has been to start throttling any parser. As long as that is below 100, nothing gets throttled by default.

logscale
#kind=logs class=/ParserLimitingJob/ /Top element for parser id=(?<parserID>[^/]+)\/(?<repo>[^/]+)\/(?<parserName>\S+)/
| pct:=100*costSum/threshold
| timechart(function=max(pct), minSpan=10s, limit=1)

Show failed ingest requests that have been throttled

logscale
#type=humio #kind=logs statuscode=503 /msg=(?<msg>Ingest parsing exceeded the acceptable amount of time[^\.]+)\. exception/