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!

Splunk Observability for AI

Don’t miss out on an exciting Tech Talk on Splunk Observability for AI!Discover how Splunk’s agentic AI ...

Splunk Enterprise Security 8.x: The Essential Upgrade for Threat Detection, ...

Watch On Demand the Tech Talk on November 6 at 11AM PT, and empower your SOC to reach new heights! Duration: ...

Splunk Observability as Code: From Zero to Dashboard

For the details on what Self-Service Observability and Observability as Code is, we have some awesome content ...