How to sum the 4 columns in elastic search. Example:
A B C
1 1 1
1 2 2
Sum of A = 2, Sum of B = 3, Sum of C = 3 and Sum of total(A,B,C) = 8.
How to get the sum?
I have done an aggregation query but it is throwing me Unexpected token START_ARRAY
{
"aggs": {
"total_count": {
"sum": {
"base_count": {
"sum": {
"field": "cse_licenseactivated_base_count"
}
},
"malware_count": {
"sum": {
"field": "cse_licenseactivated_malware_count"
}
},
"threat_count": {
"sum": {
"field": "cse_licenseactivated_threat_count"
}
},
"urlfiltering_count": {
"sum": {
"field": "cse_licenseactivated_urlfiltering_count"
}
}
}
}
}
}