Hi All,
How to get terms aggregation key into field and value into field value in logstash for a CSV file, i have used Elasticsearch filter and also give the json file for query. can some please help on this
Elasticsearch query
GET dump1/_search
{
"size": 0,
"query": {
"bool": {
"must": [
{"term": {
"person_id.keyword": {
"value": "id"
}
}}
]
}
},
"aggs": {
"status": {
"terms": {
"field": "completion_status.keyword",
"size": 10
}
}
}
}
Output:
{
"took" : 3,
"timed_out" : false,
"_shards" : {
"total" : 1,
"successful" : 1,
"skipped" : 0,
"failed" : 0
},
"hits" : {
"total" : {
"value" : 69,
"relation" : "eq"
},
"max_score" : null,
"hits" :
},
"aggregations" : {
"status" : {
"doc_count_error_upper_bound" : 0,
"sum_other_doc_count" : 0,
"buckets" : [
{
"key" : "In Progress",
"doc_count" : 58
},
{
"key" : "Completed",
"doc_count" : 11
}
]
}
}
}