Rename a Single Field - Example 1

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

Query

flowchart LR; %%{init: {"flowchart": {"defaultRenderer": "elk"}} }%% repo{{Events}} 0[\Add Field/] result{{Result Set}} repo --> 0 0 --> result
logscale
rename(field=badName, as=goodName)

Introduction

The rename() function is used to rename one or more fields. In this example, only one field is renamed using the as parameter to define the new name of the field.

Step-by-Step

  1. Starting with the source repository events.

  2. flowchart LR; %%{init: {"flowchart": {"defaultRenderer": "elk"}} }%% repo{{Events}} 0[\Add Field/] result{{Result Set}} repo --> 0 0 --> result style 0 fill:#ff0000,stroke-width:4px,stroke:#000;
    logscale
    rename(field=badName, as=goodName)

    Renames the field badName to goodName.

  3. Event Result set.

Summary and Results

The query is used to quickly rename single fields.