time_key = "time"
time_unit = "us"
time field as timestamp...socket_listener input plugin supports the JSON format and tag_keys to process most datatime field with the timestamp of the measurement in microseconds since the beginning of the current Epoch (http://www.juniper.net/documentation/en_US/junos/information-products/pathway-pages/ex4300/network-management.pdf){"record-type":"traffic-stats","time":1499268651471993,"router-id":"qfx5100-01","port":"et-0/0/50","rxpkt":82227,"rxucpkt":74232,"rxmcpkt":7985,"rxbcpkt":10,"rxpps":11,"rxbyte":6254098,"rxbps":55232,"rxdroppkt":0,"rxcrcerr":0,"txpkt":104340,"txucpkt":96366,"txmcpkt":7955,"txbcpkt":19,"txpps":13,"txbyte":9313288,"txbps":71552,"txdroppkt":0,"txcrcerr":0}
[[inputs.socket_listener]]
service_address = "udp://:50019"
data_format = "json"
tag_keys = [
"router-id",
"port",
"record-type"
time_key = "time"
time_unit = "us"
Lets call it json_timestamp_units and json_timestamp_key to match existing options in the json serializer.
+1, this would be very helpful for me, trying to access OPC data through a restful api.
This issue proved to be a blocker for our use case of Telegraf, would you be interested in a PR?
@petetnt Absolutely
hello i would be very interested in the timestamp feature, too.
any updates or solutions on this topic?
An updated json parser will have an optional 'json_time_key' and a 'json_time_format' config. This will extract one timestamp per metric from the specified key, so if your data has an array of objects you can extract multiple different timestamps. Would this suit the above use cases?
Hello,
Can you confirm current below documentation:
https://github.com/influxdata/telegraf/blob/master/docs/DATA_FORMATS_INPUT.md#json
References new features like json_time_key and json_time_format that are not yet available as of version 1.7.4 , and that will be available in 1.8.0 ?
Is release date expected on 21 september ?
Thanks for your help
@pmouawad I recently updated the JSON documentation, these options are documented but can you take a look and let me know if you have any feedback.
Any documentation links to the master branch are for the latest development version, so you may want to check the release branch for release specific docs:
https://github.com/influxdata/telegraf/tree/release-1.8/plugins/parsers/json
@bbczeuz were you able to get this working with the UDP streaming? I am trying to do the same, would you mind share your experience?
Thanks
@littlespace I didn't work with that feature for a long time and am ususally offline these days, so you might have to test it yourself
Most helpful comment
@petetnt Absolutely