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!

Index This | Divide 100 by half. What do you get?

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

Stay Connected: Your Guide to December Tech Talks, Office Hours, and Webinars!

❄️ Celebrate the season with our December lineup of Community Office Hours, Tech Talks, and Webinars! ...

Splunk and Fraud

Watch Now!Watch an insightful webinar where we delve into the innovative approaches to solving fraud using the ...