Alerting

Is there a way to search where 4 letters in FieldA NotMatch FieldB?

aikn061
Explorer

Hi Guys,

So if I have two fields with really random set of text, no similarities except the red text.  Does have the 'red' fonts in similarity as below.

In this case, is there a way to search to say when first four letters in FieldA exists in FieldB, exclude?

This would be very easy in powershell or python.  I am medium splunk user as well, but not sure how I'd do this in splunk.

This would be very helpful..  Your help is appreciated in advance.  

 

FieldA FieldB
Complete Exch.Complete
NotComplete apps.NotC@
Satisftesting Satiapps
Labels (4)
0 Karma

aikn061
Explorer

Both methods do work - Thanks RichGalloway and Bowesmana

0 Karma

richgalloway
SplunkTrust
SplunkTrust

If your problem is resolved, then please click the "Accept as Solution" button to help future readers.

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

richgalloway
SplunkTrust
SplunkTrust

See if this helps.

 

| eval exclString=substr(FieldA, 1, 4)
| where NOT match(FieldB, exclString)

EDIT: I fixed this answer to exclude rather than include matches.  Thanks, @bowesmana !

 

 

 

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

bowesmana
SplunkTrust
SplunkTrust

Or the minimalist one liner 😃 - but turning round the logic to exclude rather than include those matching items

| where !match(FieldB, substr(FieldA, 1, 4))

 

Get Updates on the Splunk Community!

[Live Demo] Watch SOC transformation in action with the reimagined Splunk Enterprise ...

Overwhelmed SOC? Splunk ES Has Your Back Tool sprawl, alert fatigue, and endless context switching are making ...

What’s New & Next in Splunk SOAR

Security teams today are dealing with more alerts, more tools, and more pressure than ever.  Join us on ...

Your Voice Matters! Help Us Shape the New Splunk Lantern Experience

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...