Skip to content
This repository has been archived by the owner on May 25, 2022. It is now read-only.

Latest commit

 

History

History
279 lines (232 loc) · 3.89 KB

File metadata and controls

279 lines (232 loc) · 3.89 KB

move operator

The move operator moves (or renames) a field from one location to another.

Configuration Fields

Field Default Description
id move A unique identifier for the operator.
output Next in pipeline The connected operator(s) that will receive all outbound entries.
from required The field from which the value will be moved.
to required The field to which the value will be moved.
on_error send The behavior of the operator if it encounters an error. See on_error.
if An expression that, when set, will be evaluated to determine whether this operator should be used for the given entry. This allows you to do easy conditional parsing without branching logic with routers.

Example Configurations:

Rename value

- type: move
  from: body.key1
  to: body.key3
Input Entry Output Entry
{
  "resource": { },
  "attributes": { },
  "body": {
    "key1": "val1",
    "key2": "val2"
  }
}
{
  "resource": { },
  "attributes": { },
  "body": {
    "key3": "val1",
    "key2": "val2"
  }
}

Move a value from the body to resource

- type: move
  from: body.uuid
  to: resoruce.uuid
Input Entry Output Entry
{
  "resource": { },
  "attributes": { },
  "body": {
    "uuid": "091edc50-d91a-460d-83cd-089a62937738"
  }
}
{
  "resource": {
    "uuid": "091edc50-d91a-460d-83cd-089a62937738"
  },
  "attributes": { },
  "body": { }
}

Move a value from the body to attributes

- type: move
  from: body.ip
  to: attributes.ip
Input Entry Output Entry
{
  "resource": { },
  "attributes": { },
  "body": {
    "ip": "8.8.8.8"
  }
}
{
  "resource": { },
  "attributes": {
    "ip": "8.8.8.8"
  },
  "body": { }
}

Replace the body with an individual value nested within the body

- type: move
  from: body.log
  to: body
Input Entry Output Entry
{
  "resource": { },
  "attributes": { },
  "body": {
    "log": "The log line"
  }
}
{
  "resource": { },
  "attributes": { },
  "body": "The log line"
}

Remove a layer from the body

- type: move
  from: body.wrapper
  to: body
Input Entry Output Entry
{
  "resource": { },
  "attributes": { },
  "body": {
    "wrapper": {
      "key1": "val1",
      "key2": "val2",
      "key3": "val3"
    }
  }
}
}
{
  "resource": { },
  "attributes": { },
  "body": {
    "key1": "val1",
    "key2": "val2",
    "key3": "val3"
  }
}

Merge a layer to the body

- type: move
  from: body.object
  to: body
Input Entry Output Entry
{
  "resource": { },
  "attributes": { },
  "body": {
    "firstTimestamp": "2020-08-13T16:43:57Z",
    "object": {
      "apiVersion": "v1",
      "name": "stanza-g6rzd",
      "uid": "47d965e6-4bb3-4c58-a089-1a8b16bf21b0"
    },
    "lastTimestamp": "2020-08-13T16:43:57Z",
  }
}
{
  "resource": { },
  "attributes": { },
  "body": {
    "firstTimestamp": "2020-08-13T16:43:57Z",
    "apiVersion": "v1",
    "name": "stanza-g6rzd",
    "uid": "47d965e6-4bb3-4c58-a089-1a8b16bf21b0",
    "lastTimestamp": "2020-08-13T16:43:57Z",
  }
}