Splunk Search

Only one value from subsearch being used by parent

775149
New Member

I would like all the results from a field extraction in search "A" to be used as search criteria in search "B". I am using a subsearch for this, however for some reason only the top result for the field in search "A" is being used in search "B", where I want all the values to be used. Individually search A returns multiple results, and I can find these results in search B but not together:

index=<my_index> sourcetype=<my_sourcetype> other search foo [search index=<my_other_index> sourcetype=<another_sourcetype> extra search foo | rex field=_raw "some regex(?<my_field>)" | dedup my_field | fields my_field | rename my_field as search ]

For example my_field should return a bunch of values e.g. 1, 2, 3, 4, 5 but only "1" is being used in the parent search.

Any ideas why it isn't using all of the values with implicit "OR" between??

0 Karma
1 Solution

MuS
Legend
0 Karma

MuS
Legend

Hi 775149,

give format a try https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/format

Hope this helps ...

cheers, MuS

0 Karma

775149
New Member

Perfect, thanks can't believe it was so simple after all that googling

index=<my_index> sourcetype=<my_sourcetype> other search foo [search index=<my_other_index> sourcetype=<another_sourcetype> extra search foo | rex field=_raw "some regex(?<my_field>)" | dedup my_field | fields my_field | rename my_field as search | format ]
0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.
Get Updates on the Splunk Community!

Thanks for the Memories! Splunk University, .conf25, and our Community

Thank you to everyone in the Splunk Community who joined us for .conf25, which kicked off with our iconic ...

Data Persistence in the OpenTelemetry Collector

This blog post is part of an ongoing series on OpenTelemetry. What happens if the OpenTelemetry collector ...

Introducing Splunk 10.0: Smarter, Faster, and More Powerful Than Ever

Now On Demand Whether you're managing complex deployments or looking to future-proof your data ...