nano SIEM
Search Commands

spath

Supported in:Self-hosted

Copy a nested value from an event's unmapped source fields into a new column.

Use spath to copy a nested value into a column you can use later in your pipeline. By default, it reads unmapped, which holds source fields with no OCSF home; see OCSF schema.

Syntax

... | spath [input=<field>] path=<path> [output=<field>]
ArgumentDefaultDescription
inputunmappedObject or JSON-text field to read.
pathDotted path under the input, for example request_parameters.bucket_name.
outputspath_resultName of the new column.

How it works

  • spath path=a.b reads unmapped.a.b and writes it, as a string, to the output column. The original field is unchanged.
  • spath without path= does nothing.
  • The path is a dotted name. Array indexes such as items[0].name are not supported and are a syntax error.

You can also query the same value directly, without spath: unmapped.request_parameters.bucket_name="acme-prod-data". Use spath when you want a short column name for the rest of the pipeline.

Examples

S3 buckets named in CloudTrail request parameters:

metadata.log_source=aws_cloudtrail | spath path=request_parameters.bucket_name output=bucket | where isnotnull(bucket) | stats count by bucket

The same result without spath:

metadata.log_source=aws_cloudtrail unmapped.request_parameters.bucket_name=* | stats count by unmapped.request_parameters.bucket_name

IAM roles assumed, with the session name:

metadata.log_source=aws_cloudtrail api.operation=AssumeRole | spath path=request_parameters.role_arn output=role | spath path=request_parameters.role_session_name output=session | table time, actor.user.name, role, session

What's next

  • rex: extract values from text with a regex
  • eval: compute new fields
  • fields: choose which fields to return

On this page