I have two indexes:
current one: temp
PUT temp/doc/1
{"Field1" : "data1",
"Field2" : "data2", "cnt_no":"1"}
and other index: indexb
PUT indexb/doc/1
{"Field3" : "data3",
"Field4" : "data4", "cnt_no":"1"}
I would like to create the second index based on index temp but add columns from indexb to it. Common field in cnt_no.
Basically I like to add field Field3 and Field4 from indexb based on cnt_no and create indexc.
I used the following logstash but it doesn't create indexc.
input {
elasticsearch {
hosts => ["http://localhost:9200"]
user => "user1"
password => "pass1"
index => "indexb"
}
}
filter {
elasticsearch {
hosts => ["http://locahost:9200"]
user => "user1"
password => "pass1"
index => "temp"
query => "cnt_no:%{cnt_no}"
fields => {
"Field1" => "Field1"
"Field2" => "Field2"
}
}
}
}
output {
elasticsearch {
hosts => ["http://locahost:9200"]
user => "user1"
password => "pass1"
ssl_certificate_verification => "false"
index => "indexc"
document_id => "%{cnt_no}"
doc_as_upsert => "true"
action => "update"
}
}
I am getting error and indexc is not create. there is something wrong in the filter section.
I need help on the filter section.
How can I do this?