sshsu
July 18, 2017, 9:00am
1
hello,i am using telegraf’s plugin tail to tail a log with json data to influxdb, however,i don’t now how to specify timestamp which can be catched from the log, how should i do?
data format:
{“ticker”:{“DealSrc”:1,“DecInPrice”:0,“Price”:25347,“ProdCode”:“HSIN7”,“Qty”:7,“TickerTime”:1499414828}}
TickerTime item is correspond to the timestamp which i want to specify.
daniel
July 18, 2017, 5:58pm
2
Unfortunately this is not something that Telegraf supports at this time with the JSON input format. There is an issue open for this though.
2 Likes
sshsu
July 18, 2017, 11:01pm
3
thanks for your quickly reply
Is it possible to achieve the same using line protocol?
daniel
October 30, 2017, 7:05pm
5
Yes, when using line protocol with data_format = "influx"
the timestamp, if specified, will be used.
1 Like
Thanks. It worked and it has improved the write speed compare to json formal.