External Plugin

I’m trying to write an external plugin to do some additional processing that is somewhat detailed here

Most of the plugins listed there are input plugins and though I figured out something that seems to work to let me play around with manual data manipulation, I wanted to see if this was even doable.

I’m working with a processors.execd plugin, reading data from STDIN and writing out to STDOUT.

I can parse the fields, add data, clone the messages and do all kinds of manipulation, but here’s my question… can I convert the data to a specific output format? I need it to be JSON but the model needs to be different.

Is that possible with the execd or would I always need some type of post-processing outside of telegraf to accomplish this?

I have a feeling that in order to do this, I would need to create a custom serializer that does what I need and run a modified code base of telegraf which sounds horrible.

It was suggested to use logstash, to do this, but ideally i’d like to try to keep it all under the same code base if possible.

Thank you for any help/ suggestions.