Splunk Search

How to search and develop a chart for license usage by index over 2 days with column displaying the percent change?

brywilk_umich
Path Finder

Hi All,

Does anyone have a search/report that shows all of your indexes with usage by day vs the previous day with a column for percent change?

0 Karma
1 Solution

somesoni2
SplunkTrust
SplunkTrust

Give this a try (run from license master node. You can run from any Search Head if you're forwarding your license master logs to Indexers). License usage shown in GB. Compares today vs yesterday.

index=_internal sourcetype=splunkd source=*license_usage.log type=usage earliest=-1d@d 
| eval day=if(_time>relative_time(now(),"@d"),"today","yesterday") | chart sum(b) as usage by idx day
| eval today=round(today/1024/1024/1024,3) | eval yesterday=round(yesterday/1024/1024/1024,3)
| eval percent_change=round((today-yesterday)*100/yesterday,2)

View solution in original post

somesoni2
SplunkTrust
SplunkTrust

Give this a try (run from license master node. You can run from any Search Head if you're forwarding your license master logs to Indexers). License usage shown in GB. Compares today vs yesterday.

index=_internal sourcetype=splunkd source=*license_usage.log type=usage earliest=-1d@d 
| eval day=if(_time>relative_time(now(),"@d"),"today","yesterday") | chart sum(b) as usage by idx day
| eval today=round(today/1024/1024/1024,3) | eval yesterday=round(yesterday/1024/1024/1024,3)
| eval percent_change=round((today-yesterday)*100/yesterday,2)

brywilk_umich
Path Finder

Perfect! Thanks!

0 Karma
Get Updates on the Splunk Community!

Routing logs with Splunk OTel Collector for Kubernetes

The Splunk Distribution of the OpenTelemetry (OTel) Collector is a product that provides a way to ingest ...

Welcome to the Splunk Community!

(view in My Videos) We're so glad you're here! The Splunk Community is place to connect, learn, give back, and ...

Tech Talk | Elevating Digital Service Excellence: The Synergy of Splunk RUM & APM

Elevating Digital Service Excellence: The Synergy of Real User Monitoring and Application Performance ...