fluent-plugin-record-modifier icon indicating copy to clipboard operation
fluent-plugin-record-modifier copied to clipboard

how to convert type of value in the new field?

Open zffocussss opened this issue 5 years ago • 1 comments

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

zffocussss avatar Aug 07 '19 07:08 zffocussss

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

brutallino avatar Aug 08 '19 09:08 brutallino