First of all I want to tell you that I am new at ElasticSearch
I have a JSON in following format. I want to group by "CallTo" field and sum of "Count" value for each "CallTo" I will use this values for visulation in Kibana
My first question is what my index should be for group by and sum operation that I mentioned? And my second question is what is the query?
My Json
{
"Labels": "qwerty",
"Type": "type1",
"Id": "id12345",
"FieldName": [
{
"CallTo": "Tom",
"Count": 2
},
{
"CallTo": "Jessica",
"Count": 4
},
{
"RegionCode": "US",
"Count": 1
},
{
"RegionCode": "DE",
"Count": 5
},
{
"CallCategory": "K1",
"Count": 6
}
],
"OtherField": [
{
"Key": "bin5",
"Value": 0
},
{
"Key": "bin1",
"Value": 0
},
{
"Key": "bin3",
"Value": 2
},
{
"Key": "binOther",
"Value": 0
}
],
"XField": [
{
"Key": "bin50000",
"Value": 1
},
{
"Key": "bin10000",
"Value": 3
},
{
"Key": "bin30000",
"Value": 4
},
{
"Key": "binOther",
"Value": 7
}
]
}
My expected result my be like this
{
{
"CallTo": "Tom",
"Count": 23
},
{
"CallTo": "Jessica",
"Count": 44
},
{
"RegionCode": "US",
"Count": 18
},
{
"RegionCode": "DE",
"Count": 58
},
{
"CallCategory": "K1",
"Count": 46
}
}
Also I am open for alternative solution even change Json format
Thanks