Splunk Search

Using the field of first search in second search.

email2vamsi
Explorer

Hi experts,

Search 1:
    base search from JSON...
    | eval col1=strptime(taken_date,"%b %d %Y %H:%M:%S")
    | stats latest(col1) as max_col

The above search returns a single value.
Based on the single value max_col, i would like to run the below search which displays the
values of col1 only when col1 > (max_col-2629743).

   Search 2:
    base search from JSON...
    | eval col1=strptime(taken_date,"%b %d %Y %H:%M:%S")
    | eval max_col1_30= max_col-2629743
    | where col1 > max_col1_30
    | table col1 max_col1_30

Could you please help by joining both the searches?
Sub search is not working for me.
Thank you.

Labels (4)
0 Karma

to4kawa
Ultra Champion

use eventstats instead of stats

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