fields
Keep or remove fields from the result without fixing column order.
Use fields to keep or remove fields from your results. To choose a fixed column order, use table.
Syntax
... | fields [+] <field> [, <field> ...]
... | fields - <field> [, <field> ...]| Argument | Description |
|---|---|
+ (default) | Keep only the listed fields. |
- | Remove the listed fields and keep everything else. |
field | An OCSF path, a top-level object such as unmapped, or a field computed earlier in the pipeline. Separate with commas or spaces. |
How it works
fieldschanges which fields are returned, not their order. Use table for a fixed column order or display aliases.fields -is the easy way to drop bulky fields such asraw_dataandunmappedfrom a wide event.
Examples
Keep just the network tuple:
class_uid=4001 | fields time, src_endpoint.ip, src_endpoint.port, dst_endpoint.ip, dst_endpoint.portDrop the original log line and the unmapped spill from wide events:
metadata.log_source=aws_cloudtrail | fields - raw_data, unmappedKeep only what a hunt needs before aggregating:
class_uid=1007 | fields device.hostname, process.name, process.cmd_line | stats count by device.hostname, process.nameNotes
fieldsalso runs after a nano-side stage (lookup,prevalence,inputlookup,resolve_identity,ai,lateral).