[inputs.exec] Error in plugin: metric parse error: expected field

hi, when configuring telegraff I have a problem with downloading data, for example in the version field assigning 1 works, specifying 1.1 also works, while for the version with more dots like 1.1.1 I have the following error:

[inputs.exec] Error in plugin: metric parse error: expected field at 1:42: "testmeasurement,tag1=val1,tag2=val2 version=2.3.4"

output of my script:
testmeasurement,tag1=val1,tag2=val2 version=2.3.4

changing to the following works:
testmeasurement,tag1=val1,tag2=val2 version=2.3

Configuration for telegraf agent

[agent]
  interval = "10s"
  round_interval = true
  metric_batch_size = 1000
  metric_buffer_limit = 10000
  collection_jitter = "0s"
  flush_interval = "10s"
  flush_jitter = "0s"
  precision = ""
  hostname = ""
  omit_hostname = false

[[outputs.influxdb_v2]]
  urls = ["http://X.XX.XX.XXX:8086"] #ip_adress here
  token = "$INFLUX_TOKEN"
  organization = "organization_name"
  bucket = "bucket_name"

[[inputs.exec]]
  commands = ["bash /opt/telegraf/test.telegraf.sh"]
  timeout = "5s"
  data_format = "influx"

I commented on your bug but I’ll paste it here as well:

Fields are suppose to be numeric values not strings. 2.3.4 is not an numeric value, while 2.3 can be parsed as a numeric value. Please see Line protocol | InfluxDB Cloud (TSM) Documentation

Im change my output, and now it is working:

testmeasurement,tag1=val1,tag2=val2 version="2.3.4"

1 Like