Splunk Search

Remove partial duplicate in same field

apache_strike
Engager

Hi everyone,

 

I am trying to remove partial duplicate in the same field, but couldn't find a solution yet.

For instance I have for the same field these values:

http://www.g

http://www.go

http://www.google.com

 

I would like to only keep the value (http://www.google.com), I tried to use dedup and mvfilter:

eval url_in_parameter=mvfilter(!url_in_parameter LIKE url_in_parameter*)

I am still a begginer on Splunk and couldn't find any similar topics on internet.

 

Thanks for your help and have a good day.

Labels (1)
0 Karma
1 Solution

ITWhisperer
SplunkTrust
SplunkTrust
| makeresults
| eval _raw="http://www.g
http://www.go
http://www.google.com
http://www1.g
http://www1.go
http://www1.google.com
www.g
www.go
www.google.com
http://www.g
http://www.go
http://www.google.com"
| multikv noheader=t
| rename Column_1 as url
| table url



| sort - url
| streamstats values(url) as previous window=1 current=false
| eval url=if(match("^".previous,url),null(),url)
| where isnotnull(url)

View solution in original post

ITWhisperer
SplunkTrust
SplunkTrust
| makeresults
| eval _raw="http://www.g
http://www.go
http://www.google.com
http://www1.g
http://www1.go
http://www1.google.com
www.g
www.go
www.google.com
http://www.g
http://www.go
http://www.google.com"
| multikv noheader=t
| rename Column_1 as url
| table url



| sort - url
| streamstats values(url) as previous window=1 current=false
| eval url=if(match("^".previous,url),null(),url)
| where isnotnull(url)
Get Updates on the Splunk Community!

Enterprise Security (ES) Essentials 8.3 is Now GA — Smarter Detections, Faster ...

As of today, Enterprise Security (ES) Essentials 8.3 is now generally available, helping SOC teams simplify ...

AI for AppInspect

We’re excited to announce two new updates to AppInspect designed to save you time and make the app approval ...

App Platform's 2025 Year in Review: A Year of Innovation, Growth, and Community

As we step into 2026, it’s the perfect moment to reflect on what an extraordinary year 2025 was for the Splunk ...