Splunk Search

How to return subsearch field calculated by stats function?

hjwang
Contributor

Dear all,

If now I extract top 10 src-ip and use this src-ip to do further outer search, but I still wanna keep the field "count" calculated by "stats count by src-ip", how can I remain this field and its value or append to outer search? if I keep this count value, the outer search should not search anything due to not having the field named count.

Thanks

Tags (2)
0 Karma

David
Splunk Employee
Splunk Employee

It depends on what you're looking for. Can you put your search in, or explain the situation a bit more?

One way that can make this work is to go:

YourOuterSearch | join src-ip [search YourInnerSearch | stats count by src-ip]

But that's almost certainly an inefficient way, and you we can get you a better one if you post some more details.

Get Updates on the Splunk Community!

Introducing the Splunk Community Dashboard Challenge!

Welcome to Splunk Community Dashboard Challenge! This is your chance to showcase your skills in creating ...

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