Closed asdptkt closed 5 years ago
You can use json_timestamp_units on the output data_format:
[[outputs.http]]
url = "http://recorder:8080/v1/data"
timeout = "5s"
method = "POST"
data_format = "json"
json_timestamp_units = "1ms"
[outputs.http.headers]
Content-Type = "application/json"
Authorization = "Bearer mytoken"
@danielnelson I think this should be added to the parser documentation.
Since converting to JSON is done in an output plugin, the data_format option is selecting the json serializer.
Relevant telegraf.conf:
System info:
Telegraf 1.9.2-Alpine via Docker
Steps to reproduce:
Expected behavior:
Timestamp in milliseconds.
Actual behavior:
Timestamp in seconds.
Additional info:
I think this is parser problem because if I change the output data format to
influx
the resulting timestamp will be in nanoseconds.