We have to do aggregations for
host.os.name, host.name, host.ip
99% data has host.os.name
95% has host.name
25% has host.ip
How to ensure I get all the results, even if the field is not present?
So i'm looking for a table like
| host.os |host.name | host.ip | count|
|---|---|---|--|
|linux | mylinuxhost1 | 172.2.3.4|20|
|linux | mylinuxhost2 | NULL|10|
| windows | winhost1 | 12.2.3.4 |100|
| windows | winhost1 | NULL |5|
I was just doing like below, the output gives me ONLY if all the fields are present
"aggs": {
....
"group_by_name": {
"terms": {
"field": "host.name.keyword"
},
"aggs": {
"group_by_ip": {
"terms": {
"field": "host.ip.keyword"
}, ....