hotel1 and star csv files merge and transfer to elasticsearch. hotel2.csv just transfer to elasticseach. both data should append to existing index in hotel in elasticsearch
*hotel1.csv
hcode
hname
starcode
*star.csv
starcode
starrating
*hotel2.csv
code
name
star
existing index :hotel
hotelcode
hotelname
categorycode
category
I just want to know how to map csv field with existing index fields
*
hotelcode <=hotel1.hcode
hotelname <=hotel1.hname
categorycode <= hotel1.starcode
category <= star.starrating
hotelcode <=hotel2.code
hotelname <=hotel2.name
categorycode
category <= hotel2.star
input {
file {
path => "/home/namalie/elk/test/hotel.csv"
start_position=>"beginning"
sincedb_path => "/dev/null"
}
}
filter {
csv {
separator => ","
columns => ["hcode","hname","starcode"]
}
translate {
destination => "[@metadata][lookup]"
dictionary_path => "/home/namalie/elk/test/starrating.csv"
field => "starcode" }
dissect { mapping => { "[@metadata][lookup]" => "%{starrating}" } }
}
output {
elasticsearch {
hosts => ["http://localhost:9200/"]
index =>"hotel"
document_type =>"hotel"
}
stdout {}
}