Skip to content

Commit

Permalink
docs(inputs.mysql): Add section on how to convert string to numeric (i…
Browse files Browse the repository at this point in the history
  • Loading branch information
powersj authored and hhiroshell committed Feb 1, 2024
1 parent a00143f commit 865c3af
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions plugins/inputs/mysql/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,28 @@ See the [CONFIGURATION.md][CONFIGURATION.md] for more details.
# insecure_skip_verify = false
```

### String Data

Some fields may return string data. This is unhelpful for some outputs where
numeric data is required (e.g. Prometheus). In these cases, users can make use
of the enum processor to convert string values to numeric values. Below is an
example using the `slave_slave_io_running` field, which can have a variety of
string values:

```toml
[[processors.enum]]
namepass = "mysql"
[[processors.enum.mapping]]
field = "slave_slave_io_running"
dest = "slave_slave_io_running_int"
default = 4
[processors.enum.mapping.value_mappings]
Yes = 0
No = 1
Preparing = 2
Connecting = 3
```

### Metric Version

When `metric_version = 2`, a variety of field type issues are corrected as well
Expand Down

0 comments on commit 865c3af

Please sign in to comment.