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!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...