Splunk Search

We want to get license usage by a _meta field ServerRole?

Arpit_S
Path Finder

The license usage logs are present under an index ABC, but in inputs.conf in which the _meta field is present sends data to different index winsec.

Will the below query provide the exact license usage?

index=winsec | eval b=len(_raw) |eval GB=(b/(1024*1024*1024)) | stats sum(GB)

0 Karma

mdsnmss
SplunkTrust
SplunkTrust

For getting license usage of a specific index I would recommend using the license_usage.log in the _internal index. Here is a recommended search:

index=_internal source=*license_usage.log type="Usage"    | eval indexname = if(len(idx)=0 OR isnull(idx),"(UNKNOWN)",idx)   | eval sourcetypename = st   | stats sum(b) as b by _time, indexname, sourcetypename | eval GB=(b/1024/1024/1024)  | fields _time, indexname, sourcetypename, GB | search indexname=* sourcetypename=* | stats sum(GB)

You can change the filters to hit specific sourcetypes or indexes. You can add host/source metadata to the search but those values run the risk of being squashed in license_usage.log and may not be present in every event. The reason h or s may not be present in all events is described well here: https://answers.splunk.com/answers/48542/blank-h-and-s-in-license-usage-log.html

0 Karma

Arpit_S
Path Finder

The above query will only work and provide license usage using _internal index. But the input is coming to different indexes.

But, we need to group the hosts by the _meta field and find the license usage of each group. Is it possible to calculate license usage using the _meta field added to every host in the configuration?

0 Karma

adonio
Ultra Champion

this will look at the length of the raw data in winsec index
if all your data goes only to that index (not the internal splunk data) than it will be pretty accurate.
will highly recommend to go back to default and use the license master correctly

0 Karma
Get Updates on the Splunk Community!

Stay Connected: Your Guide to June Tech Talks, Office Hours, and Webinars!

What are Community Office Hours?Community Office Hours is an interactive 60-minute Zoom series where ...

Splunk Observability Cloud’s AI Assistant in Action Series: Analyzing and ...

This is the second post in our Splunk Observability Cloud’s AI Assistant in Action series, in which we look at ...

Elevate Your Organization with Splunk’s Next Platform Evolution

 Thursday, July 10, 2025  |  11AM PDT / 2PM EDT Whether you're managing complex deployments or looking to ...