fangli / fluent-plugin-influxdb

A buffered output plugin for fluentd and InfluxDB
MIT License
111 stars 65 forks source link

Backslashes are not properly escaped hence result in "unable to parse ... bad timestamp" error on InfluxDB #73

Open jeffi7 opened 7 years ago

jeffi7 commented 7 years ago

Original log line like this;

Parameters: {"commit_message"=>"Revert \"Merge Branch 'hot_fix' into 'master'\"\r\n\r\nSee MR !2"}

should be encoded on the line protocol like this;

production.log,message="Parameters ...snip... into 'master'\\\"\\r\\n\\r\\nSee MR !2\"}"

but out_influxdb encodes like this;

production.log,message="Parameters ...snip... into 'master'\\"\r\n\r\nSee MR !2\"}"

which InfluxDB can not parse and returns "unable to parse ... bad timestamp" error.

For your reference, out_file encodes it just right;

production.log {"message":"Parameters ...snip... into 'master'\\\"\\r\\n\\r\\nSee MR !2\"}"}

Versions: fluent-plugin-influxdb:1.0.0.rc2 fluentd 0.14 influxdb 1.2