Splunk Search

How to create a multivalue FieldC with the common values found in multivalue fields FieldA and FieldB?

vbumgarner
Contributor

I have two fields that are multivalue, and I need to know what they have in common.

For instance, given:
a=[1,2,3]
b=[2,3,4]
I want to create:
c=[2,3]

I made it work with some crazy mvexpand, but I'd really rather not do that. I tried to make it work using a combination of mvfilter and mvfind, but couldn't make that work, either.

Any thoughts on how to do this more efficiently?

Cheers.

0 Karma

fdi01
Motivator

you can use also mvindex and mvzip command to do it.

the if() or case() and match( ) functions are used to build your condictions fine on.

0 Karma
Get Updates on the Splunk Community!

Introducing the Splunk Community Dashboard Challenge!

Welcome to Splunk Community Dashboard Challenge! This is your chance to showcase your skills in creating ...

Built-in Service Level Objectives Management to Bridge the Gap Between Service & ...

Wednesday, May 29, 2024  |  11AM PST / 2PM ESTRegister now and join us to learn more about how you can ...

Get Your Exclusive Splunk Certified Cybersecurity Defense Engineer Certification at ...

We’re excited to announce a new Splunk certification exam being released at .conf24! If you’re headed to Vegas ...