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!

Earn a $35 Gift Card for Answering our Splunk Admins & App Developer Survey

Survey for Splunk Admins and App Developers is open now! | Earn a $35 gift card!      Hello there,  Splunk ...

Continuing Innovation & New Integrations Unlock Full Stack Observability For Your ...

You’ve probably heard the latest about AppDynamics joining the Splunk Observability portfolio, deepening our ...

Monitoring Amazon Elastic Kubernetes Service (EKS)

As we’ve seen, integrating Kubernetes environments with Splunk Observability Cloud is a quick and easy way to ...