Hi All,
I'm sure this is a no brainer question.
I have a search followed by this aggregation:
"aggs": {
"destination_ip": {
"significant_terms": {
"field": "destination.ip"
}
},
"aggs": {
"terms": {
"field": "source.ip"
}
}
}
The output of the results (in watcher) for the aggregation is as follows:
"aggregations": {
"destination_ip": {
"doc_count": 81,
"buckets": [
{
"score": 322616.8342162003,
"doc_count": 41,
"bg_count": 253,
"key": "8.8.8.8"
},
{
"score": 304662.9287142383,
"doc_count": 40,
"bg_count": 255,
"key": "192.168.123.128"
}
],
"bg_count": 318574164
},
"aggs": {
"doc_count_error_upper_bound": 0,
"sum_other_doc_count": 0,
"buckets": [
{
"doc_count": 41,
"key": "116.12.209.226"
},
{
"doc_count": 40,
"key": "192.168.123.137"
}
]
}
}
},
I'm trying to generate an email with
Destination <IP> source <source_ip> <document count>
There are {{ctx.payload.aggregations.destination_ip.buckets.size}}
{{#ctx.payload.aggregations.destination_ip.buckets}}
Destination {{key}} Source {{ctx.payload.aggregations.destination_ip.aggregations.buckets.key}} Count {{ctx.payload.aggregations.destination_ip.aggregations.buckets.doc_count}}
{{/ctx.payload.aggregations.destination_ip.buckets}}
All I am getting is
There are 2
Destination 8.8.8.8 Source Count
Destination 116.12.209.226 Source Count
Can someone tell me the correct syntax to get the second bucket info?
I was hoping for a report like
There are 2
Destination 8.8.8.8 Source 192.168.123.128 Count 40
Destination 116.12.209.226 Source 192.168.123.137 Count 40
Thanks alot!
Regards,
Michael