Tail plugin telegraf

i am using tail plugin to populate data in influxdb from csv files.
i want to skip a few columns/fields.

For example:
test.csv is as below:
h1,h2,h3,h4,h5
a,b,c,d,e

i want to upload only h1,h3 and h5 in influxdb.
how can i do that using tail plugin?

You should be able to use the fielddrop and tagexclude modifier to drop those from the metric sent to influxdb.

thanks @glinton for the help

[[inputs.tail]]
files = [β€œtest.csv”]
from_beginning = false
data_format = β€œcsv”
csv_header_row_count = 1
csv_tag_columns = [β€œa1”]
csv_delimiter = β€œ,”
csv_trim_space = true
csv_column_names=[β€œa1”,β€œa2”,β€œa3”,β€œa4”,β€œa5”]
name_override = β€œtest”
fielddrop = [β€œa4”]

    [inputs.tail.tags]
            a3="x"

is this inccorectly written?
i was expecting this to remove a4 from the measurement test, but it is not doing so.

Determine whether a4 is a field or a tag, and use fielddrop or tagexclude accordingly.

1 Like