Splunk Enterprise

Splunk License Usage Report - Max license usage per Index per day showing the peak day per index

SamHTexas
Builder

Please help me fix this SPL to produce the license usage listed above. Thx a million

This is not working for me:

index="_internal"

| stats sum(GB) as A by Date, idx

| eventstats max(A) as B by idx

| where A=B

| dedup A idx

| sort idx

| table Date,A idx

 

Tags (1)
0 Karma
1 Solution

alonsocaio
Contributor

Not so sure, but I guess this query returns only indexes that had used any license on the time range your are searching. If the index didn't receive any data on this time range It won't be returned by the license usage log.

View solution in original post

alonsocaio
Contributor

Hi @SamHTexas, I am not sure if this is what you are looking for, but take a look at the following query:

index="_internal" source="/opt/splunk/var/log/splunk/license_usage.log" type="Usage" 
| eval GB=b/1024/1024/1024 
| bin _time span=1d 
| stats sum(GB) as A by _time, idx 
| eventstats max(A) as B by idx 
| where A=B 
| dedup A idx 
| sort idx 
| table _time,A idx

 I used your base stats, but changed some of the fields on the main query.

0 Karma

SamHTexas
Builder

This is super. But not sure why it does not show all my indexes? Any ideas?

Tags (1)
0 Karma

alonsocaio
Contributor

Not so sure, but I guess this query returns only indexes that had used any license on the time range your are searching. If the index didn't receive any data on this time range It won't be returned by the license usage log.

Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...