Splunk Search

Mechanism to return fields not part of a query from subsearch

rdownie
Communicator

index=abc [index=def a=b | fields c,d,e | format]


will create something like


index=abc (c=blah) AND (d=foo) AND (e=bar)


Instead of e being part of the search, I just want the value of e to be used later in the primary search possibly in a table? I lose the values of the fields in the subsearch. I tried outputing them to an outputlookup in the subsearch and then doing a lookup to pull them back but it appears the outputlookup doesn't flush them out to the file quick enough. If I re-run the search, I will get those results but that is a hack. Any ideas here?


Thanks,


-Bob

Tags (2)
0 Karma

lukejadamec
Super Champion

You made fields part of the result, so it ends up in the result. It does not appear to be part of the search, but if the event contains e and you make e part of your result, then you will end up with e. That's just the way it is.

0 Karma

wpreston
Motivator

I'm not sure I understand your aim, but could you use append, appendcols, or join to get what you need instead of having a subsearch in your primary search?

0 Karma
Get Updates on the Splunk Community!

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...