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!

Webinar Recap | Revolutionizing IT Operations: The Transformative Power of AI and ML ...

The Transformative Power of AI and ML in Enhancing Observability   In the realm of IT operations, the ...

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...