Splunk Search

How to add 30 day average into Splunk license usage search?

jwalzerpitt
Influencer

I am using the Splunk 30 day usage search and would like to add the 30 day average into the search and then as on overlay. How would I add the average into the search:

(index=_internal host=host source=*license_usage.log* type="RolloverSummary" _time>=1574139600.000) 
| eval _time=_time - 43200 
| bin _time span=1d 
| stats latest(b) AS b by slave, pool, _time 
| timechart span=1d sum(b) AS "volume" fixedrange=false 
| join type=outer _time 
    [ search index=_internal host=host
 source=*license_usage.log* type="RolloverSummary" earliest=-30d@d 
    | eval _time=_time - 43200 
    | bin _time span=1d 
    | dedup _time stack 
    | stats sum(stacksz) AS "stack size" by _time] 
| fields - _timediff 
| foreach "*" 
    [ eval <<FIELD>>=round('<<FIELD>>'/1024/1024/1024, 3)]

Thx

0 Karma

to4kawa
Ultra Champion
index=_internal  source="*license_usage.log" type="RolloverSummary" earliest=-30d@d
 | bin _time span=1d 
 | eventstats sum(stacksz) as a by _time
 | eventstats avg(a) as stack_avg
 | stats latest(b) AS b values(a) as stack_size values(stack_avg) as stack_avg by slave, pool, _time
 | timechart span=1d sum(b) AS "volume" values(stack_size) as "stack size" values(stack_avg) as "stack avg" fixedrange=false
 | foreach "*" 
     [ eval <<FIELD>>=round('<<FIELD>>'/1024/1024/1024, 3)]

Hi, @jwalzerpitt
| eval _time=_time - 43200 what 's this?

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Leveraging Automated Threat Analysis Across the Splunk Ecosystem

Are you leveraging automation to its fullest potential in your threat detection strategy?Our upcoming Security ...

Can’t Make It to Boston? Stream .conf25 and Learn with Haya Husain

Boston may be buzzing this September with Splunk University and .conf25, but you don’t have to pack a bag to ...

Splunk Lantern’s Guide to The Most Popular .conf25 Sessions

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