<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Time Graph question regarding license usage as the day goes on in Monitoring Splunk</title>
    <link>https://community.splunk.com/t5/Monitoring-Splunk/Time-Graph-question-regarding-license-usage-as-the-day-goes-on/m-p/465363#M8207</link>
    <description>&lt;P&gt;yes, that one is pulling back the correct table of values. My version of SplunkCloud is 7.0.11.1 it looks like.&lt;/P&gt;</description>
    <pubDate>Wed, 28 Aug 2019 20:19:53 GMT</pubDate>
    <dc:creator>jeck11</dc:creator>
    <dc:date>2019-08-28T20:19:53Z</dc:date>
    <item>
      <title>Time Graph question regarding license usage as the day goes on</title>
      <link>https://community.splunk.com/t5/Monitoring-Splunk/Time-Graph-question-regarding-license-usage-as-the-day-goes-on/m-p/465355#M8199</link>
      <description>&lt;P&gt;I am new to my admin role and need to get a better handle on our usage as the day goes on. We're always close to our license cap so I need to have the operators visually see if we're trending to breach our daily license usage. Here is an example I quickly threw together in Paint (I know it sucks and is busy) to illustrate what I'm after. &lt;/P&gt;

&lt;P&gt;Let's pretend it's currently 6pm on Thursday.&lt;BR /&gt;
Here's my legend:&lt;BR /&gt;
Red line at 300 GB would show our daily limit&lt;BR /&gt;
Orange represents the usage the prior Thursday. &lt;BR /&gt;
Blue is my usage today as the day goes on.&lt;BR /&gt;
Yellow is my trendline roughly predicting if we're going to breach. &lt;/P&gt;

&lt;P&gt;I have been trying to use the out of the box "License Usage Dashboard" but that is good at showing me what caused me to break my cap the prior day. I need to have something to let me know I need to stop from breaking it today.&lt;/P&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="my crapy example"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/7590i16B227A4CC0E8C4F/image-size/large?v=v2&amp;amp;px=999" role="button" title="my crapy example" alt="my crapy example" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Aug 2019 16:27:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Monitoring-Splunk/Time-Graph-question-regarding-license-usage-as-the-day-goes-on/m-p/465355#M8199</guid>
      <dc:creator>jeck11</dc:creator>
      <dc:date>2019-08-28T16:27:03Z</dc:date>
    </item>
    <item>
      <title>Re: Time Graph question regarding license usage as the day goes on</title>
      <link>https://community.splunk.com/t5/Monitoring-Splunk/Time-Graph-question-regarding-license-usage-as-the-day-goes-on/m-p/465356#M8200</link>
      <description>&lt;P&gt;hi &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/79348"&gt;@jeck11&lt;/a&gt; &lt;/P&gt;

