Splunk Search

Is there a way to get 2 nonstream Searches to run in parallel in the same SPL?

robertlynch2020
Motivator

Hi - Is there a way to get 2 nonstream Searches to run in parallel in the same SPL?

I am using "appendcols", but I think one is waiting for the other to finish.

I can't use multisearch as I don't have stream commands.
The issue is displaying the license used by Splunk and I want to run 2 SPL in parallel. However, it's very slow to run if I run 2 in sequence. Thanks in advance for any help

 

index=_internal 
    [ `set_local_host`] source=*license_usage.log* type="Usage" 
| eval h=if(len(h)=0 OR isnull(h),"(SQUASHED)",h) 
| eval s=if(len(s)=0 OR isnull(s),"(SQUASHED)",s) 
| eval idx=if(len(idx)=0 OR isnull(idx),"(UNKNOWN)",idx) 
| bin _time span=1d 
| stats sum(b) as b by _time, pool, s, st, h, idx 
| search pool = "*" 
| search idx != "mlc_log_drop" 
| timechart span=1d sum(b) AS Live_Data fixedrange=false 
| fields - _timediff 
| foreach * 
    [ eval <<FIELD>>=round('<<FIELD>>'/1024/1024/1024, 3)] 
| appendcols 
    [ search index=_internal 
        [ `set_local_host`] source=*license_usage.log* type="Usage" 
    | eval h=if(len(h)=0 OR isnull(h),"(SQUASHED)",h) 
    | eval s=if(len(s)=0 OR isnull(s),"(SQUASHED)",s) 
    | eval idx=if(len(idx)=0 OR isnull(idx),"(UNKNOWN)",idx) 
    | bin _time span=1d 
    | stats sum(b) as b by _time, pool, s, st, h, idx 
    | search pool = "*" 
    | search idx = "mlc_log_drop" 
    | timechart span=1d sum(b) AS Log_Drop_Data fixedrange=false 
    | fields - _timediff 
    | foreach * 
        [ eval <<FIELD>>=round('<<FIELD>>'/1024/1024/1024, 3)]] 

 

 

 

Labels (1)
0 Karma
1 Solution

PickleRick
SplunkTrust
SplunkTrust

You're asking a wrong question.

Your both searches start with the same base search so either you should be able to do all in one go or your searches produce differently aggregated results so it doesn't make sense to combine them with appendcols.

View solution in original post

PickleRick
SplunkTrust
SplunkTrust

You're asking a wrong question.

Your both searches start with the same base search so either you should be able to do all in one go or your searches produce differently aggregated results so it doesn't make sense to combine them with appendcols.

robertlynch2020
Motivator

HI

I agree that is correct and this was an example of 2 SPLs I had, but I had other issues else where the SPLs were different.

The UNION command was able to help me out in this case.

Thanks

Robert

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 at Splunk .conf24 ...

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