[[processors.enum]]
[[processors.enum.mapping]]
## Name of the field to map
field = "instancId"
## Destination field to be used for the mapped value. By default the source
## field is used, overwriting the original value.
dest = "user"
## Default value to be used for all values not contained in the mapping
## table. When unset, the unmodified value for the field will be used if no
## match is found.
default = 0
## Table of mappings
[processors.enum.mapping.value_mappings]
123 = 1
1234 = 2
12345 = 3
2 回答
看看processors . 如果您只有一组您想要使用的已知值,我认为enum将是最佳选择 . 以下是针对您的案例更新的示例:
请参阅CONFIGURATION.md docs: