Hi
I am working on query to retrieve count of unique host IPs by user and country. The country has to be grouped into Total vs Total Non-US. The final result would be something like below -
UserId, Total Unique Hosts, Total Non-US Unique Hosts
user1, 42, 54
user2, 23, 95
So far I have below query which works but its very slow. Is there any better and faster way to achieve desired result ? Thanks
index=customindex sourcetype=custom src
| iplocation allfields=true lang=code HOST | search Country!=US | stats estdc(HOST) as total_non_us by USERID
| join USERID type="left"
[
search index=customindex sourcetype=custom src
| iplocation allfields=true lang=code HOST | search Country=US | stats estdc(HOST) as total_us by USERID
]
| fillnull
| eval total = total_non_us + total_us
... View more