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!

Splunk Mobile: Your Brand-New Home Screen

Meet Your New Mobile Hub  Hello Splunk Community!  Staying connected to your data—no matter where you are—is ...

Introducing Value Insights (Beta): Understand the Business Impact your organization ...

Real progress on your strategic priorities starts with knowing the business outcomes your teams are delivering ...

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 ...