Reporting

How to create a report that shows the number of events coming from a source IP address and include the iplocation data elements, City, State, Country?

jaybolser
New Member

I want to see on a daily basis, where traffic is coming from, something like below.

SourceIP Event Count City State Country
1.1.1.1. 24 Minneapolis MN USA
2.2.2.2 20 Anqing Anhui China

Tags (3)
0 Karma

Dallastek
Explorer

sourcetype=your source | iplocation SourceIP | stats count by SourceIP, City, Region, Country

0 Karma

martin_mueller
SplunkTrust
SplunkTrust

You should use the order from my answer, gives you the same result with way fewer invocations of iplocation.

0 Karma

martin_mueller
SplunkTrust
SplunkTrust

Something like this?

your base search | stats count as "Event Count" by SourceIP | iplocation SourceIP
0 Karma

martin_mueller
SplunkTrust
SplunkTrust

There is no field State, it's called Region.

That shouldn't stop it all from working though... check if you have the lat and lon fields after calling the iplocation command for your ip field.

0 Karma

jaybolser
New Member

I'm aware of the private address ranges and I'm excluding them from what I'm trying to do. It appears that I can't insert '|Table City, State, Country' with this sort of report.

0 Karma

martin_mueller
SplunkTrust
SplunkTrust

Not all IP addresses have known location approximations, especially private ones. Make sure you're not suffering from that.

0 Karma

jaybolser
New Member

I tried that and I don't get any IPLocation data to add to the report.

0 Karma
Get Updates on the Splunk Community!

Fueling your curiosity with new Splunk ILT and eLearning courses

At Splunk Education, we’re driven by curiosity—both ours and yours! That’s why we’re committed to delivering ...

Splunk AI Assistant for SPL 1.1.0 | Now Personalized to Your Environment for Greater ...

Splunk AI Assistant for SPL has transformed how users interact with Splunk, making it easier than ever to ...

Unleash Unified Security and Observability with Splunk Cloud Platform

     Now Available on Microsoft AzureOn Demand Now Step boldly into the AI revolution with enhanced security ...