fluent-plugin-record-modifier
fluent-plugin-record-modifier copied to clipboard
how to convert type of value in the new field?
hi I use this plugin to create a new key (or a new field),the value is "123",how can I get a integer 123?as I output it to EFK stack for statistics
Hi. you must use fluent-plugin-elasticsearch and write own template with mapping field: example_template:
{
"index_patterns": ["logstash-*", "otherpattern-*"],
"mappings": {
"properties": {
"size":{ "type": "integer"},
"coordinates":{ "type": "geo_point"},
"remote":{ "type": "ip"},
"code":{ "type": "short"}
}
}
}
and configure fluent in elasticsearch section like: ... template_file /fluentd/etc/example_template template_name example_template template_overwrite true max_retry_putting_template 15 ...