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!

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...