fields

Selects only the specified fields or excludes the specified fields from output.

Command properties

ItemDescription
Command typeTransforming
Required permissionNone
License usageN/A
Parallel executionSupported
Distributed executionNot supported

Syntax

fields [-] FIELD [, FIELD ...]

Options

-
Minus sign. When specified, outputs all fields except the listed ones. When omitted, outputs only the listed fields.
FIELD
Name of the field to select or exclude. Specify multiple fields separated by commas (,). You must specify at least one field.

Error codes

Parse errors
Error codeMessageDescription
20400필드 이름이 없습니다.No field name is specified

Description

The fields command selects or excludes fields to output. Without the minus sign (-), only the listed fields are output. With the minus sign, all fields except the listed ones are output.

Examples

  1. Output only specific fields

    table duration=1h FW_ASA | fields src_ip, dst_ip, action
    

    Outputs only the src_ip, dst_ip, and action fields.

  2. Output all fields except specific ones

    table duration=1h WEB_APACHE | fields - line
    

    Outputs all fields except the line field.