fillnull
Replace empty values in specific fields with a default, so they group and display cleanly.
Use fillnull to replace null values in your chosen fields with a default. This lets you display or group results that have missing values.
Syntax
... | fillnull [value=<value>] <field> [, <field> ...]| Argument | Default | Description |
|---|---|---|
value | NULL | The replacement text. Quote it if it contains spaces or punctuation. |
field | — | The fields to fill. Name them explicitly (see Notes). |
How it works
- Each listed field's null values become
value. Non-null values are kept. - The filled field becomes a string, even when it held numbers and
valueis a number (value=0yields the text"0"). Apply numeric comparisons orsum()beforefillnull, or convert back withtonumber()in eval.
Examples
Count logons per user without losing events that have no user name:
class_uid=3002 | fillnull value="(none)" user.name | stats count by user.nameShow a placeholder for unknown hosts and ports in a connection table:
class_uid=4001 | fillnull value="unknown" src_endpoint.hostname, dst_endpoint.hostname | table time, src_endpoint.hostname, dst_endpoint.hostname, dst_endpoint.portGroup HTTP requests by status, keeping requests with no response code:
class_uid=4002 | fillnull value="no response" http_response.code | stats count by http_response.codeNotes
- List the fields to fill. A bare
fillnullwith no field list leaves the results unchanged. fillnullalso runs after a nano-side stage (lookup,prevalence,inputlookup,resolve_identity,ai,lateral).