Skip to content

Unset measurement name with csv parser #5530

@danielnelson

Description

@danielnelson

Relevant telegraf.conf:

[[inputs.file]]
  files =["test.csv"]
  data_format = "csv"
  csv_header_row_count =1
  csv_delimiter = "|"
  csv_trim_space = true
  csv_skip_columns =3

test.csv:

         Timestamp | Total Queued || Queued in P0 | Queued in P1 | Dropped |     All | Process | Modload |    File |     Net |     DNS |   Proxy | Blocked |   Other |
  131922145722147338 |            0 ||            0 |            0 |       0 |       3 |       0 |       0 |       0 |       0 |       2 |       0 |       0 |       1 |
  131922145872546833 |            0 ||            0 |            0 |       0 |       4 |       0 |       0 |       0 |       0 |       2 |       0 |       0 |       2 |

System info:

Telegraf 1.10

Steps to reproduce:

  1. Use configuration above

Expected behavior:

foo All=4i,Process=0i,Modload=0i,Net=0i,DNS=2i,Blocked=0i,Dropped=0i,File=0i,Other=2i,Proxy=0i,Queued\ in\ P1=0i
foo DNS=2i,Proxy=0i,Blocked=0i,Other=1i,Queued\ in\ P1=0i,All=3i,Process=0i,Net=0i,Dropped=0i,Modload=0i,File=0i

Actual behavior:

2019-03-05T00:55:24Z E! [serializers.influx] could not serialize metric: invalid name; discarding metric

In addition to this error, the skip columns does not seem to be working properly. When adding name_override = "xyzzy" to the config the line is output but the Queued in P0 is not skipped:

xyzzy Queued\ in\ P0=0i,All=4i,File=0i,Blocked=0i,DNS=2i,Other=2i,Queued\ in\ P1=0i,Dropped=0i,Net=0i,Proxy=0i,Process=0i,Modload=0i 1551747938000000000
xyzzy All=3i,Modload=0i,Net=0i,Queued\ in\ P1=0i,DNS=2i,Dropped=0i,Proxy=0i,Blocked=0i,Other=1i,Queued\ in\ P0=0i,Process=0i,File=0i 1551747938000000000

Additional info:

https://community.influxdata.com/t/telegraf-inputs-file-timestamp-unix/8175/5

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugunexpected problem or unintended behavior

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions