I’m picking up data from MQTT in JSON format via Telegraf and forwarding it on to some InfluxDB databases.
My input JSON has a timestamp encoded in it as a parameter which I need to have in the Line Protocol I forward on so I use json_time_key. Unfortunately for a journal I’m also creating in a separate database I’d also like the time of arrival of the data from MQTT (this seems to be not available as json_time_key sets the timestamp to the JSON payload).
Does anyone have any ideas how I can get both, ideally as the JSON payload timestamp as my Line Protocol timestamp and the time of arrival timestamp as a value?
Or even, as I can get the time-of-arrival as a timestamp and the other timestamp as a value in my Line Procol - is there a way to swap the value and timestamp around? That would be ideal. Big ask eh?