docs(inputs.mysql): Add section on how to convert string to numeric (#14620)

This commit is contained in:
Joshua Powers 2024-01-24 13:10:04 -07:00 committed by GitHub
parent c8e12fa15a
commit eda5378829
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 22 additions and 0 deletions

View File

@ -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