What is the easiest way to regenerate implied timestamps from array values?

We are trying to send 10x100 values every second wirelessly, and trying to get some efficiency in the formatting of the JSON messages sent via MQTT.

So we put them in JSON arrays.
{"ID":"Unit_A", "timestamp":1234567890000, "Waveform1":[1,2,3....,100], "Waveform2":[1,2,3,...,100], ..... , "Waveform10":[1,2,3,...,100]}

But telegraf creates many fields like Waveform1_0, Waveform1_99, etc. What I wanted was to have one field for each waveform, and then create new timestamps at a constant rate.

I have complete control over the JSON format, but if I have to add names and timestamps for each value to the JSON, the wireless link will be overloaded.

Is there a way to extend telegraf to do that? Or am I forced to use a discrete script to enumerate the array timestamps?

I’m not quite sure I understand what you’re getting at.
One possibility could be to package the arrays intitially as strings:

 "Waveform1" : "[1,2,3....,100]",

In addition, there would of course be the possibility to process the data with a separate processor plugin. The following possibilities would come into question:

  • processors.starlark
  • processors.execd