Splunk Search

Is there any way to use all returned values under a certain field in a search?

cxm0u4e
Engager

Let's say I have a multivalue fieldA and a fieldB. I know you can do something like "| where field=value" in a search or just have it in the first part of the search arguments, but is it possible to do something for where I use all returned values part of fieldA as the search for fieldB?

Labels (1)
0 Karma
1 Solution

bowesmana
SplunkTrust
SplunkTrust

Are you looking for a subsearch so that your main search will look for fieldB="any of field A" values?

index=bla... [ 
  search index=find_values_of_fieldA 
  | stats values(fieldA) as fieldB
  | format ]

 

View solution in original post

bowesmana
SplunkTrust
SplunkTrust

Are you looking for a subsearch so that your main search will look for fieldB="any of field A" values?

index=bla... [ 
  search index=find_values_of_fieldA 
  | stats values(fieldA) as fieldB
  | format ]

 

marysan
Communicator

|mvexpand fieldA 
|mvexpand fieldB
|eval flag=if(match(fieldA ,fieldB),1,0)

OR 

|mvexpand fieldA 
|mvexpand fieldB
|eval flag=if(match(fieldB ,fieldA),1,0)


0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Can’t Make It to Boston? Stream .conf25 and Learn with Haya Husain

Boston may be buzzing this September with Splunk University and .conf25, but you don’t have to pack a bag to ...

Splunk Lantern’s Guide to The Most Popular .conf25 Sessions

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Unlock What’s Next: The Splunk Cloud Platform at .conf25

In just a few days, Boston will be buzzing as the Splunk team and thousands of community members come together ...