I am trying to create a csv file by using the output csv in logstash.
How can I insert the header only once at the very beginning?
my data:
es_field1 es_field2 es_field3
1 2 3
4 5 6
7 8 9
logstash config:
output {
path => "/my/path/to/csv"
csv_options => {
"write_headers" => true
"hearders" => "a,b,c"
}
fields => ["es_field1", "es_field", "es_field"]
}
result:
a b c
1 2 3
a b c
4 5 6
a b c
7 8 9
Headers are inserted for each row.
How can I insert the header only once at the very beginning?