Documentation

Enum Processor Plugin

This plugin allows the mapping of field or tag values according to the configured enumeration. The main use-case is to rewrite numerical values into human-readable values or vice versa. Default mappings can be configured to be used for all remaining values.

Introduced in: Telegraf v1.8.0 Tags: transformation OS support: all

Global configuration options

In addition to the plugin-specific configuration settings, plugins support additional global and plugin configuration settings. These settings are used to modify metrics, tags, and field or create aliases and configure ordering, etc. See the CONFIGURATION.md for more details.

Configuration

# Map enum values according to given table.
[[processors.enum]]
  [[processors.enum.mapping]]
    ## Names of the fields to map. Globs accepted.
    fields = ["status"]

    ## Name of the tags to map. Globs accepted.
    # tags = ["status"]

    ## Destination tag or field to be used for the mapped value.  By default the
    ## source tag or field is used, overwriting the original value.
    dest = "status_code"

    ## Default value to be used for all values not contained in the mapping
    ## table.  When unset and no match is found, the original field will remain
    ## unmodified and the destination tag or field will not be created.
    # default = 0

    ## Table of mappings
    [processors.enum.mapping.value_mappings]
      green = 1
      amber = 2
      red = 3

Example

- xyzzy status="green" 1502489900000000000
+ xyzzy status="green",status_code=1i 1502489900000000000

With unknown value and no default set:

- xyzzy status="black" 1502489900000000000
+ xyzzy status="black" 1502489900000000000

Was this page helpful?

Thank you for your feedback!


The future of Flux

Flux is going into maintenance mode. You can continue using it as you currently are without any changes to your code.

Read more

New in InfluxDB 3.4

Key enhancements in InfluxDB 3.4 and the InfluxDB 3 Explorer 1.2.

See the Blog Post

InfluxDB 3.4 is now available for both Core and Enterprise, which introduces offline token generation for use in automated deployments and configurable license type selection that lets you bypass the interactive license prompt. InfluxDB 3 Explorer 1.2 is also available, which includes InfluxDB cache management and other new features.

For more information, check out: