fieldsummary
Use the fieldsummary operator to generate a summary of the output fields from the AQL.
Syntax
|fieldsummary [maxvals=<integer>] [samplesize=<integer>] <fields>
maxvals=<integer>
|
Specify the maximum number of values to be included in the summary for each field. It must be a value between Default: |
samplesize=<integer>
|
Specify the maximum number of rows to include in the summary. It must be a value between The larger the sample size, the longer it will take. Default: |
<fields>
|
Specify the list of fields to be included in the summary. If it is not specified, the operator will generate the summary for all fields. In the case of the The following fields are excluded for the
|
Usage
You can use the fieldsummary operator to generate statistics of the resulting fields.
This operator works with both eventlog and ocsf schemas. For OCSF fields, use dotted notation to reference nested fields. For OCSF schema fields, array indexes start at array[1] and not array[0].
Examples include metadata.product.name and src_endpoint.ip.
Note: When querying OCSF data, fieldsummary generates results for each OCSF class separately. This helps differentiate statistics across different event types within your OCSF data.
The summary includes the following columns for each field:
-
field_name: Name of the field. -
count: Number of values in the field. -
distinct_count: Number of distinct values in the field if it is categorical (string or boolean) or it issrc_portordest_port. -
max: Maximum value in the field if it is numeric. -
min: Minimum value in the field if it is numeric. -
mean: Mean value for the field if it is numeric. -
values: List of the different values with their respective counts. It is an approximation of the most frequent values. This applies only for categorical fields (string or boolean) as well assrc_portordest_port.
Note: The AQL query must specify a lookup table before this piped operator. It can be any lookup table.
Examples
Example 1: Eventlog field summary
example_lookup_table | where src_ip != '' and src_ip != 'null' | fields src_ip , event_size , action | fieldsummary src_ip, event_size, action
Example 2: OCSF field summary
ocsf | fieldsummary maxvals=5 metadata.product.name, activity_name, src_endpoint.ip