Splunk Search

Help with excluding field combination

fdevera
Path Finder

_time

SubjectUserName

TargetOutboundUserName

host

IpAddress

Sun Jun 21 08:37:39 2020bcharliebcharliexby-100::1
Sun Jun 21 08:37:03 2020bcharliebcharliexby-100::1

 

I need to exclude search results where SubjectUserName+TargetOutboundUserName will always be excluded.

TargetOutboundUsername will always be SubjectUsername+x

How would I write that out?

Labels (1)
0 Karma
1 Solution

richgalloway
SplunkTrust
SplunkTrust

Thank you for clarifying the problem.  This where clause should do the job.

| where NOT like(TargetOutboundUserName, SubjectUserName."x")
---
If this reply helps you, Karma would be appreciated.

View solution in original post

0 Karma

richgalloway
SplunkTrust
SplunkTrust

To exclude one or more fields from the results, use the fields command with the '-' option.

| fields - SubjectUserName TargetOutboundUserName

 

---
If this reply helps you, Karma would be appreciated.
0 Karma

fdevera
Path Finder

I'm not trying to exclude fields. I'm trying to exclude all events that have

subjectusername + TargetoutboundUsernName+x

bcharlie + bcharliex

kfrog + kfrogx

staceyb + stacebx

I would like those excluded. I think some regex has to be done here?

0 Karma

richgalloway
SplunkTrust
SplunkTrust
I'm not understanding the criteria for excluding events. If the TargetUserName value is always the SubjectUserName value plus "x" then won't *all* events match SubjectUserName + TargetUserName+x?
---
If this reply helps you, Karma would be appreciated.
0 Karma

fdevera
Path Finder

I mean it won't always be, just when to exclude when the following = true

SubjectUserName + TargetUserName+x

field1

field2=field1+x

field1+(field1+x) -> any time this is true, exclude those events. So fred+cow will show but fred+fredx will be excluded from results.

0 Karma

richgalloway
SplunkTrust
SplunkTrust

Thank you for clarifying the problem.  This where clause should do the job.

| where NOT like(TargetOutboundUserName, SubjectUserName."x")
---
If this reply helps you, Karma would be appreciated.
0 Karma
Get Updates on the Splunk Community!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...