Telegraf inputs.exec parsing error

Hi, when I’m trying to use inputs.exec plugin with my custom script, its output is below. But whenever I start telegraf service, I get the following error:
Jul 25 15:13:10 iad01-c01-isn06 telegraf[5245]: 2017-07-25T15:13:10Z E! Error in plugin [inputs.exec]: metric parsing error, reason: [invalid field format], buffer: [list index out of range], index: [10]

I searched a little and found that this error appears when output doesn’t meet influx line protocol criterias. However I couldn’t find any discrepancies with information from this article.

Now I am in need for help on getting this to work and will be appreciate for any kind of help.

Below is the script output example:

events_count,cell=cell01,class=EVENT_INITIAL,tool=sjc01,tool_class=Event,origin=EventReconciler,status=OPEN,severity=OK count=410666
events_count,cell=cell01,class=EVENT_INITIAL,tool=sjc01,tool_class=Event,origin=EventReconciler,status=OPEN,severity=MINOR count=39988
events_count,cell=cell01,class=EVENT_INITIAL,tool=iad01,tool_class=Event,origin=EventReconciler,status=OPEN,severity=OK count=261159
events_count,cell=cell01,class=EVENT_INITIAL,tool=iad01,tool_class=Event,origin=EventReconciler,status=OPEN,severity=WARNING count=42579
events_count,cell=cell01,class=EVENT_INITIAL,tool=iad01,tool_class=Event,origin=EventReconciler,status=OPEN,severity=INFO count=111950
events_count,cell=cell01,class=EVENT_INITIAL,tool=iad01,tool_class=Event,origin=EventReconciler,status=OPEN,severity=MINOR count=35278
events_count,cell=cell01,class=EVENT_INITIAL,tool=sjc01,tool_class=Event,origin=EventReconciler,status=OPEN,severity=INFO count=153410
events_count,cell=cell01,class=EVENT_INITIAL,tool=sjc01,tool_class=Event,origin=EventReconciler,status=OPEN,severity=WARNING count=66168
events_count,cell=cell01,class=EVENT_INITIAL,tool=ams01,tool_class=Event,origin=EventUDPIntegrationServer,status=OPEN,severity=MINOR count=519
events_count,cell=cell01,class=EVENT_INITIAL,tool=ams01,tool_class=Event,origin=EventReconciler,status=OPEN,severity=OK count=21093
events_count,cell=cell01,class=EVENT_INITIAL,tool=zrh01,tool_class=Event,origin=EventReconciler,status=OPEN,severity=WARNING count=10436
events_count,cell=cell01,class=EVENT_INITIAL,tool=ams01,tool_class=Event,origin=EventUDPIntegrationServer,status=OPEN,severity=OK count=1175
events_count,cell=cell01,class=EVENT_INITIAL,tool=zrh01,tool_class=Event,origin=EventReconciler,status=OPEN,severity=OK count=21279
events_count,cell=cell01,class=EVENT_INITIAL,tool=ams01,tool_class=Event,origin=EventUDPIntegrationServer,status=OPEN,severity=INFO count=182
events_count,cell=cell01,class=EVENT_INITIAL,tool=zrh01,tool_class=Event,origin=EventUDPIntegrationServer,status=OPEN,severity=INFO count=491
events_count,cell=cell01,class=EVENT_INITIAL,tool=zrh01,tool_class=Event,origin=EventUDPIntegrationServer,status=OPEN,severity=OK count=3467
events_count,cell=cell01,class=EVENT_INITIAL,tool=zrh01,tool_class=Event,origin=EventReconciler,status=OPEN,severity=INFO count=7787
events_count,cell=cell01,class=EVENT_INITIAL,tool=ams01,tool_class=Event,origin=EventReconciler,status=OPEN,severity=INFO count=6502
events_count,cell=cell01,class=EVENT_INITIAL,tool=iad01,tool_class=Event,origin=EventReconciler,status=OPEN,severity=MAJOR count=505
events_count,cell=cell01,class=EVENT_INITIAL,tool=sjc01,tool_class=Event,origin=EventReconciler,status=OPEN,severity=MAJOR count=599
events_count,cell=cell01,class=EVENT_INITIAL,tool=ams01,tool_class=Event,origin=EventReconciler,status=OPEN,severity=MINOR count=3312
events_count,cell=cell01,class=LM_INITIAL,tool=lm-rc,tool_class=LogicMonitor,origin=LogicMonitorReconciler,status=OPEN,severity=MAJOR count=18
events_count,cell=cell01,class=LM_INITIAL,tool=lm-rc,tool_class=LogicMonitor,origin=LogicMonitorReconciler,status=OPEN,severity=WARNING count=446
events_count,cell=cell01,class=LM_INITIAL,tool=lm-rc,tool_class=LogicMonitor,origin=LogicMonitorReconciler,status=OPEN,severity=MINOR count=166
events_count,cell=cell01,class=LM_INITIAL,tool=lm-rc,tool_class=LogicMonitor,origin=LogicMonitorReconciler,status=OPEN,severity=OK count=649
events_count,cell=cell01,class=EVENT_INITIAL,tool=iad01,tool_class=Event,origin=EventReconciler,status=OPEN,severity=UNKNOWN count=256
events_count,cell=cell01,class=EVENT_INITIAL,tool=sjc01,tool_class=Event,origin=EventReconciler,status=OPEN,severity=UNKNOWN count=64
events_count,cell=cell01,class=EVENT_INITIAL,tool=ams01,tool_class=Event,origin=EventReconciler,status=OPEN,severity=MAJOR count=56
events_count,cell=cell01,class=EVENT_INITIAL,tool=ams01,tool_class=Event,origin=EventReconciler,status=OPEN,severity=WARNING count=10203
events_count,cell=cell01,class=EVENT_INITIAL,tool=ams01,tool_class=Event,origin=EventUDPIntegrationServer,status=OPEN,severity=MAJOR count=2
events_count,cell=cell01,class=EVENT_INITIAL,tool=ams01,tool_class=Event,origin=EventUDPIntegrationServer,status=OPEN,severity=WARNING count=102
events_count,cell=cell01,class=EVENT_INITIAL,tool=zrh01,tool_class=Event,origin=EventUDPIntegrationServer,status=OPEN,severity=MAJOR count=7
events_count,cell=cell01,class=EVENT_INITIAL,tool=zrh01,tool_class=Event,origin=EventUDPIntegrationServer,status=OPEN,severity=WARNING count=777
events_count,cell=cell01,class=EVENT_INITIAL,tool=iad01,tool_class=Event,origin=EventUDPIntegrationServer,status=OPEN,severity=OK count=71332
events_count,cell=cell01,class=EVENT_INITIAL,tool=iad01,tool_class=Event,origin=EventUDPIntegrationServer,status=OPEN,severity=INFO count=20373
events_count,cell=cell01,class=EVENT_INITIAL,tool=iad01,tool_class=Event,origin=EventUDPIntegrationServer,status=OPEN,severity=WARNING count=11235
events_count,cell=cell01,class=EVENT_INITIAL,tool=iad01,tool_class=Event,origin=EventUDPIntegrationServer,status=OPEN,severity=MINOR count=12877
events_count,cell=cell01,class=EVENT_INITIAL,tool=zrh01,tool_class=Event,origin=EventReconciler,status=OPEN,severity=MINOR count=2014
events_count,cell=cell01,class=EVENT_INITIAL,tool=zrh01,tool_class=Event,origin=EventUDPIntegrationServer,status=OPEN,severity=MINOR count=1379
events_count,cell=cell01,class=EVENT_INITIAL,tool=iad01,tool_class=Event,origin=EventUDPIntegrationServer,status=OPEN,severity=MAJOR count=165
events_count,cell=cell01,class=LM_INITIAL,tool=lm-glip,tool_class=LogicMonitor,origin=LogicMonitorReconciler,status=OPEN,severity=WARNING count=855
events_count,cell=cell01,class=LM_INITIAL,tool=lm-glip,tool_class=LogicMonitor,origin=LogicMonitorReconciler,status=OPEN,severity=OK count=910
events_count,cell=cell01,class=LM_INITIAL,tool=lm-glip,tool_class=LogicMonitor,origin=LogicMonitorReconciler,status=OPEN,severity=MINOR count=228
events_count,cell=cell01,class=EVENT_INITIAL,tool=iad01,tool_class=Event,origin=EventUDPIntegrationServer,status=OPEN,severity=UNKNOWN count=82
events_count,cell=cell01,class=LM_INITIAL,tool=lm-glip,tool_class=LogicMonitor,origin=LogicMonitorReconciler,status=OPEN,severity=MAJOR count=24
events_count,cell=cell01,class=EVENT_INITIAL,tool=zrh01,tool_class=Event,origin=EventUDPIntegrationServer,status=OPEN,severity=UNKNOWN count=4
events_count,cell=cell01,class=EVENT_INITIAL,tool=ams01,tool_class=Event,origin=EventUDPIntegrationServer,status=OPEN,severity=UNKNOWN count=2
events_count,cell=cell01,class=EVENT_INITIAL,tool=ams01,tool_class=Event,origin=EventReconciler,status=OPEN,severity=UNKNOWN count=16
events_count,cell=cell01,class=EVENT_INITIAL,tool=zrh01,tool_class=Event,origin=EventReconciler,status=OPEN,severity=UNKNOWN count=21
events_count,cell=cell01,class=EVENT_INITIAL,tool=sjc01,tool_class=Event,origin=EventUDPIntegrationServer,status=OPEN,severity=INFO count=14417
events_count,cell=cell01,class=EVENT_INITIAL,tool=sjc01,tool_class=Event,origin=EventUDPIntegrationServer,status=OPEN,severity=WARNING count=11130
events_count,cell=cell01,class=EVENT_INITIAL,tool=sjc01,tool_class=Event,origin=EventUDPIntegrationServer,status=OPEN,severity=OK count=42527
events_count,cell=cell01,class=EVENT_INITIAL,tool=sjc01,tool_class=Event,origin=EventUDPIntegrationServer,status=OPEN,severity=MINOR count=10467
events_count,cell=cell01,class=EVENT_INITIAL,tool=sjc01,tool_class=Event,origin=EventUDPIntegrationServer,status=OPEN,severity=UNKNOWN count=29
events_count,cell=cell01,class=EVENT_INITIAL,tool=sjc01,tool_class=Event,origin=EventUDPIntegrationServer,status=OPEN,severity=MAJOR count=133
events_count,cell=cell01,class=EVENT_INITIAL,tool=zrh01,tool_class=Event,origin=EventReconciler,status=OPEN,severity=MAJOR count=32
events_count,cell=cell01,class=MC_ADAPTER_ERROR,tool=mcxa,tool_class=MA::EngineMgr,origin=snmp_adapter_eot,status=OPEN,severity=CRITICAL count=1

Influx conf file:
[[outputs.influxdb]]
urls = [“http://influxdb:8086”]
database = "stats"
retention_policy = "“
write_consistency = “any"
timeout = “5s”
[[inputs.exec]]
commands = [
”/etc/telegraf/scripts/rates_to_telegraf.py cell01”,
]
interval = "1m"
timeout = "30s"
data_format = “influx”

I am able to run the exec plugin with a script similar to this but containing all the output above, and there are no parse errors:

cat -<<EOF
events_count,cell=cell01,class=EVENT_INITIAL,tool=sjc01,tool_class=Event,origin=EventReconciler,status=OPEN,severity=OK count=410666
events_count,cell=cell01,class=EVENT_INITIAL,tool=sjc01,tool_class=Event,origin=EventReconciler,status=OPEN,severity=MINOR count=39988
EOF

What version of Telegraf are you using?