Splunk Cloud Platform

query help

Praz_123
Communicator

query is -

index="_internal" source="*license_usage.log" type=Usage h="abc" earliest=-3d@d latest=@d | stats sum(b) as usage by _time | eval usage_in_GB = usage / 1024 / 1024 / 1024 | timechart span=1d sum(usage_in_GB) as usage_GB

with the query I can see for specific host but I need a query to see top 10 host which are using daily more than 2gb usage


while using the below am not getting the results :-

index="_internal" source="*license_usage.log" type=Usage earliest=-3d@d latest=@d
| stats sum(b) as usage by _time, h
| eval usage_in_GB = usage / 1024 / 1024 / 1024
| where usage_in_GB > 2
| stats sum(usage_in_GB) as total_usage_GB by h
| sort - total_usage_GB
| head 10

0 Karma

PrewinThomas
Motivator

@Praz_123 
For each day if you want to check try below,

index=_internal source="*license_usage.log" type=Usage earliest=-3d@d latest=@d
| eval usage_in_GB = b/1024/1024/1024
| bin _time span=1d
| stats sum(usage_in_GB) as daily_usage_GB by _time h
| where daily_usage_GB > 2
| sort - daily_usage_GB
| head 10
0 Karma

livehybrid
SplunkTrust
SplunkTrust

Hi @Praz_123 

Try using the bin command before your first stats, something like this should work:

index="_internal" source="*license_usage.log" type=Usage earliest=-3d@d latest=@d
| bin span=1d _time
| stats sum(b) as usage by _time, h
| eval usage_in_GB = usage / 1024 / 1024 / 1024
| where usage_in_GB > 2
| stats sum(usage_in_GB) as total_usage_GB by h
| sort - total_usage_GB
| head 10

🌟 Did this answer help you? If so, please consider:

  • Adding karma to show it was useful
  • Marking it as the solution if it resolved your issue
  • Commenting if you need any clarification

Your feedback encourages the volunteers in this community to continue contributing

 

0 Karma
Get Updates on the Splunk Community!

Data Management Digest – December 2025

Welcome to the December edition of Data Management Digest! As we continue our journey of data innovation, the ...

Index This | What is broken 80% of the time by February?

December 2025 Edition   Hayyy Splunk Education Enthusiasts and the Eternally Curious!    We’re back with this ...

Unlock Faster Time-to-Value on Edge and Ingest Processor with New SPL2 Pipeline ...

Hello Splunk Community,   We're thrilled to share an exciting update that will help you manage your data more ...