Relevant telegraf.conf:
[[inputs.file]]
files = ["/data/siem/input/*.csv"]
data_format = "csv"
csv_header_row_count = 1
System info:
Steps to reproduce:
- use two or more csv files for input but set different headers rows there
Expected behavior:
Read header row from every file in the input list and use it for ongoing metrics.
Actual behavior:
Telegraf when started reads header row only from the first file of “files = [”/data/siem/input/*.csv"]" and uses it for the next file which has its own different header row.
Additional info:
I just removed the column names check from the source. But ideally this should be configurable behavior.
Below are diffs for
~/go/src/github.com/influxdata/telegraf/plugins/parsers/csv/parser.go
> 64c64
- if len(p.ColumnNames) == 0 {
> ---
+ // if len(p.ColumnNames) == 0 {
> 84,89c84,89
- } else {
- // if columns are named, just skip header rows
- for i := 0; i < p.HeaderRowCount; i++ {
- csvReader.Read()
- }
- }
> ---
+ // } else {
+ // // if columns are named, just skip header rows
+ // for i := 0; i < p.HeaderRowCount; i++ {
+ // csvReader.Read()
+ // }
+ // }
Relevant telegraf.conf:
System info:
Steps to reproduce:
Expected behavior:
Read header row from every file in the input list and use it for ongoing metrics.
Actual behavior:
Telegraf when started reads header row only from the first file of “files = [”/data/siem/input/*.csv"]" and uses it for the next file which has its own different header row.
Additional info:
I just removed the column names check from the source. But ideally this should be configurable behavior.
Below are diffs for
~/go/src/github.com/influxdata/telegraf/plugins/parsers/csv/parser.go