Displays statistics about the fields within the current event stream.

ParameterTypeRequiredDefault ValueDescription
limitintegeroptional[a] 200 Limits the number of fields to generate statistics for.
  Minimum1 
  Maximum10,000 

[a] Optional parameters use their default value unless explicitly set.

The function returns an event set that contains statistics for the fields in the current event set; the returned fields include:

  • #type

    The name of the parsing used when the data was ingested.

  • field

    The name of field for the statistics.

  • _count

    The number of values for the named field within the incoming event set.

  • distinct

    The number of distinct values for the named field in the incoming event set.

fieldstats() Examples

Click + next to an example below to get the full details.

Extract Field Statistics

Extract field statistics from a repository using the fieldstats() function

Query
logscale
fieldstats()
Introduction

In this example, the fieldstats() function is used to get the statistics for the fields #type, field, _count and distinct within the HUMIO repository. The example will only show the first 20 rows (but the limit parameter has a default value of 200 rows.

Step-by-Step
  1. Starting with the source repository events.

  2. logscale
    fieldstats()

    Extracts statistics about fields within the humio respository.

  3. Event Result set.

Summary and Results

The query is used to extract statistics about the fields within a current event stream. The process of extracting insights from data streams in real time or near-real time can be used to identify and act on critical business moments, collect data from various sources, and to understand the meaning of this data and its content. Statistics are useful for analyzation.

Sample output from the incoming example data (showing the first 20 rows only):

#typefield_countdistinct
humiodecodedContentLength60501107
humiooriginalName15482419
humiotx_fifo162961
humiohumioClass1641588320
humiop7526865842439
humiobucketId2344182
humiodataspaceId1007793556
humiouserAgent616757
humiodatasource9037297143
humiorequest-rate4367824248
humiotopic_leader_size1861116112
humioreadOnly1580361
humiorequest-latency-avg395427169
humio@rawstring1751791517696022
humiopercentDone8543139209
humiouri61675325
humiotx_carrier162961
humiop9826865845969
humiototalCount427319
humios3AccessConfig1580361