Splunk Search

How would i combine the two outputs?

TwistTheNeil
New Member

I'm trying to use the stats function to list out values in a field

In the 1st image, I have the following search:
type=USER_AUTH res=failed | dedup _raw | stats count as "Failed attempts", values(dest) as "Failed on servers" by acct
http : //postimg . org/ image/ 714eq18rn/

How would i get the number of times the user failed to login to each server along with the server name?
For example, i click on the 1st user and the field shows me this
http : //postimg .org/ image/ cx4yifa8h/
(The values are actually server names)

I would like to have an output like this
acct Failed attempts Failed on servers
1 acct1 15 server1 (5)
server2 (5)
server3 (2)

and so on.

Does anyone know how i would get this?

Tags (2)
0 Karma
1 Solution

somesoni2
Revered Legend

Try following

type=USER_AUTH res=failed | dedup _raw | stats count  by acct, dest | eval dest=dest." (".count.") | stats sum(count) as "Failed attempts", values(dest) as "Failed on servers" by acct

View solution in original post

TwistTheNeil
New Member

Yup, it's been resolved. Thank you though!

0 Karma

lukejadamec
Super Champion

Failed attempts for acct1 should be 12, right?

0 Karma

somesoni2
Revered Legend

Try following

type=USER_AUTH res=failed | dedup _raw | stats count  by acct, dest | eval dest=dest." (".count.") | stats sum(count) as "Failed attempts", values(dest) as "Failed on servers" by acct

somesoni2
Revered Legend

Glad I could help.

0 Karma

TwistTheNeil
New Member

Wow, thank you!

0 Karma
Get Updates on the Splunk Community!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...