Splunk Search

iplocation not showing country,city when selected "Real Time" from time range picker

kapilbk1996
Explorer

I am using the following iplocation query:-

index="filtered_uiauditlogs" | stats count(ip) as "Count" by ip | appendcols [search index="filtered_uiauditlogs" |iplocation ip | table Country,City,ip | dedup ip] |appendcols [search index="filtered_uiauditlogs" | stats avg(response_time) by ip ] | rename ip as "Client Ip" | rename avg(response_time) as "Avg Response Time(ms)"

When I execute this query for the Relative time frame (eg, last 15 min or All time), the following fields are shown as expected(Refer to image).
Client Ip, Count, Avg Response Time(ms), City, Country

But when I change the time frame to real time in time range picker, then it only shows 2 columns - Client Ip and Count only.

Please help me out with the same.

Refer to these screenshots

1 https://drive.google.com/file/d/15DGQdby-51hy1gGW-6AhcLvFbtuyuX9t/view?usp=sharing
2 https://drive.google.com/open?id=1-1RZtehBfSfBuhwmz3qwu49Zr6gDwXuj

0 Karma

MuS
Legend

Hi kapilbk1996,

like @woodcock said, don't do real time when using appendcols because in general, every subsearch finishes before the main search starts. Real-time searches do not finish, hence subsearches cannot be real-time.

Also, you are doing three times the same search ... why not simply do this:

index="filtered_uiauditlogs" 
| stats count values(*) AS * by ip 
| iplocation ip 
| do more SPL fu

Hope this helps ...

cheers, MuS

0 Karma

woodcock
Esteemed Legend

Don't do realtime. Seriously.

0 Karma
Get Updates on the Splunk Community!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...