This is the output i am getting for my aggregation..
"aggregations": {
"users": {
"doc_count_error_upper_bound": 0,
"sum_other_doc_count": 0,
"buckets": [
{
"doc_count": 68,
"ip": {
"doc_count_error_upper_bound": 0,
"sum_other_doc_count": 0,
"buckets": []
},
"key": "-"
},
{
"doc_count": 4,
"ip": {
"doc_count_error_upper_bound": 0,
"sum_other_doc_count": 0,
"buckets": [
{
"doc_count": 4,
"key": "10.10.10.2"
}
]
},
"key": "w33kstor"
},
{
"doc_count": 4,
"ip": {
"doc_count_error_upper_bound": 0,
"sum_other_doc_count": 0,
"buckets": [
{
"doc_count": 4,
"key": "10.10.10.3"
}
]
},
"key": "looo"
}
How can I get the count across to telegram? The IP seem to be displaying in a array when i try.. I need it to output as Username : IP : Count (based on doc_count by IP)
"webhook": {
"scheme": "https",
"host": "api.telegram.org",
"port": 443,
"method": "post",
"path": "/bot1083222201[redacted]:--27vk/sendMessage",
"params": {},
"headers": {
"Content-Type": "application/x-www-form-urlencoded"
},
"body": "chat_id=-213321&text=Total requests\n{{#ctx.payload.aggregations.users.buckets}}{{key}}:{{doc_count}}:{{IP}}{{/ctx.payload.aggregations.users.buckets}} "
}
}