influxdata / telegraf

Agent for collecting, processing, aggregating, and writing metrics, logs, and other arbitrary data.
https://influxdata.com/telegraf
MIT License
14.89k stars 5.6k forks source link

the float clause is not identify #2589

Closed jokerbo1 closed 7 years ago

jokerbo1 commented 7 years ago

Directions

Hellow ,Mr ,I write the follow expression: |%{NUMBER:request_time:float}|

to match this: |0.001|

,if i change expression to this : |%{NUMBER:request_time}| or |%{NUMBER:request_time:tag}| ,it's can be matched result ,but use this |%{NUMBER:request_time:float}| format ,it isn't match anyone result,please help , i want set the datatype of influxdb when insert into the data. thank you

danielnelson commented 7 years ago

This is working for me:

$ cat tmp
|0.001|

Here is my config:

[[inputs.logparser]]
  files = ["tmp"]
  from_beginning = true
  [inputs.logparser.grok]
    patterns = ["\\|%{NUMBER:value:float}\\|"]

And here is the field captured as a float:

logparser_grok,host=loaner value=0.001 1490817129701540356
danielnelson commented 7 years ago

If you are still having issues, please ask over at the InfluxData Community site.