&lt;P&gt;just rehashed a bit of the code from the license usage dashboard -  its NOT your exact fit, but is good for starters.&lt;BR /&gt;
Asuuming you ill run this for the last 7 days &lt;BR /&gt;
index=_internal [&lt;CODE&gt;set_local_host&lt;/CODE&gt;] source=&lt;EM&gt;license_usage.log&lt;/EM&gt; type="Usage" | eval h=if(len(h)=0 OR isnull(h),"(SQUASHED)",h) | eval s=if(len(s)=0 OR isnull(s),"(SQUASHED)",s) | eval idx=if(len(idx)=0 OR isnull(idx),"(UNKNOWN)",idx) | bin _time span=1d | stats sum(b) as b by _time, pool, s, st, h, idx   | timechart span=1d sum(b) AS volumeB by idx fixedrange=false  | join type=outer _time [search index=_internal [&lt;CODE&gt;set_local_host&lt;/CODE&gt;] source=&lt;EM&gt;license_usage.log&lt;/EM&gt; type="RolloverSummary" earliest=-30d@d | eval _time=_time - 43200 | bin _time span=1d | stats latest(stacksz) AS "stack size" by _time] | fields - _timediff  | foreach * [eval &amp;lt;&amp;gt;=round('&amp;lt;&amp;gt;'/1024/1024/1024, 3)]&lt;BR /&gt;
`&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 01:56:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Monitoring-Splunk/Time-Graph-question-regarding-license-usage-as-the-day-goes-on/m-p/465356#M8200</guid>
      <dc:creator>Sukisen1981</dc:creator>
      <dc:date>2020-09-30T01:56:58Z</dc:date>
    </item>
    <item>
      <title>Re: Time Graph question regarding license usage as the day goes on</title>
      <link>https://community.splunk.com/t5/Monitoring-Splunk/Time-Graph-question-regarding-license-usage-as-the-day-goes-on/m-p/465357#M8201</link>
      <description>&lt;P&gt;It appears I'm missing something. I got no results for your search. &lt;BR /&gt;
&lt;IMG src="https://imgur.com/IvFtFcS" alt="error screen" /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Aug 2019 18:34:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Monitoring-Splunk/Time-Graph-question-regarding-license-usage-as-the-day-goes-on/m-p/465357#M8201</guid>
      <dc:creator>jeck11</dc:creator>
      <dc:date>2019-08-28T18:34:34Z</dc:date>
    </item>
    <item>
      <title>Re: Time Graph question regarding license usage as the day goes on</title>
      <link>https://community.splunk.com/t5/Monitoring-Splunk/Time-Graph-question-regarding-license-usage-as-the-day-goes-on/m-p/465358#M8202</link>
      <description>&lt;P&gt;hi @jeck11 &lt;BR /&gt;
many apologies, adding the comment corrupted the code. I am posting this as an answer just to preserve the code, it is just a starter.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; index=_internal [`set_local_host`] source=*license_usage.log* type="Usage" | eval h=if(len(h)=0 OR isnull(h),"(SQUASHED)",h) | eval s=if(len(s)=0 OR isnull(s),"(SQUASHED)",s) | eval idx=if(len(idx)=0 OR isnull(idx),"(UNKNOWN)",idx) | bin _time span=1h | stats sum(b) as b by _time, pool, s, st, h, idx   | timechart span=1h sum(b) AS volumeB by idx cont=f
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;the values of the index are in KBs, you need to pipe&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| foreach * [eval &amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;=round('&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;'/1024/1024/1024,3)]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;to see in GB.please try and confirm back&lt;/P&gt;</description>
      <pubDate>Wed, 28 Aug 2019 19:08:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Monitoring-Splunk/Time-Graph-question-regarding-license-usage-as-the-day-goes-on/m-p/465358#M8202</guid>
      <dc:creator>Sukisen1981</dc:creator>
      <dc:date>2019-08-28T19:08:26Z</dc:date>
    </item>
    <item>
      <title>Re: Time Graph question regarding license usage as the day goes on</title>
      <link>https://community.splunk.com/t5/Monitoring-Splunk/Time-Graph-question-regarding-license-usage-as-the-day-goes-on/m-p/465359#M8203</link>
      <description>&lt;P&gt;Nope. I'm supposed to select last 7 days, correct? &lt;/P&gt;</description>
      <pubDate>Wed, 28 Aug 2019 19:23:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Monitoring-Splunk/Time-Graph-question-regarding-license-usage-as-the-day-goes-on/m-p/465359#M8203</guid>
      <dc:creator>jeck11</dc:creator>
      <dc:date>2019-08-28T19:23:57Z</dc:date>
    </item>
    <item>
      <title>Re: Time Graph question regarding license usage as the day goes on</title>
      <link>https://community.splunk.com/t5/Monitoring-Splunk/Time-Graph-question-regarding-license-usage-as-the-day-goes-on/m-p/465360#M8204</link>
      <description>&lt;P&gt;yes plz select last 7 days from the time picker&lt;BR /&gt;
and btw which splunk version are you on ?&lt;/P&gt;</description>
      <pubDate>Wed, 28 Aug 2019 19:36:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Monitoring-Splunk/Time-Graph-question-regarding-license-usage-as-the-day-goes-on/m-p/465360#M8204</guid>
      <dc:creator>Sukisen1981</dc:creator>
      <dc:date>2019-08-28T19:36:43Z</dc:date>
    </item>
    <item>
      <title>Re: Time Graph question regarding license usage as the day goes on</title>
      <link>https://community.splunk.com/t5/Monitoring-Splunk/Time-Graph-question-regarding-license-usage-as-the-day-goes-on/m-p/465361#M8205</link>
      <description>&lt;P&gt;if i run just this &lt;CODE&gt;index=_internal  source=*license_usage.log* idx &lt;BR /&gt;
| timechart span=5min  avg(b) by idx&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;it shows me the avg size by index in KB&lt;/P&gt;</description>
      <pubDate>Wed, 28 Aug 2019 19:43:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Monitoring-Splunk/Time-Graph-question-regarding-license-usage-as-the-day-goes-on/m-p/465361#M8205</guid>
      <dc:creator>Sukisen1981</dc:creator>
      <dc:date>2019-08-28T19:43:59Z</dc:date>
    </item>
    <item>
      <title>Re: Time Graph question regarding license usage as the day goes on</title>
      <link>https://community.splunk.com/t5/Monitoring-Splunk/Time-Graph-question-regarding-license-usage-as-the-day-goes-on/m-p/465362#M8206</link>
      <description>&lt;P&gt;what i wanted you to verify was the the size that it gives for the respective indexes, is it more or less matching with your expectations? we can build the graphs/timecharts later, but firstly our base data has to be correct&lt;/P&gt;</description>
      <pubDate>Wed, 28 Aug 2019 19:45:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Monitoring-Splunk/Time-Graph-question-regarding-license-usage-as-the-day-goes-on/m-p/465362#M8206</guid>
      <dc:creator>Sukisen1981</dc:creator>
      <dc:date>2019-08-28T19:45:02Z</dc:date>
    </item>
    <item>
      <title>Re: Time Graph question regarding license usage as the day goes on</title>
      <link>https://community.splunk.com/t5/Monitoring-Splunk/Time-Graph-question-regarding-license-usage-as-the-day-goes-on/m-p/465363#M8207</link>
      <description>&lt;P&gt;yes, that one is pulling back the correct table of values. My version of SplunkCloud is 7.0.11.1 it looks like.&lt;/P&gt;</description>
      <pubDate>Wed, 28 Aug 2019 20:19:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Monitoring-Splunk/Time-Graph-question-regarding-license-usage-as-the-day-goes-on/m-p/465363#M8207</guid>
      <dc:creator>jeck11</dc:creator>
      <dc:date>2019-08-28T20:19:53Z</dc:date>
    </item>
    <item>
      <title>Re: Time Graph question regarding license usage as the day goes on</title>
      <link>https://community.splunk.com/t5/Monitoring-Splunk/Time-Graph-question-regarding-license-usage-as-the-day-goes-on/m-p/465364#M8208</link>
      <description>&lt;P&gt;hi &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/79348"&gt;@jeck11&lt;/a&gt; &lt;BR /&gt;
I am sorry its very late here (IST), but i think we are almost done&lt;BR /&gt;
try this&lt;BR /&gt;
index=_internal  source=&lt;EM&gt;license_usage.log&lt;/EM&gt; idx &lt;BR /&gt;
| timechart span=1h  avg(b) by idx&lt;BR /&gt;
| fillnull value=0| timewrap 1week&lt;BR /&gt;
| eval day=strftime(_time, "%A")&lt;BR /&gt;
| eval today=strftime(now(), "%A")&lt;BR /&gt;
| where day=today&lt;/P&gt;

&lt;P&gt;This should give you the line graphs in blue and orange, that is today vs same day in the last week.&lt;BR /&gt;
I will come up with the trend tomorrow, meanwhile I want you to ponder how you want the dashboard to be?&lt;BR /&gt;
If you have 5-10 indexes it is better to go for individual charts dedicated to an index each OR do you just wanna sum up the indexes and have 1 chart on your overall splunk daily indexing limit?&lt;BR /&gt;
It is not wise to plot all indexes in one chart, both from the coding perspective as well as from a readability perspective.&lt;BR /&gt;
I suggest going for option2, what we care about really is to have the sum of data indexed  against your overall daily index limit, please suggest and please feel free to upvote  my answer/comment if it has helped you significantly so far. &lt;BR /&gt;
But now I mist catch some sleep, I will look into this again tomorrow morning , hopefully your thoughts / inputs will be shared by then&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 02:00:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Monitoring-Splunk/Time-Graph-question-regarding-license-usage-as-the-day-goes-on/m-p/465364#M8208</guid>
      <dc:creator>Sukisen1981</dc:creator>
      <dc:date>2020-09-30T02:00:01Z</dc:date>
    </item>
    <item>
      <title>Re: Time Graph question regarding license usage as the day goes on</title>
      <link>https://community.splunk.com/t5/Monitoring-Splunk/Time-Graph-question-regarding-license-usage-as-the-day-goes-on/m-p/465365#M8209</link>
      <description>&lt;P&gt;hi @jeck11 &lt;/P&gt;

&lt;P&gt;Below is the complete code,points to be noted&lt;BR /&gt;
I have removed a split by index (removed by clause idx in timecharts) so this gives values for ALL indexes.&lt;BR /&gt;
test this first, then we can decide if you need a 'top' indexes or indexwise split&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=_internal source=*license_usage.log* idx| timechart span=1h avg(b) 
| fillnull value=0| timewrap 1week
| eval day=strftime(_time, "%A")
| eval today=strftime(now(), "%A")
| where day=today| eval date=strftime(_time,"%d")
| eventstats max(_time) as maxtime
| eval max_date=strftime(maxtime,"%d")
| where date=max_date
| fields _time,*latest_week 
| rename avg(b)_latest_week as crnt_wk
| append
    [search index=_internal source=*license_usage.log* idx| timechart span=1h avg(b)
| fillnull value=0| timewrap 1week
| eval day=strftime(_time, "%A")
| eval today=strftime(now(), "%A")
| where day=today| eval date=strftime(_time,"%d")
| eventstats max(_time) as maxtime
| eval max_date=strftime(maxtime,"%d")
| where date!=max_date
| fields _time,*latest_week
    | rename avg(b)_latest_week as lst_wk]
| eval Threshold=3000
| eval time=strftime(_time,"%H")
| eval _time=time
| fields - _time
| fillnull value=0
| fields time,crnt_wk,lst_wk,Threshold
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 29 Aug 2019 07:59:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Monitoring-Splunk/Time-Graph-question-regarding-license-usage-as-the-day-goes-on/m-p/465365#M8209</guid>
      <dc:creator>Sukisen1981</dc:creator>
      <dc:date>2019-08-29T07:59:31Z</dc:date>
    </item>
    <item>
      <title>Re: Time Graph question regarding license usage as the day goes on</title>
      <link>https://community.splunk.com/t5/Monitoring-Splunk/Time-Graph-question-regarding-license-usage-as-the-day-goes-on/m-p/465366#M8210</link>
      <description>&lt;P&gt;Hi.&lt;/P&gt;

&lt;P&gt;I think this is a start of what you're looking for (FYI, It does require the datamodel provided by Meta Woot:   &lt;A href="https://splunkbase.splunk.com/app/2949/"&gt;https://splunkbase.splunk.com/app/2949/&lt;/A&gt; )&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| pivot Meta_Woot_License_Usage License_Usage sum(gb) AS "LICGB" SPLITROW _time AS _time PERIOD 15m SORT 0 _time ROWSUMMARY 0 COLSUMMARY 0 SHOWOTHER 1
| accum LICGB as TOTALGB
| timechart span=15m avg(TOTALGB)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Set the time period selector for "Today"&lt;/P&gt;

&lt;P&gt;It does have the advantage of being &lt;EM&gt;#@!&lt;/EM&gt; fast....     Searching the _internal index here @ work for license events returns some 13+ million events here, and isn't a useful way to go about querying license utilization, IMO.&lt;/P&gt;

&lt;P&gt;You'll have to do some "| append" search commands to add the "week ago" results, and one for the stacksize as well.  (Personally, I'd hard code that value.)&lt;/P&gt;

&lt;P&gt;I have approximately &lt;EM&gt;zero&lt;/EM&gt; idea how to add in a trend line... perhaps someone else can figure out how to add that one, and volunteer details.  I've never had to use the trendline statement before. &lt;/P&gt;

&lt;P&gt;I'll post further details if I get anywhere else... I've got a variation that spits out a "usage over a week, for the last 3 weeks" report, but its to painful to run real time due to the number of licensing events involved.  This is something I wouldn't mind seeing as well...&lt;/P&gt;

&lt;P&gt;David&lt;/P&gt;

&lt;P&gt;PS: This works on 7.0.2 (yes, I know I need to upgrade - working on it.) &lt;/P&gt;</description>
      <pubDate>Thu, 29 Aug 2019 17:18:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Monitoring-Splunk/Time-Graph-question-regarding-license-usage-as-the-day-goes-on/m-p/465366#M8210</guid>
      <dc:creator>davidwholland</dc:creator>
      <dc:date>2019-08-29T17:18:27Z</dc:date>
    </item>
    <item>
      <title>Re: Time Graph question regarding license usage as the day goes on</title>
      <link>https://community.splunk.com/t5/Monitoring-Splunk/Time-Graph-question-regarding-license-usage-as-the-day-goes-on/m-p/465367#M8211</link>
      <description>&lt;P&gt;This is closer...   (Do the advanced time search of -7d@d to "now")&lt;/P&gt;

&lt;P&gt;Change STACKSZ as appropriate.  Still no trending tho...  I don't seem to be able to get it to work.. &lt;/P&gt;

&lt;P&gt;I use the chart command instead of timechart as the timechart seems to want to graph all 7 days, even though the if() statement reduces the event times to only 24 hours. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| pivot Meta_Woot_License_Usage License_Usage sum(gb) AS "LICGB" SPLITROW _time AS _time PERIOD minute SORT 0 _time ROWSUMMARY 0 COLSUMMARY 0 SHOWOTHER 1
| eval evt_dow=strftime(_time, "%A")
| eval cur_dow=strftime(now(),"%A")
| where evt_dow=cur_dow
| eval evt_date=strftime(_time, "%d")
| eval my_time=if( ( now() - _time  ) &amp;gt; 86400, _time + (86400 * 7 ), _time )
| streamstats sum(LICGB) AS TOTALGB BY evt_date
| eval TOTALGB{evt_date}=TOTALGB
| fields - TOTALGB
| eval STACKSZ=1000
|chart max(TOTALGB*),max(STACKSZ) by my_time
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Sigh, no convenient way to add a screenie, you'll have to trust me that its working. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; &lt;/P&gt;

&lt;P&gt;David&lt;/P&gt;</description>
      <pubDate>Thu, 29 Aug 2019 19:11:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Monitoring-Splunk/Time-Graph-question-regarding-license-usage-as-the-day-goes-on/m-p/465367#M8211</guid>
      <dc:creator>davidwholland</dc:creator>
      <dc:date>2019-08-29T19:11:01Z</dc:date>
    </item>
    <item>
      <title>Re: Time Graph question regarding license usage as the day goes on</title>
      <link>https://community.splunk.com/t5/Monitoring-Splunk/Time-Graph-question-regarding-license-usage-as-the-day-goes-on/m-p/465368#M8212</link>
      <description>&lt;P&gt;I believe that this came from Christopher Boggs:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=_internal source=*license_usage.log* type=Usage
| timechart span=1h sum(b) AS volume_b 
| predict algorithm=LLP period=24 volume_b as prediction future_timespan=24
| addinfo 
| where _time&amp;gt;=relative_time(info_max_time, "@d") AND _time&amp;lt;relative_time(info_max_time, "+d@d") 
| fields - info*
| eval merged = coalesce(volume_b, prediction) 
| stats sum(merged) as predicted_volume sum(volume_b) as volume_so_far 
| eval volume_so_far=round(volume_so_far/1024/1024/1024,2)
| eval predicted_volume=round(predicted_volume/1024/1024/1024,2) 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 01 Sep 2019 20:08:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Monitoring-Splunk/Time-Graph-question-regarding-license-usage-as-the-day-goes-on/m-p/465368#M8212</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-09-01T20:08:28Z</dc:date>
    </item>
  </channel>
</rss>

