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!

Modern way of developing distributed application using OTel

Recently, I had the opportunity to work on a complex microservice using Spring boot and Quarkus to develop a ...

Enterprise Security Content Update (ESCU) | New Releases

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

Archived Metrics Now Available for APAC and EMEA realms

We’re excited to announce the launch of Archived Metrics in Splunk Infrastructure Monitoring for our customers ...