Outputs execd - how to pass data as argument to a custom script

I am trying to pass the data from input to a custom script as an argument in “outputs.execd” in telegraf.
Can someone help me figure this out, as I have not found any documentations of its possibility within telegraf.
The execd argument is basically the inputs that are coming in.

Here is a sample of what I intend to achieve:

  urls = [

  command = ["/usr/bin/python3", "custom_script.py", "**<argument-1>**"]

Hello @ad_dish,
This resource might be helpful:

The Execd processor plugin runs an external program as a separate process, pipes metrics into the process’s STDIN, and reads processed metrics from its STDOUT. The programs must accept influx line protocol on standard in (STDIN) and output metrics in InfluxDB line protocol to standard output (STDOUT). You can use the Telegraf Execd Go Shim to build and contribute your own external input, processor, and output plugin. Take a look at the external Telegraf plugins for a list of the external plugins that are already available to you.

Program output on standard error is mirrored to the telegraf log.

The example.py script in the repo is a simple example of using the Execd processor plugin to read STDIN and print the metrics to STDOUT with Python.

It looks like this:

# A simple processor. It reads stdin and writes it to stdout.
import sys
def main():
   for line in sys.stdin:
if __name__ == '__main__':

The telegraf configuration for the Execd Processor Plugin that executes the simple example.py script looks like this:

 command = ["python", "./processors/forecasting.py"]
1 Like