nano SIEM
Search Commands

mvexpand

Supported in:Self-hosted

Turn an array field into one row per element, so you can filter, count or group on each value.

Use mvexpand to turn an array field into one row per element so you can filter, count, or group individual values. nano copies the other fields onto each new row.

Syntax

... | mvexpand <field> [limit=<n>]
ArgumentDefaultDescription
fieldAn array field, for example resources.uid or answers.rdata.
limit100000Maximum number of rows the expansion produces.

How it works

  • An event whose array has three elements becomes three rows. In each row, <field> holds a single element.
  • An event whose array is empty produces no rows.
  • Many OCSF fields are arrays. Common ones: resources.uid, resources.name, observables.value, enrichments.value, enrichments.name, answers.rdata, email.to, file.hashes.value, vulnerabilities.cve.uid, http_request.url.categories. See the OCSF field reference.

Examples

Which AWS resources are touched most:

metadata.log_source=aws_cloudtrail | mvexpand resources.uid | stats count by resources.uid | sort -count | head 20

Every address a DNS name resolved to:

class_uid=4003 | mvexpand answers.rdata | table time, device.hostname, query.hostname, answers.rdata

Which enrichment types fire on proxy traffic:

metadata.log_source=conduit_proxy | mvexpand enrichments.name | stats count by enrichments.name

Recipients of mail with a given subject, one row each:

class_uid=4009 email.subject="*invoice*" | mvexpand email.to | stats count by email.to

Notes

  • To test whether an array contains a value, you don't need mvexpand: resources.uid="arn:aws:s3:::acme-prod-data" matches any element, and the has() and mvfind() functions work on arrays. See Functions.
  • Filter before mvexpand. Expanding first multiplies the rows every later command processes.

What's next

  • stats: count the expanded values
  • eval: array functions such as mvcount, mvindex, mvjoin
  • spath: read nested values from unmapped

On this page