Reporting

Search with a count of events in a time window by host

ruffieuxlu
New Member

Hello,

I am new with Splunk and I have to do some searches to prevent attacks and things like that. I have around 45 servers (Linux or Windows) which send logs to my Splunk server.

I need your help to have an example of a search that I can't do with my current knowledge.

I need to search every authentifications fails. If there is more than 5 fails in less than 5 minutes in the same host then I send an email or an alert to Nagios. Is it possible to do that, and if yes, how ?

Thank you for your help !

(Sorry if there is some english mistakes)

Tags (2)
0 Karma

lukeh
Contributor

You can use Splunk For Nagios to Schedule Saved Searches in Splunk to send alerts to Nagios. I wrote the app for that exact purpose, and it also allows you to search Nagios alerts and notifications and trend problems over time. Over 40 field extractions are included, as well as 6 Saved Searches, and an Advanced Dashboard featuring recent Warning and Critical Alerts.

http://splunk-base.splunk.com/apps/22374/splunk-for-nagios

0 Karma

thall79
Communicator

Maybe something like this for a search:

(your search for fails) | bucket _time span=5m | stats count by user,host,_time | search count>4

After that save the search and set it up as an alert.

Hope this helps

Travis.

0 Karma

thall79
Communicator

So you just want to setup a search to run every 5 minutes and report on the previous 5 minutes to alert of any failures greater than 5. How about this: (your search for fails) earliest=-5min | stats count by user,host,_time | search count>4

0 Karma

ruffieuxlu
New Member

It is not far, but this solution returns all the events in 5min windows. I need to see only the events in the past 5min. In example if I do that :
(search) | bucket _time span=5m | stats count by user,host,_time | search count>4 | sort -_time | head 1
I have one event but from yesterday at 22h PM, so if I schedule this search every 5min, Nagios will receive plenty alerts for this event.
I need to see if there is an event in the past 5min or not. If there is, I create an alert, if not everything is okay.

0 Karma
Get Updates on the Splunk Community!

Splunk Observability for AI

Don’t miss out on an exciting Tech Talk on Splunk Observability for AI!Discover how Splunk’s agentic AI ...

Splunk Enterprise Security 8.x: The Essential Upgrade for Threat Detection, ...

Watch On Demand the Tech Talk on November 6 at 11AM PT, and empower your SOC to reach new heights! Duration: ...

Splunk Observability as Code: From Zero to Dashboard

For the details on what Self-Service Observability and Observability as Code is, we have some awesome content ...