I have the following .conf file for Logstash:
input {
file {
path => "C:/elastic/logstash-8.3.2/config/*.csv"
start_position => "beginning"
sincedb_path => "NULL"
}
}
filter {
csv {
separator => ";"
columns => ["name","deposit","month"]
}
mutate {
convert => {
"deposit" => "integer"
}
}
}
output {
elasticsearch {
hosts => "http://localhost:9200"
index => "payment_test"
}
stdout {}
}
I get inputs from 10 .csv files, which have names like in-0.csv
, in-1.csv
and so on. I want the index names in ElasticSearch to be payment_test-0
, payment_test-1
and so on for the corresponding .csv input files (the data in in-0.csv
would be in index payment_test-0
and so on). How can I achieve this?