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

Introducing the Splunk Community Dashboard Challenge!

Welcome to Splunk Community Dashboard Challenge! This is your chance to showcase your skills in creating ...

Built-in Service Level Objectives Management to Bridge the Gap Between Service & ...

Wednesday, May 29, 2024  |  11AM PST / 2PM ESTRegister now and join us to learn more about how you can ...

Get Your Exclusive Splunk Certified Cybersecurity Defense Engineer Certification at ...

We’re excited to announce a new Splunk certification exam being released at .conf24! If you’re headed to Vegas ...