Installation

Hourly License Usage

rrjcraft
Explorer

How would you go about retrieving the License Usage by Hour in GB?

Tags (5)

yannK
Splunk Employee
Splunk Employee

Per hour, use timechart

index=_internal source=*license_usage.log* type=Usage
| timechart span=1h sum(b) as bytes
| eval GB = round(bytes/1024/1024/1024,5)
| fields _time GB

or use a bucketing per hour with stats

index=_internal source=*license_usage.log* type=Usage
| bucket _time span=1h
| stats sum(b) as bytes by _time
| eval GB = round(bytes/1024/1024/1024,5)
| fields _time GB

yannK
Splunk Employee
Splunk Employee

This is the bucket command, that regroup events based on a field, and normalize them.
see http://docs.splunk.com/Documentation/Splunk/6.0/SearchReference/Bucket

If you use for the _time, it will replace all the _time by the first value of the span, here every events of the hour will have the same timestamp, the first second of the hour.

0 Karma

rrjcraft
Explorer

I'm not sure what the bucketing means

0 Karma

lukejadamec
Super Champion

Run this search for whatever timeframe you like - it does not count all indexed data, just the data that counts against your license:

index=_internal source=*license_usage.log type=Usage 
| stats sum(b) as bytes 
| eval GB = round(bytes/1024/1024/1024,5)
| fields GB

In chart form:

index=_internal source=*license_usage.log type=Usage 
| stats sum(b) as bytes by date_hour 
| eval GB = round(bytes/1024/1024/1024,5) 
| table date_hour,GB

You will need to specify the timerange. Switch from table to chart with the chart button in the upper left.

0 Karma

lukejadamec
Super Champion

Use the time picker to select what time frame to check. Last 60 minutes will give you the last hour. Today will give you the amount indexed today.

Standby and I'll update the search to give an hourly chart.

0 Karma

rrjcraft
Explorer

That is the tricky part. How would you go about having it display per hour? That query appears to calculate GB for all time.

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

[Puzzles] Solve, Learn, Repeat: Matching cron expressions

This puzzle (first published here) is based on matching timestamps to cron expressions.All the timestamps ...

Why Splunk Customers Should Attend Cisco Live 2026 Las Vegas

Why Splunk Customers Should Attend Cisco Live 2026 Las Vegas     Cisco Live 2026 is almost here, and this ...

Data Management Digest – May 2026

Welcome to the May 2026 edition of Data Management Digest!   As your trusted partner in data innovation, the ...