Hi, I need to add some meta-data information the source of which is external file. I am using kafka consumer telegraf plugin, so for adding the metadata during run time, I am thinking to use execd plugin, where I would run a python script to get the tags and insert them in kafka data in run time. However, I am not able to get the tags using python script. Below are the files I am using:
- Python script -
import csv def main(): f = open("meta-data.csv",'r') csvfile = csv.reader(f) heading = next(csvfile) for lines in csvfile: print(lines) if __name__ == "__main__": main()
- Telegraf config:
[[inputs.file]] files = ["input_eg.json"] data_format = "json" ##other config provided [[inputs.execd]] command = ["/usr/bin/python3", "python_code.py"] data_format = "influx"
Also, can somebody suggest would could be an alternative/better solution for this problem statement?