Splunk Search

How to get only the license usage of hosts in that lookup file?

vpantangi
Path Finder

Hi,
I can see the license usage of hosts in my environment by using this query:

index=_internal source=*license_usage.log type=Usage
 | stats sum(b) AS Bytes by h
 | eval GB = Bytes/1024/1024/1024
 | rename h as host
 | table host GB
 | sort -GB
 | addcoltotals

but i have to calculate only the license usage of dev environment hosts, i have created a lookup as dev.csv, but i am not sure how to get only the license usage of hosts in that lookup file.

Labels (1)
0 Karma

richgalloway
SplunkTrust
SplunkTrust

Try this.

index=_internal source=*license_usage.log type=Usage [|inputlookup dev.csv | fields host | format]
| stats sum(b) AS Bytes by h
| eval GB = Bytes/1024/1024/1024
| rename h as host
| table host GB
| sort -GB
| addcoltotals

---
If this reply helps you, Karma would be appreciated.
0 Karma

aknsun
Path Finder

Am I missing something? I tried something similar, but it doesn't seem to return any data when using the lookup. My lookup has just 2 columns

host        DC
Host1     AWS
Host2     AWS
Host 3   OnPrem

Using what you mentioned earlier.

index=_internal source=*license_usage.log type=Usage [|inputlookup DataCentre.csv | fields host | format]
| stats sum(b) AS Bytes by h
| eval GB = Bytes/1024/1024/1024
| rename h as host
| table host GB
| sort -GB
| addcoltotals

0 Karma

vpantangi
Path Finder

No results found.

0 Karma
Get Updates on the Splunk Community!

Dashboards: Hiding charts while search is being executed and other uses for tokens

There are a couple of features of SimpleXML / Classic dashboards that can be used to enhance the user ...

Splunk Observability Cloud's AI Assistant in Action Series: Explaining Metrics and ...

This is the fourth post in the Splunk Observability Cloud’s AI Assistant in Action series that digs into how ...

Brains, Bytes, and Boston: Learn from the Best at .conf25

When you think of Boston, you might picture colonial charm, world-class universities, or even the crack of a ...