<?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 How to calculate percent change over selectable timerange in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-percent-change-over-selectable-timerange/m-p/693749#M236005</link>
    <description>&lt;P&gt;Hello&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'd like to create a single value viz that displays the percent change from a pint in time to now. Basically, I have a dashboard that has a panel that simply counts the number of records in the given timerange. The time is a simple time picker and the base search is a simple:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;index=myindex | stats count&lt;/LI-CODE&gt;
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;I would like to add a panel, maybe single viz, that shows a percent change. For example, if the default is "Last 24 hours" I would like to show the count of the last 24 hours and the percent change from the previous 24 hours. Additionally, if the user selected "Last 7 days" i would like it to give the count of the last 7 days and the percent change from 7 days before that.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for the help&lt;/P&gt;</description>
    <pubDate>Thu, 18 Jul 2024 15:56:41 GMT</pubDate>
    <dc:creator>tkwaller_2</dc:creator>
    <dc:date>2024-07-18T15:56:41Z</dc:date>
    <item>
      <title>How to calculate percent change over selectable timerange</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-percent-change-over-selectable-timerange/m-p/693749#M236005</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'd like to create a single value viz that displays the percent change from a pint in time to now. Basically, I have a dashboard that has a panel that simply counts the number of records in the given timerange. The time is a simple time picker and the base search is a simple:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;index=myindex | stats count&lt;/LI-CODE&gt;
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;I would like to add a panel, maybe single viz, that shows a percent change. For example, if the default is "Last 24 hours" I would like to show the count of the last 24 hours and the percent change from the previous 24 hours. Additionally, if the user selected "Last 7 days" i would like it to give the count of the last 7 days and the percent change from 7 days before that.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for the help&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jul 2024 15:56:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-percent-change-over-selectable-timerange/m-p/693749#M236005</guid>
      <dc:creator>tkwaller_2</dc:creator>
      <dc:date>2024-07-18T15:56:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate percent change over selectable timerange</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-percent-change-over-selectable-timerange/m-p/693757#M236007</link>
      <description>&lt;P&gt;Make your selector token "24hour", "7day", etc. Let's call it $span_tok$. This should do.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=myindex earliest=-$span_tok$-$span_tok$
| timechart span=$span_tok$ count
| streamstats delta(count) as pct_change
| eval pct_change = pct_change / (count - pct_change) * 100&lt;/LI-CODE&gt;&lt;P&gt;The idea is simple, look back 2x $span_tok$, then calculate delta on the go.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jul 2024 16:14:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-percent-change-over-selectable-timerange/m-p/693757#M236007</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2024-07-18T16:14:59Z</dc:date>
    </item>
  </channel>
</rss>

