Skip to content

Latest commit

 

History

History
91 lines (72 loc) · 1.75 KB

File metadata and controls

91 lines (72 loc) · 1.75 KB

unquote operator

The unquote operator unquotes a string.

Configuration Fields

Field Default Description
id unquote A unique identifier for the operator.
output Next in pipeline The connected operator(s) that will receive all outbound entries.
field required The field to unquote. Must be a string.
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.

The operator applies the strconv.Unquote function to the specified field. This can only be applied to strings that are double quoted ("\"foo\""), back quoted ("`bar`"), or to single characters that are single quoted ("'v'")

Example Configurations:


Unquote the body

- type: unquote
  field: body
Input Entry Output Entry
{
  "resource": { },
  "attributes": { },
  "body": "\"hello\""
}
{
  "resource": { },
  "attributes": { },
  "body": "hello"
}

Unquote an attribute

- type: unquote
  field: attributes.foo
Input Entry Output Entry
{
  "resource": { },
  "attributes": {
    "foo": "`bar`"
  },
}
{
  "resource": { },
  "attributes": {
    "foo": "bar"
  },
}