Splunk Search

Excluding one user name from search

robK123
Explorer

I have this search:

(index=infrastructure-os OR index=main) sudo "incorrect password attempt*" |rex field=_raw "sudo:[^a-z]+(?[^ ]+) : (?[0-9]+) incorrect"|stats sum(failures) by user, host

But I am unsure how to exclude one user called addmm from the results as I do not want to see that one.

Thanks,

Tags (1)
0 Karma

jangid
Builder

try
NOT user="addmm"

0 Karma

robK123
Explorer

That worked perfectly thank you!

0 Karma

jonuwz
Influencer

There's 2 ways to filter out the user.
append either :

| search NOT user="addm"

or

| where user!="addm"

robK123
Explorer

I tried:

(index=infrastructure-os OR index=main) sudo "incorrect password attempt*" |rex field=_raw "sudo:[^a-z]+(?[^ ]+) : (?[0-9]+) incorrect"|stats sum(failures) by user, host NOT user="addm"

but get the following error when I try:

Error in 'stats' command: The argument 'user=addm' is invalid.

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 ...