Splunk Search

Top 10 ip addresses denied over last 7 days

ryanmims
Explorer

Trying to write a search that will show top 10 "repeat" offenders over last 7 days. I'm guessing an eval(if) statement but not really sure. Only want to see repeat srcip's, not IP's that only get denied during 1 day.

Any help would be greatly appreciated.
Thanx

Tags (2)
0 Karma
1 Solution

richgalloway
SplunkTrust
SplunkTrust

Try this. It will give you the top 10 repeat offenders, but depending on your data they may all be on the same day.

'... | stats count(_time) AS Occurs by src_ip | where Occurs > 6 | top limit=10 Occurs,src_ip | ...'

---
If this reply helps you, Karma would be appreciated.

View solution in original post

0 Karma

ryanmims
Explorer

This one works. Tweaking...Thanx Martin

0 Karma

martin_mueller
SplunkTrust
SplunkTrust

How 'bout this then?

index=yourIndex sourcetype=yourSourceType earliest=-7d@d | eventstats dc(date_mday) as days by src_ip | where days > 1 | top limit=10 src_ip

richgalloway
SplunkTrust
SplunkTrust

Try this. It will give you the top 10 repeat offenders, but depending on your data they may all be on the same day.

'... | stats count(_time) AS Occurs by src_ip | where Occurs > 6 | top limit=10 Occurs,src_ip | ...'

---
If this reply helps you, Karma would be appreciated.
0 Karma

richgalloway
SplunkTrust
SplunkTrust

I think it will. See martin_mueller's comment.

---
If this reply helps you, Karma would be appreciated.
0 Karma

ryanmims
Explorer

Would (date_mday) work better than _time to make sure it is only counting the days rather than time entries?

0 Karma

ryanmims
Explorer

No, it works but need only IP
s with date returned if they have been denied more than 1 day over search period

0 Karma

somesoni2
Revered Legend

something like this will work?

index=yourIndex sourcetype=yourSourceType earliest=-7d@d | top limit=10 src_ip

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.
Get Updates on the Splunk Community!

Tech Talk Recap | Mastering Threat Hunting

Mastering Threat HuntingDive into the world of threat hunting, exploring the key differences between ...

Observability for AI Applications: Troubleshooting Latency

If you’re working with proprietary company data, you’re probably going to have a locally hosted LLM or many ...

Splunk AI Assistant for SPL vs. ChatGPT: Which One is Better?

In the age of AI, every tool promises to make our lives easier. From summarizing content to writing code, ...