Splunk Search

Will you help me fix my license usage by host query?

vrmandadi
Builder

Hello All,

I am using Splunk version 7.1.0 for the Distributed Management Console (DMC) and I want to calculate the license usage by host. I am using the below query:

index=_internal source=*license_usage.log* type="Usage" |search h=*10d*
| eval h=if(len(h)=0 OR isnull(h),"(SQUASHED)",h) 
| eval s=if(len(s)=0 OR isnull(s),"(SQUASHED)",s) 
| eval idx=if(len(idx)=0 OR isnull(idx),"(UNKNOWN)",idx) 
| bin _time span=1d 
| stats sum(b) as b

How can I get the value of "b" in GB? I am confused by the value of "b" . Is it in MB or any other metrics?

0 Karma

harsmarvania57
Ultra Champion

Hi,

Please try this

index=_internal source=*license_usage.log* type="Usage" |search h=*10d*
 | eval h=if(len(h)=0 OR isnull(h),"(SQUASHED)",h) 
 | eval s=if(len(s)=0 OR isnull(s),"(SQUASHED)",s) 
 | eval idx=if(len(idx)=0 OR isnull(idx),"(UNKNOWN)",idx) 
 | bin _time span=1d 
 | stats sum(b) as b
 | eval GB=round((((b/1024)/1024)/1024),2)

vrmandadi
Builder

Thank you for your reply but what is the unit of b ?

0 Karma

harsmarvania57
Ultra Champion

b is in bytes

0 Karma

vrmandadi
Builder

The value of b is 256722093 for the last 60 minutes

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.
Get Updates on the Splunk Community!

Tech Talk Recap | Mastering Threat Hunting

Mastering Threat HuntingDive into the world of threat hunting, exploring the key differences between ...

Observability for AI Applications: Troubleshooting Latency

If you’re working with proprietary company data, you’re probably going to have a locally hosted LLM or many ...

Splunk AI Assistant for SPL vs. ChatGPT: Which One is Better?

In the age of AI, every tool promises to make our lives easier. From summarizing content to writing code, ...