Splunk Search

Use Mysql results to determine log deviation

keithtyler
New Member

**My mission: Alert networking staff when one of their devices has high log deviation.

**How I think it should be done: Using the tacacs database since it is always up to date.
I am selecting a list of IP's from our Tacacs database.
mysqlquery spec=mysql.companyxyz.net query="select ip FROM host WHERE ip > 0"

Here is the query to find log deviation for all hosts:
index=_internal group="per_host_thruput" |eval mb=kb/1024 |stats mean(eps), stdev(eps) AS "Standard Deviation", var(eps) AS "Variance EPS", sum(mb) AS "MB of Syslog Data" by series |sort 25 -"Standard Deviation"

My Question: how do I tell splunk to alert using the IP's returned from the query?

0 Karma

richcollier
Path Finder

The Prelert Anomaly Detective app automatically baselines event rates of any kind of event (or even the occurrences of certain field values - for example events where "field=value") and automatically points out when the event rates deviated from the observed "normal". It might be worth checking out.

0 Karma

sdaniels
Splunk Employee
Splunk Employee

You could modify your search to include a where clause for the amount of deviation. Add "| where "Standard Deviation" > value". Create an alert based on that, then Splunk will alert for values above that during a particular time window. You can have the alert pass the result set when you get an email alert.

0 Karma

mikelanghorst
Motivator

If you have the host extracted as a field, it should be included in the results by default. If host isn't extracted you could either create a props entry or use |rex to extract it on the fly.

0 Karma

sdaniels
Splunk Employee
Splunk Employee

So you could do > 0...therefore any deviation from servers in a given time range will send an alert and you could have the email contain the results which would be the list of hosts.

0 Karma

keithtyler
New Member

Not concerned with amount of deviation only about hosts causing the deviation.

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

A Four-Part Event Series: Full Stack Observability For the AI Era

As AI reshapes applications, infrastructure, and the way teams operate, the traditional boundaries of ...

SOC4Kafka - New Kafka Connector Powered by OpenTelemetry

The new SOC4Kafka connector, built on OpenTelemetry, enables the collection of Kafka messages and forwards ...

Event Series: Level up your SOC: Advancing with Splunk Enterprise Security

AI has fundamentally raised the stakes for security operations, and this three-part series is your guide to ...