All Apps and Add-ons

How to grab two different numbers using the rest command in the search app

coleman07
Path Finder

I am creating a dashboard to show the % of the license used for the current day. I want to grab the license quota info from the /services/licenser/stacks endpoint and the license usage info from the /services/licenser/pool endpoint then compute the percentage of license used.

I know in the search app, I can do the following:

|rest /services/licenser/pools |search stack_id=download-trial |eval usage=used_bytes | fields usage

and could do the same for the quota:

|rest /services/licenser/stacks | search type=download-trial |  eval lic_quota=quota | fields lic_quota

How would I combine these two to be able to compute usage/lic_quota?

0 Karma

yannK
Splunk Employee
Splunk Employee

Use a main search, and use appendcols the result of the second sub search.

search1 | appendcols [ search2 ] | eval mycalculation

see http://docs.splunk.com/Documentation/Splunk/4.3.3/SearchReference/Appendcols

0 Karma
Get Updates on the Splunk Community!

Get Your Exclusive Splunk Certified Cybersecurity Defense Engineer at Splunk .conf24 ...

We’re excited to announce a new Splunk certification exam being released at .conf24! If you’re headed to Vegas ...

Share Your Ideas & Meet the Lantern team at .Conf! Plus All of This Month’s New ...

Splunk Lantern is Splunk’s customer success center that provides advice from Splunk experts on valuable data ...

Combine Multiline Logs into a Single Event with SOCK: a Step-by-Step Guide for ...

Combine multiline logs into a single event with SOCK - a step-by-step guide for newbies Olga Malita The ...