Skip to content

Instantly share code, notes, and snippets.

@acharlieh
Last active August 29, 2015 14:08
Show Gist options
  • Save acharlieh/2444a54949916dd81231 to your computer and use it in GitHub Desktop.
Save acharlieh/2444a54949916dd81231 to your computer and use it in GitHub Desktop.
Splunk Search Streaming Window of more than X hits per minute by an ip for Y consecutive minutes.
index=yourindexes sourcetype=access_combined uri_path=/login
| eval _time=relative_time(_time,"@m")
| stats count by clientip,_time
| where count > X
| appendpipe
[ dedup clientip
| map
[ gentimes increment=1m
[ noop
| stats count
| addinfo
| convert timeformat="%m/%d/%Y:%H:%M:%S" ctime(info_min_time) as start ctime(info_max_time) as end
| fields end start
| format "" "" "" "" "" ""
]
| eval _time=relative_time(starttime,"@m")
| eval clientip=$clientip$
| eval count = 0
]
]
| stats sum(count) as count by clientip,_time
| streamstats window=Y count(eval(count>0)) as windowhits by clientip
| where windowhits = Y
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment