Splunk Search

Removing some field values from a mulitiple value field

youngrap
Explorer

hello,

I want to remove the string in field_2 from field_1.
I want it to be like the value in the result field.

Like a list.remove() function in python.

field_1 : mulitiple values
field_2 : strings
result : mulitiple vlaues

field_1field_2result

aaa
bbb
ccc

bbbaaa
ccc
ddd
eee
dddeee
qqq
ddd
ggg
gggqqq
ddd

 

I tried as below, but don't work.

try #1
| eval result=mvfilter(NOT match(field_1, field_2))

try #2
| eval result=field_1-field_2

thank you.

Labels (2)
0 Karma
1 Solution

ITWhisperer
SplunkTrust
SplunkTrust
| eval result=mvmap(field_1,if(field_1!=field_2,field_1,null()))

View solution in original post

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust
| eval result=mvmap(field_1,if(field_1!=field_2,field_1,null()))
0 Karma

youngrap
Explorer

thank you!!! i solve it.

0 Karma
Get Updates on the Splunk Community!

Accelerating Observability as Code with the Splunk AI Assistant

We’ve seen in previous posts what Observability as Code (OaC) is and how it’s now essential for managing ...

Integrating Splunk Search API and Quarto to Create Reproducible Investigation ...

 Splunk is More Than Just the Web Console For Digital Forensics and Incident Response (DFIR) practitioners, ...

Congratulations to the 2025-2026 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...