We have the ff scenario:
Goal : Perform join in two es index at indexing level
Solution:
input {
exec {
codec => json
interval => 60
command => "bash /query_index_1.sh" //bash script contains elasticsearch query
}
}
filter {
split { field => "[aggregations][agg1][buckets]" }
split { field => "[aggregations][agg1][buckets][agg2][buckets]" }
split { field => "[aggregations][agg1][buckets][agg2][buckets][agg3][buckets]" }
mutate {
add_field => {
"FIELD_1" => "%{[aggregations][agg1][buckets][key]}"
"FIELD_2" => "%{[aggregations][agg1][buckets][agg2][buckets][key]}"
"FIELD_3" => "%{[aggregations][agg1][buckets][agg2][buckets][agg2][buckets][key]}"
}
}
elasticsearch {
hosts => ["host:9200"]
query_template => "/query_index_2.json"
aggregation_fields => {
"my_aggs" => "location"
}
}
}
output {
stdout {codec => rubydebug}
}
wherein the field "location" contains a hash value of
location =>
{
"doc_count_error_upper_bound" => 0,
"sum_other_doc_count" => 473350,
"buckets" => [
{
"key" => "value1",
"doc_count" => 4983
}
]
}
How can i get the "value1"?