rename
Renames fields.
Command properties
| Item | Description |
|---|---|
| Command type | Processing query |
| Required permission | None |
| License usage | N/A |
| Parallel execution | Supported |
| Distributed execution | Not supported |
Syntax
rename FROM as TO [, FROM as TO ...]
Options
FROM- Original field name. Separate multiple pairs with commas (
,). TO- New field name.
Error codes
Parse errors
| Error code | Message | Description |
|---|---|---|
| 20800 | as-token-not-found | The source field name is not specified |
| 20801 | to-field-not-found | The new field name is not specified |
| 20802 | invalid-as-position | The as keyword is missing or in the wrong position |
Description
The rename command moves the value of the original field to a field with the new name and removes the original field. Records where the original field does not exist are passed through unchanged.
Examples
-
Renaming a field
table duration=1h FW_ASA | rename src_ip as sourceRenames the
src_ipfield tosource. -
Renaming multiple fields at once
table duration=1h FW_ASA | rename src_ip as source, dst_ip as destinationRenames
src_iptosourceanddst_iptodestination.