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!

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

Share Your Ideas & Meet the Lantern team at .Conf! Plus All of This Month’s New ...

Splunk Lantern is Splunk’s customer success center that provides advice from Splunk experts on valuable data ...