Splunk Search

1 Search with two results

jcrensh
Explorer

I have a saved search returns the number of failed logins to a domain over a 24 hour period.

source="wineventlog:security" ("EventCode=4625") OR ("EventCode=529") host=dc*snlnt | stats count by host | rename count as "Unsuccessful Logins" | sort "Unsuccessful Logins"

That produces the following:

Host Unsuccessful Logins
MachineA Total_MachineA
MachineB Total_MachineB (and so on)

What I want to do is now add another running total of event id's 4624 and 528 as "Successful Logins" to the same search and produce the following:

Host Unsuccessful Logins Successful Logins
MachineA Total_MachineA Total_MachineA
MachineB Total_MachineB Total_MachineB (and so on)

It would be nice to have a way of determining the average per day over the last 7 days per host, but I am not sure what to do when you have a day with a higher than normal Unsuccessful or Successful count - that would then throw off your average over 7 days.

Thanks in advance,

Jason

Tags (1)
0 Karma
1 Solution

eelisio2
Path Finder

The following will give you both results in the same search in descending order by Unsuccessful Logins.

source="wineventlog:security" host=dc*snlnt | stats count(eval(EventCode="4625" OR EventCode="529")) as "Unsuccessful Logins", count(eval(EventCode="4624" OR EventCode="528")) as "Successful Logins" by host | sort -"Unsuccessful Logins" | table host "Unsuccessful Logins" "Successful Logins"

View solution in original post

0 Karma

jcrensh
Explorer

Thank you very much, this worked like a champ.

0 Karma

eelisio2
Path Finder

The following will give you both results in the same search in descending order by Unsuccessful Logins.

source="wineventlog:security" host=dc*snlnt | stats count(eval(EventCode="4625" OR EventCode="529")) as "Unsuccessful Logins", count(eval(EventCode="4624" OR EventCode="528")) as "Successful Logins" by host | sort -"Unsuccessful Logins" | table host "Unsuccessful Logins" "Successful Logins"

0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...