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!

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 ...