ANSI Stripper Transform

The Vector ansi_stripper transform accepts and outputs log events, allowing you to strips ANSI escape sequences from the specified field.

Configuration

vector.toml
[transforms.my_transform_id]
type = "ansi_stripper" # required
inputs = ["my-source-or-transform-id"] # required
field = "message" # optional, default
  • stringcommonoptional

    field

    The target field to strip ANSI escape sequences from. See Field Notation Syntax for more info.

    • Default: "message"
    • View examples

How It Works

Complex Processing

If you encounter limitations with the ansi_stripper transform then we recommend using a runtime transform. These transforms are designed for complex processing and give you the power of full programming runtime.

Environment Variables

Environment variables are supported through all of Vector's configuration. Simply add ${MY_ENV_VAR} in your Vector configuration file and the variable will be replaced before being evaluated.

You can learn more in the Environment Variables section.

Field Notation Syntax

The field options support Vector's field notation syntax, enabling access to root-level, nested, and array field values. For example:

vector.toml
[transforms.my_ansi_stripper_transform_id]
# ...
field = "message"
field = "parent.child"
field = "array[0]"
# ...

You can learn more about Vector's field notation in the field notation reference.