I have several directories and each has several subdirectories and each has csv files within them. I would like to export all these csv files inside all directories to elasticsearch using logstash and automatically take column names. Note that different csv files have different column names. There are about 7 types of csv files in these directories and each type has the same column names.
Please suggest me what to do in such case.
input {
file {
path => "/dir/dir*///*.csv"
start_position => "beginning"
}
}
filter {
if ([message] =~ " ") {
drop { }
} else {
csv { }
}
}
output {
elasticsearch {
hosts => ["http://10.0.0.4:9200"]
}
stdout{}
}