Skip to content

Invalid number error when parsing line protocol with dos line endings #3631

Closed
@danielnelson

Description

Bug report

Relevant telegraf.conf:

[[inputs.exec]]
   commands = ['sh -c "cat ~/telegraf.txt"']
   timeout = "25s"
   data_format = "influx"

System info:

$ ./telegraf --version
Telegraf v1.6.0~06c21fb9 (git: master 06c21fb9)

Steps to reproduce:

$ cat ~/telegraf.txt
dt,entity=SERVICE-F08D806E7EF685CF timeseriesId="com.dynatrace.builtin:service.responsetime",metric=56167.75
dt,entity=SERVICE-F08D806E7EF685CF timeseriesId="com.dynatrace.builtin:service.responsetime",metric=65166.0
$ file ~/telegraf.txt
/home/dbn/telegraf.txt: ASCII text, with CRLF line terminatorst
$ telegraf --test
2018/01/02 10:54:07 I! Using config file: /home/dbn/.telegraf/telegraf.conf
* Plugin: inputs.exec, Collection 1
2018-01-02T18:54:07Z E! Error in plugin [inputs.exec]:  invalid number invalid number

Expected behavior:

$ telegraf --test
2018/01/02 11:00:57 I! Using config file: /home/dbn/.telegraf/telegraf.conf
* Plugin: inputs.exec, Collection 1
> dt,entity=SERVICE-F08D806E7EF685CF,host=loaner timeseriesId="com.dynatrace.builtin:service.responsetime",metric=56167.75 1514919658000000000
> dt,entity=SERVICE-F08D806E7EF685CF,host=loaner timeseriesId="com.dynatrace.builtin:service.responsetime",metric=65166 1514919658000000000

Actual behavior:

2018-01-02T18:54:07Z E! Error in plugin [inputs.exec]:  invalid number invalid number

Additional info:

Changing the file to unix line endings results in correct parsing.

Metadata

Assignees

Labels

bugunexpected problem or unintended behavior

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions