Splunk Search

How can I search for same values within a field

ynag
Explorer

Hi, 

I have a field with multiple values, some of them share the same characters at the beginning of the values. 

I need to find those with the same values and make it possible to choose how many characters I want to compare from the beginning of the value.

Labels (2)
Tags (2)
0 Karma

manjunathmeti
Champion

hi @ynag ,

You can use substr function to get the first n characters. Below query get first 5 characters from myfield values. 

index=index
| eval substr=substr(myfield, 0, 5) 
| stats list(myfield), count by substr

 

If this reply helps you, an upvote/like would be appreciated. 

0 Karma
Get Updates on the Splunk Community!

Enterprise Security Content Update (ESCU) | New Releases

In December, the Splunk Threat Research Team had 1 release of new security content via the Enterprise Security ...

Why am I not seeing the finding in Splunk Enterprise Security Analyst Queue?

(This is the first of a series of 2 blogs). Splunk Enterprise Security is a fantastic tool that offers robust ...

Index This | What are the 12 Days of Splunk-mas?

December 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...