How to specify timestamp from telegraf to influx

influxdb
telegraf
#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.
#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
#3

thanks for your quickly reply

#4

Is it possible to achieve the same using line protocol?

#5

Yes, when using line protocol with data_format = "influx" the timestamp, if specified, will be used.

1 Like
#6

Thanks. It worked and it has improved the write speed compare to json formal.