Splunk Search

Pass subsearch field to parent search

satya2p
Path Finder

I am trying to pass number from subsearch to main search and find before or after 10 values of number. So if number is 50 parent search should pull events from 59 to 59 or 50 to 41.

index=* Number="*" [search index=* "idnumber" | tail 1 | fields Number | format] | head/tail 10
0 Karma
1 Solution

somesoni2
Revered Legend

Try like this

 index=*  [search index=* "idnumber" | tail 1 | table Number |eval Number=mvrange(Number-10,Number+10) ]

View solution in original post

0 Karma

satya2p
Path Finder

Thank you, it worked.

0 Karma

somesoni2
Revered Legend

Try like this

 index=*  [search index=* "idnumber" | tail 1 | table Number |eval Number=mvrange(Number-10,Number+10) ]
0 Karma
Get Updates on the Splunk Community!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...