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!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...