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!

Splunk Mobile: Your Brand-New Home Screen

Meet Your New Mobile Hub  Hello Splunk Community!  Staying connected to your data—no matter where you are—is ...

Introducing Value Insights (Beta): Understand the Business Impact your organization ...

Real progress on your strategic priorities starts with knowing the business outcomes your teams are delivering ...

Enterprise Security (ES) Essentials 8.3 is Now GA — Smarter Detections, Faster ...

As of today, Enterprise Security (ES) Essentials 8.3 is now generally available, helping SOC teams simplify ...