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
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 ...