<?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 Charting / Graphing Multiple data sources one chart in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Charting-Graphing-Multiple-data-sources-one-chart/m-p/26424#M5097</link>
    <description>&lt;P&gt;has anyone experimented with showing statistics for the same time slot over multiple time periods ?&lt;/P&gt;

&lt;P&gt;e.g. imagine a chart that shows the number of transaction over a 24 hour period as a line graph. now imagine a second line (of a different color) that has the 24 hour transaction from yesterday, and another that has a weekly average for 24 hour transaction.&lt;/P&gt;

&lt;P&gt;i appreciate any insights.&lt;/P&gt;</description>
    <pubDate>Sat, 07 Aug 2010 05:23:39 GMT</pubDate>
    <dc:creator>splunkedout</dc:creator>
    <dc:date>2010-08-07T05:23:39Z</dc:date>
    <item>
      <title>Charting / Graphing Multiple data sources one chart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Charting-Graphing-Multiple-data-sources-one-chart/m-p/26424#M5097</link>
      <description>&lt;P&gt;has anyone experimented with showing statistics for the same time slot over multiple time periods ?&lt;/P&gt;

&lt;P&gt;e.g. imagine a chart that shows the number of transaction over a 24 hour period as a line graph. now imagine a second line (of a different color) that has the 24 hour transaction from yesterday, and another that has a weekly average for 24 hour transaction.&lt;/P&gt;

&lt;P&gt;i appreciate any insights.&lt;/P&gt;</description>
      <pubDate>Sat, 07 Aug 2010 05:23:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Charting-Graphing-Multiple-data-sources-one-chart/m-p/26424#M5097</guid>
      <dc:creator>splunkedout</dc:creator>
      <dc:date>2010-08-07T05:23:39Z</dc:date>
    </item>
    <item>
      <title>Re: Charting / Graphing Multiple data sources one chart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Charting-Graphing-Multiple-data-sources-one-chart/m-p/26425#M5098</link>
      <description>&lt;P&gt;For the simple day over day case, the recipe for this solution is pretty well covered in:&lt;/P&gt;

&lt;P&gt;&lt;A href="http://answers.splunk.com/questions/2712/line-chart-comparing-yesterdays-result-with-todays-result-in-dashboard/2725" rel="nofollow"&gt;http://answers.splunk.com/questions/2712/line-chart-comparing-yesterdays-result-with-todays-result-in-dashboard/2725&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;To add a series for the weekly average, for each of the previous seven days at each time bucket, the search is significantly more involved. To do this, the first task is to &lt;CODE&gt;| append []&lt;/CODE&gt; some results that are the computation of the average. The details of the inner search depend on what type of aggregate function that you're using, in this case, you're looking at count, so it's not too bad:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | append [search earliest=-7d@d latest=@d ... | eval _time = ((_time - relative_time(now(), "-7d@d")) % 86400) + relative_time(now(), "@d") | bin _time span=15m | chart count by _time | eval metric = count/7 | eval marker = "weekly average"]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Now you just have to glue this right before the final &lt;CODE&gt;| chart&lt;/CODE&gt; in the day_over_day search in the referenced post, and you should have your answer.&lt;/P&gt;

&lt;P&gt;Putting it all together:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;data&amp;gt; earliest=-1d@d latest=@h
| timechart span=15m count as metric
| addinfo
| eval marker = if(_time &amp;lt; info_min_time + 86400, "yesterday", "today")
| eval _time = if(_time &amp;lt; info_min_time + 86400, _time + 86400, _time)
| append [search &amp;lt;data&amp;gt; earliest=-7d@d latest=@d eventtype=download 
         | eval _time = ((_time - relative_time(now(), "-7d@d")) % 86400) + relative_time(now(), "@d") 
         | bin _time span=15m
         | chart count by _time
         | eval metric = count/7
         | eval marker = "weekly average"]
| chart median(metric) by _time marker
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 15 Aug 2010 09:39:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Charting-Graphing-Multiple-data-sources-one-chart/m-p/26425#M5098</guid>
      <dc:creator>Stephen_Sorkin</dc:creator>
      <dc:date>2010-08-15T09:39:47Z</dc:date>
    </item>
    <item>
      <title>Re: Charting / Graphing Multiple data sources one chart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Charting-Graphing-Multiple-data-sources-one-chart/m-p/26426#M5099</link>
      <description>&lt;P&gt;this is very insightful. there are lots of neat 'splunk moves' here that i didn't know existed. i appreciate you taking the time to write this up. &lt;/P&gt;</description>
      <pubDate>Tue, 17 Aug 2010 04:04:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Charting-Graphing-Multiple-data-sources-one-chart/m-p/26426#M5099</guid>
      <dc:creator>splunkedout</dc:creator>
      <dc:date>2010-08-17T04:04:39Z</dc:date>
    </item>
    <item>
      <title>Re: Charting / Graphing Multiple data sources one chart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Charting-Graphing-Multiple-data-sources-one-chart/m-p/26427#M5100</link>
      <description>&lt;P&gt;&lt;STRONG&gt;Comparing week-over-week results used to a pain in Splunk, with complex date calculations. No more.  Now there is a better way.&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;I wrote a convenient search command called "&lt;A href="http://apps.splunk.com/app/1645/"&gt;timewrap&lt;/A&gt;" that does it all, for arbitrary time periods.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | timechart count span=1d | timewrap w
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;That's it!&lt;/P&gt;

&lt;P&gt;&lt;A href="http://apps.splunk.com/app/1645/"&gt;http://apps.splunk.com/app/1645/&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 21 May 2014 18:56:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Charting-Graphing-Multiple-data-sources-one-chart/m-p/26427#M5100</guid>
      <dc:creator>carasso</dc:creator>
      <dc:date>2014-05-21T18:56:51Z</dc:date>
    </item>
  </channel>
</rss>

