Dashboards & Visualizations

How to get the license usage per host by sourcetype?

bharadwaja30
Explorer

I have 2 individual reports - 'License Usage by Host' and 'License Usage by Sourcetype'. We know that one host can have more than one sourcetype. Now, I want to generate a report that gives me license usage per host by sourcetype. i.e., I want to know the license used by individual sourcetypes under a particular host. The report should look like the one as below:

alt text

Is there a way we can generate a report of this kind?

Tags (1)
0 Karma
1 Solution

javiergn
Super Champion

This could be one approach but it won't match exactly your table:

index=_internal source=*license_usage.log type="Usage" earliest=-2d@d latest=@d
| fields _time, st, b, h
| bucket span=1d _time
| stats sum(b) as b by _time, st, h
| eval b=round(b/1024/1024, 4)
| rename h as host, st as sourcetype, b as MB
| eval time=strftime(_time, "%Y-%m-%d")
| eval temp = host . "@@" . sourcetype
| xyseries temp, time, MB
| rex field=temp "^(?<host>.+?)@@(?<sourcetype>.+?)$"
| fields - temp
| stats first(*) as * by host, sourcetype

Take a look and let me know if that's enough. The table you are asking for is not trivial to do.

View solution in original post

javiergn
Super Champion

This could be one approach but it won't match exactly your table:

index=_internal source=*license_usage.log type="Usage" earliest=-2d@d latest=@d
| fields _time, st, b, h
| bucket span=1d _time
| stats sum(b) as b by _time, st, h
| eval b=round(b/1024/1024, 4)
| rename h as host, st as sourcetype, b as MB
| eval time=strftime(_time, "%Y-%m-%d")
| eval temp = host . "@@" . sourcetype
| xyseries temp, time, MB
| rex field=temp "^(?<host>.+?)@@(?<sourcetype>.+?)$"
| fields - temp
| stats first(*) as * by host, sourcetype

Take a look and let me know if that's enough. The table you are asking for is not trivial to do.

bharadwaja30
Explorer

Thank you javiergn. This query answered my question.

0 Karma
Get Updates on the Splunk Community!

Detecting Remote Code Executions With the Splunk Threat Research Team

REGISTER NOWRemote code execution (RCE) vulnerabilities pose a significant risk to organizations. If ...

Observability | Use Synthetic Monitoring for Website Metadata Verification

If you are on Splunk Observability Cloud, you may already have Synthetic Monitoringin your observability ...

More Ways To Control Your Costs With Archived Metrics | Register for Tech Talk

Tuesday, May 14, 2024  |  11AM PT / 2PM ET Register to Attend Join us for this Tech Talk and learn how to ...