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.

I’ll comment on my own post just because I hate finding posts with no particular answer when i’m facing the same problem.

The format as far as I can tell is locked down. If I want to output to a different JSON format it is likely possible but it would involve writing a new serialization plugin and the modification is far too involved for what you’re getting out of it.

I ended up using an GCP Cloud function for the format conversion that works out great.