Hey, let's assume I have the following CSV and I would like to populate it into world_cup_2018 index
csv: groups.csv
Group A|Uruguay,Russia,Saudi Arabia,Egypt
Group B|Spain,Portugal,Iran,Morocco
....
I would like to create the following fields on my index:
group_name:string
teams: array
My logstash script:
input
{
file{
start_position => "beginning"
path => "/home/groups.csv"
"sincedb_path" => "/dev/null"
}
}
filter
{
csv {
separator => "|"
columns => [
'group_name',
'teams'
]
}
}
output
{
elasticsearch {
hosts => ["https://localhost:9243"]
index => ["world_cup_2018"]
manage_template => false
}
stdout { codec => "rubydebug" }
#stdout { codec => "dots" }
}
Is it possible? If yes, what should I change in this script in order to convert teams field into an array, with comma as my separator?
Thanks!