rename
Description
Renames fields.
Syntax
rename <src-field> AS <dst-field> [ , <src-field> AS <dst-field> ...]
Required Arguments
| Parameter | Syntax | Description |
|---|---|---|
src-field | <field> | Name of the source field. |
dst-field | <field> | New name for the field. |
Using Wildcards
The * symbol is supported for bulk field renaming. Multiple uses of * within a single pattern are allowed.
Examples
These examples demonstrate renaming specific fields and bulk renaming by template.
Example 1
In this example, several specific fields are renamed using as.
source radius_logs
| rename user as sysuser, password as secret
Example 2
In this example, * helps remove a common prefix from a group of fields.
source company_workers | rename company-* as *
Example 3
In this example, a template with two wildcard characters * is demonstrated, allowing capturing and preserving individual parts of the field name during renaming.
source company_workers | rename *-company-* as *-with-*