Rename a Single Field - Example 2

Rename a single field using the rename() function with assignment syntax to define the new name of the field

Query

logscale
goodName := rename(badName)

Introduction

The rename() function is used to rename one or more fields. In this example, only one field is renamed using the assignment operator (:=).

Step-by-Step

  1. Starting with the source repository events.

  2. logscale
    goodName := rename(badName)

    Renames the badName field to goodName by assigning the new value (variable name) to the field. The value on the right side of the assignment operator is set equal to the value on the left side of it.

  3. Event Result set.

Summary and Results

The query is used to quickly rename single fields.