Splunk Search

Find common values starting with

Mary666
Communicator

Hi There,

 

Any guidance on how to find common values starting with similar values from two different sources?

 

exp:

 

Source: 1 field:SerialId value: 123_abc

Source:  2 field: SerialId value: 123_abcde

 

so if the values start with the first common 6 letters and numbers-find those matching.

 

any advice on how to approach this?

Labels (5)
0 Karma

vhharanpositka
Path Finder

Hi @Mary666 

 

As per my understanding, you can use the field name and the value with the starting common character with a wildcard.

 

Source: 1

field:SerialId value: 123*

Source:  2

field: SerialId value: 123*

This will fetch the common values from that fields.

 

Example Screenprint:

vhharanpositka_1-1635735009295.png

 

Thanks

 

0 Karma

Mary666
Communicator

Thanks, but I should have been more detailed. The values can be numbers and letters and can be different in size. So basically I am trying to do this:

Index="123", team=green, ID=123Azz_mpr

Index="456" , team=blue, ID=123Cxx_1


Desired result: 
ID=123

I have tried 
| eval ShortMessage= substr(ID1,3)  this does work, but it does not include the data for both indexes. 

0 Karma

vhharanpositka
Path Finder

Try this,

 

index="123" OR index="456" (team=green OR  team=blue) ID=123*

 

0 Karma
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 ...