<?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: show % increase over time in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/show-increase-over-time/m-p/51082#M12293</link>
    <description>&lt;P&gt;the math at the end of the search is simple and plan. I don't know who i didn't think of that.  this is useful code thanks.&lt;/P&gt;

&lt;P&gt;Only it takes too long to run.  there has to be a summery index for license use somewhere that does not take so ling to run.&lt;/P&gt;</description>
    <pubDate>Thu, 29 Aug 2013 18:53:08 GMT</pubDate>
    <dc:creator>hartfoml</dc:creator>
    <dc:date>2013-08-29T18:53:08Z</dc:date>
    <item>
      <title>show % increase over time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/show-increase-over-time/m-p/51080#M12291</link>
      <description>&lt;P&gt;I have a search that shows me the 90 day trend of my Splunk license use.&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;index="_internal" source="*metrics.log" per_index_thruput NOT series="*summary"  | eval SLA=### |convert timeformat="%m/%d - %a" ctime(_time) AS kdate| stats sum(kb) as kb_indexed by kdate SLA | eval GB = round(kb_indexed/1024/1024,2)|  sort date_mday | table kdate GB SLA | rename kdate as "Date" | trendline sma10(GB) as Trend&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;First is this a good evaluation of license use?&lt;/P&gt;

&lt;P&gt;Second The trend is so slight that the % increase is less than 5%.&lt;/P&gt;

&lt;P&gt;I would like to show the % increase over 90 days for the trend line on the same graph as the line graph&lt;/P&gt;</description>
      <pubDate>Thu, 29 Aug 2013 15:08:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/show-increase-over-time/m-p/51080#M12291</guid>
      <dc:creator>hartfoml</dc:creator>
      <dc:date>2013-08-29T15:08:10Z</dc:date>
    </item>
    <item>
      <title>Re: show % increase over time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/show-increase-over-time/m-p/51081#M12292</link>
      <description>&lt;P&gt;1) you need to make sure that index=_internal has all the data to create the 90 days report you need. &lt;/P&gt;

&lt;P&gt;2) SLA is your Splunk license in GB. Example below shows SLA=502. It means 502GB per day.&lt;/P&gt;

&lt;P&gt;3) splunk_server should be your master license server or the splunk instance that you would like to trend in case you do not have a master license server.&lt;/P&gt;

&lt;P&gt;4) This query should do what you need:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;splunk_server=your_splunk_license_server_host index=_internal source="*license_usage.*" earliest=-90d@d latest=@d | eval GB=b/1024/1024/1024 | timechart span=1d sum(GB) as GB | eval SLA=502|eval %_License_used=GB*100/SLA
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Since there is not a summary index to make it faster you need to create one. This is another approach using a schedule search to populate a summary index that will allow you to trend the license usage by source type, host and total license usage in a daily basis:&lt;/P&gt;

&lt;P&gt;1) Create an index to be used by the search presented next.&lt;/P&gt;

&lt;P&gt;2) create a scheduled search to run daily. the query of the scheduled search is the following: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;splunk_server=your_splunk_license_server_host index=_internal source="*license_usage.*" earliest=-1d@d latest=@d | eval GB=b/1024/1024/1024  | stats sum(GB) as GB by h st|sort - GB
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;3) In the schedule search configuration select the index you created.&lt;/P&gt;

&lt;P&gt;4) Then, back fill the summary index in case you need to. &lt;/P&gt;

&lt;P&gt;5) Finally, You could use these queries to get trends by sourcetype, host and total license usage:&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;License usage trend:&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=your_sumary_index splunk_server=your_splunk_server_that_has_the_summary_index  |
timechart span=1d sum(GB) as GB |
eval License="502"|
eval Exceeded=if(License&amp;gt;GB,"0",GB-License)|
eval Date=strftime(_time, "%m/%d/%Y")|
table Date GB License Exceeded|
rename GB as "License Volume Used (GB)"|
rename Exceeded as "License Volume Exceeded by (GB)"|
rename License as "Max. License Volume (GB)"|sort - Date
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;STRONG&gt;Trend by source type:&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=your_sumary_index splunk_server=your_splunk_server_that_has_the_summary_index  |
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;timechart span=1d sum(GB) as GB by st&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Trend by host:&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=your_sumary_index splunk_server=your_splunk_server_that_has_the_summary_index  |
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;timechart span=1d sum(GB) as GB by h&lt;/P&gt;

&lt;P&gt;Thanks,&lt;BR /&gt;
Lp&lt;/P&gt;</description>
      <pubDate>Thu, 29 Aug 2013 18:38:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/show-increase-over-time/m-p/51081#M12292</guid>
      <dc:creator>lpolo</dc:creator>
      <dc:date>2013-08-29T18:38:31Z</dc:date>
    </item>
    <item>
      <title>Re: show % increase over time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/show-increase-over-time/m-p/51082#M12293</link>
      <description>&lt;P&gt;the math at the end of the search is simple and plan. I don't know who i didn't think of that.  this is useful code thanks.&lt;/P&gt;

&lt;P&gt;Only it takes too long to run.  there has to be a summery index for license use somewhere that does not take so ling to run.&lt;/P&gt;</description>
      <pubDate>Thu, 29 Aug 2013 18:53:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/show-increase-over-time/m-p/51082#M12293</guid>
      <dc:creator>hartfoml</dc:creator>
      <dc:date>2013-08-29T18:53:08Z</dc:date>
    </item>
  </channel>
</rss>

