I have a Logstash configuration with the 'elasticsearch' input.
input {
elasticsearch {
hosts => "localhost"
index => "logstash-*"
type => 'aggregation_metric'
size => 0
query => '
{
"size": 0,
"aggs": {
... here is multi-level aggregation without buckets
}
}'
I'm trying to send aggregation result as a new document in new index of ES. I don't need any documents from the root level of searching, but maybe some of documents from top hits aggregations
How can I get the response without buckets as Logstash output?
Response example with expected value
{
"took": 5,
"timed_out": false,
"_shards": {
"total": 12,
"successful": 12,
"failed": 0
},
"hits": {
"total": 198973,
"max_score": 0,
"hits": []
},
"aggregations": {
"first": {
"doc_count": 34924,
"another_one": {
"value": 18 <--- I need values like this one as a new documents
(that I want to create with mutate filter)
}
}
}
}