Set the Value of a Field

Assign values to new fields using the setField() function

Query

logscale
item := 4
| setField(target="foo", value=item + 10)

Introduction

Set the value of a target field as the result of an expression. This is equivalent to:

logscale
item := 4
| foo := item + 10

Step-by-Step

  1. Starting with the source repository events.

  2. logscale
    item := 4

    In a test event the field item is set to 4.

  3. logscale
    | setField(target="foo", value=item + 10)

    Sets the value of the target field foo as the result of the expression value of item + 10.

  4. Event Result set.

Summary and Results

fooitem
144