Getting Data In

Help to get only number from Number of Files Found

Suganya_S
New Member

Hi Team,
My Query : index=*** kubernetes.container_name=*** cluster_id=*** "Number of Files Found"

Result will be like : Number of Files Found  2(or any number)


I need to get that number value alone, when it is > 0 the count have to be displayed as any chart. How can I edit my query to get like that. Do we have any option for that? Please suggest.
Thanks! 

Labels (1)
0 Karma

Suganya_S
New Member

Hi @aasabatini the count of the log will always be > 0. Here I basically would like to split the log statement so as to get the number alone. 

0 Karma

aasabatini
Motivator

Hi @Suganya_S 

if you see my example search there is a where condition to force to select the count > 0

 where count > 0
“The answer is out there, Neo, and it’s looking for you, and it will find you if you want it to.”
0 Karma

aasabatini
Motivator

Hi @Suganya_S 

 

try to use stats comand

https://docs.splunk.com/Documentation/Splunk/8.1.3/SearchReference/Stats

index=*** kubernetes.container_name=*** cluster_id=*** "Number of Files Found" | stats count | where count > 0

 

“The answer is out there, Neo, and it’s looking for you, and it will find you if you want it to.”
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 ...