rename

Renames fields.

Command properties

ItemDescription
Command typeProcessing query
Required permissionNone
License usageN/A
Parallel executionSupported
Distributed executionNot 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 codeMessageDescription
20800Enter the source field.The source field name is not specified
20801Enter the target field.The new field name is not specified
20802Invalid syntax: as is expected at [token].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

  1. Renaming a field

    table duration=1h FW_ASA | rename src_ip as source
    

    Renames the src_ip field to source.

  2. Renaming multiple fields at once

    table duration=1h FW_ASA | rename src_ip as source, dst_ip as destination
    

    Renames src_ip to source and dst_ip to destination.