Splunk Search

help with [Table values of Search 1] in Search 2 -- subsearch

suryaavinash
Explorer

I have a requirement where i got to see if the results of a Search1 with Index1 are available in search2 with Index2.

Search 1 --
index=fireeye sourcetype=fe_json product="Email MPS" earliest=-33d@d latest=-32d@d "alert.action"=notified "@team.telstra.com" | table alert.explanation.cnc-services.cnc-service{}.address | mvexpand alert.explanation.cnc-services.cnc-service{}.address | fields alert.explanation.cnc-services.cnc-service{}.address

Result 1 --

alert.explanation.cnc-services.cnc-service{}.address

ftp.restavracija-hongkong.si
whatismyipaddress.com

Search 2 --
index=tcif4 sourcetype=cisco:wsa:squid:inside earliest=-33d@d latest=-32d@d "whatismyipaddress.com" | stats count(cs_url_host) as cnt,values(url) as url by cs_url_host
Result 2 --

cs_url_host cnt url

cdn.whatismyipaddress.com 8 tunnel://cdn.whatismyipaddress.com:443/
whatismyipaddress.com 3 tunnel://whatismyipaddress.com:443/

But when i am mixing both the queries and trying i am not getting any output. Can anyone help.

index=tcif4 sourcetype=cisco:wsa:squid:inside earliest=-33d@d latest=-32d@d [search index=fireeye sourcetype=fe_json product="Email MPS" earliest=-33d@d latest=-32d@d "alert.action"=notified "@team.telstra.com" | table alert.explanation.cnc-services.cnc-service{}.address | mvexpand alert.explanation.cnc-services.cnc-service{}.address | fields alert.explanation.cnc-services.cnc-service{}.address] | stats count(cs_url_host) as cnt,values(url) as url by cs_url_host

(or)

index=tcif4 sourcetype=cisco:wsa:squid:inside earliest=-33d@d latest=-32d@d | search [search index=fireeye sourcetype=fe_json product="Email MPS" earliest=-33d@d latest=-32d@d "alert.action"=notified "@team.telstra.com" | table alert.explanation.cnc-services.cnc-service{}.address | mvexpand alert.explanation.cnc-services.cnc-service{}.address | fields alert.explanation.cnc-services.cnc-service{}.address]

0 Karma
1 Solution

tiagofbmm
Influencer

Hey

Try using the return function:

index=tcif4 sourcetype=cisco:wsa:squid:inside earliest=-33d@d latest=-32d@d 
    [ search index=fireeye sourcetype=fe_json product="Email MPS" earliest=-33d@d latest=-32d@d "alert.action"=notified "@team.telstra.com" 
    | table alert.explanation.cnc-services.cnc-service{}.address 
    | mvexpand alert.explanation.cnc-services.cnc-service{}.address 
    | fields alert.explanation.cnc-services.cnc-service{}.address 
    | return 100 $alert.explanation.cnc-services.cnc-service{}.address ] 
| stats count(cs_url_host) as cnt,values(url) as url by cs_url_host

View solution in original post

0 Karma

tiagofbmm
Influencer

Hey

Try using the return function:

index=tcif4 sourcetype=cisco:wsa:squid:inside earliest=-33d@d latest=-32d@d 
    [ search index=fireeye sourcetype=fe_json product="Email MPS" earliest=-33d@d latest=-32d@d "alert.action"=notified "@team.telstra.com" 
    | table alert.explanation.cnc-services.cnc-service{}.address 
    | mvexpand alert.explanation.cnc-services.cnc-service{}.address 
    | fields alert.explanation.cnc-services.cnc-service{}.address 
    | return 100 $alert.explanation.cnc-services.cnc-service{}.address ] 
| stats count(cs_url_host) as cnt,values(url) as url by cs_url_host
0 Karma

suryaavinash
Explorer

Thanks Mate,

I remember trying it but dint work out the query well. Now i did.

Appreciate helping me 🙂

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.
Get Updates on the Splunk Community!

Tech Talk Recap | Mastering Threat Hunting

Mastering Threat HuntingDive into the world of threat hunting, exploring the key differences between ...

Observability for AI Applications: Troubleshooting Latency

If you’re working with proprietary company data, you’re probably going to have a locally hosted LLM or many ...

Splunk AI Assistant for SPL vs. ChatGPT: Which One is Better?

In the age of AI, every tool promises to make our lives easier. From summarizing content to writing code, ...