nano SIEM
Search Commands

rename

Supported in:Self-hosted

Give a field a new name that later commands can use.

Use rename to give a field a new name for later commands in your pipeline.

Syntax

... | rename <field> as <new_name> [, <field> as <new_name> ...]
ArgumentDescription
fieldThe field to rename: an OCSF path, or a field computed earlier (eval, rex, stats output). Quote names with spaces.
new_nameThe new name. Quote it if it contains spaces ("Source IP").

How it works

  • Later commands can use the new name in where, stats … by, sort, table and so on.
  • The original field stays available under its old name as well. Use table or fields to choose which one appears in the output.
  • Renaming several fields in one command is the same as chaining several rename commands.
  • Renaming onto an existing field replaces its value. For example, rename actor.user.name as user.name replaces the existing user.name value with actor.user.name.

Examples

Short names for a source/destination pivot:

class_uid=4001 | rename src_endpoint.ip as client, dst_endpoint.ip as server | stats count by client, server

Rename an account field, then filter and group on the new name:

class_uid=3002 status_id=2 | rename user.name as account | where account!="" | stats count by account | sort -count

Report-friendly names that survive into the final table:

class_uid=4002 | rename http_request.url.hostname as "Site", http_response.code as "Status" | stats count by "Site", "Status"

Rename an aggregate column:

class_uid=1007 | stats dc(device.hostname) as hosts by process.name | rename hosts as host_count | sort -host_count

Notes

  • rename also runs after a nano-side stage (lookup, prevalence, inputlookup, resolve_identity, ai, lateral).
  • table <field> as <alias> selects and renames an output column. Use rename when you want to keep the other fields available.

What's next

  • table: choose output columns, with display aliases
  • fields: keep or remove fields
  • eval: compute a new field

On this page