nano SIEM
Search Commands

format

Supported in:Self-hosted

Compatibility command: passes rows through unchanged, optionally capped at maxresults.

Use format to run a compatible saved query that includes this command. nano passes the rows through unchanged and caps them only when you set maxresults.

Syntax

... | format [maxresults=<n>] [row_sep="<s>"] [col_sep="<s>"] [sep="<s>"]
ArgumentDescription
maxresultsKeep at most this many rows. Without it, every row passes through.
row_sep, col_sep, sepAccepted and ignored.

How it works

In some other SIEM query languages, format turns subsearch results into a search string such as ( ( user.name="a" ) OR ( user.name="b" ) ). nano does not do that: format returns the same rows it receives, limited to maxresults when you set it. It never builds a query string.

You don't need format to feed one search into another. Use one of these instead:

  • A subsearch with IN [...] and return: device.hostname IN [search ... | return device.hostname].
  • join, when you need to filter on aggregates or bring fields across.

Examples

A query that ends in format runs unchanged (here it keeps at most 50 rows):

class_uid=3002 status_id=2 | stats count by user.name | format maxresults=50

The nano way to use one search's results as a filter for another:

class_uid=1007 device.hostname IN [search class_uid=3002 status_id=2 | return device.hostname]

What's next

  • return: supply values to a subsearch
  • head: keep the first N rows
  • join: combine two searches on shared fields

On this page