<?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: Overlaying a previous years data on chart in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Overlaying-a-previous-years-data-on-chart/m-p/419153#M120499</link>
    <description>&lt;P&gt;If you are using Splunk 6.5 or higher, the &lt;CODE&gt;timewrap&lt;/CODE&gt; function should be available and does exactly this. &lt;/P&gt;

&lt;P&gt;&lt;A href="https://answers.splunk.com/answers/468177/is-timewrap-an-official-spl-command-in-splunk-65.html"&gt;https://answers.splunk.com/answers/468177/is-timewrap-an-official-spl-command-in-splunk-65.html&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;&lt;A href="https://docs.splunk.com/Documentation/Splunk/6.5.0/SearchReference/Timewrap"&gt;https://docs.splunk.com/Documentation/Splunk/6.5.0/SearchReference/Timewrap&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;You would first summarize your data using timechart, then use timewrap in the next pipe.&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;|timechart span=1m sum(my_field) | timewrap span=1y&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;The above should give you a year-over-year chart by month.&lt;/P&gt;</description>
    <pubDate>Mon, 06 Aug 2018 12:35:30 GMT</pubDate>
    <dc:creator>grittonc</dc:creator>
    <dc:date>2018-08-06T12:35:30Z</dc:date>
    <item>
      <title>Overlaying a previous years data on chart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Overlaying-a-previous-years-data-on-chart/m-p/419149#M120495</link>
      <description>&lt;P&gt;I am displaying some data by Month for 2018/2019 (i.e. 01-2018, 02-2018) on a barchart.&lt;/P&gt;

&lt;P&gt;Search Query:&lt;BR /&gt;
( sourcetype=sourcetype1) OR (sourcetype=sourcetype2)  OR (sourcetype=sourcetype3)&lt;BR /&gt;
| chart sum(eval(if(sourcetype="sourcetype1",ICOS,NULL))) as Actuals sum(eval(if(sourcetype="sourcetype2",ICOS,NULL))) as Forecast sum(eval(if(sourcetype="sourcetype3",ICOS,NULL))) as Budget over "Month"&lt;/P&gt;

&lt;P&gt;However I also want to be able to overlay 2017 data so that 2017-01 is shown above 2018-01 without adding to the x-axis.&lt;/P&gt;

&lt;P&gt;Any ideas how I could do that?&lt;/P&gt;</description>
      <pubDate>Tue, 03 Jul 2018 15:35:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Overlaying-a-previous-years-data-on-chart/m-p/419149#M120495</guid>
      <dc:creator>jackreeves</dc:creator>
      <dc:date>2018-07-03T15:35:24Z</dc:date>
    </item>
    <item>
      <title>Re: Overlaying a previous years data on chart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Overlaying-a-previous-years-data-on-chart/m-p/419150#M120496</link>
      <description>&lt;P&gt;Here is a technique from &lt;A href="https://www.splunk.com/pdfs/exploring-splunk.pdf"&gt;Exploring Splunk&lt;/A&gt; by David Carasso.  I recommend downloading this since it has several good examples in it.  This search shows how to compare last weeks results to this weeks results on the same chart, by labeling data from last week and this week, then adjusting _time so they line up for charting.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;earliest=-2w@w latest=@w
 | eval marker = if (_time &amp;lt; relative_time(now(), “-1w@w”),
 “last week”, “this week”)
 | eval _time = if (marker==”last week”,
 _time + 7*24*60*60, _time)
 | timechart avg(bytes) by marker
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 03 Jul 2018 15:47:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Overlaying-a-previous-years-data-on-chart/m-p/419150#M120496</guid>
      <dc:creator>kmorris_splunk</dc:creator>
      <dc:date>2018-07-03T15:47:40Z</dc:date>
    </item>
    <item>
      <title>Re: Overlaying a previous years data on chart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Overlaying-a-previous-years-data-on-chart/m-p/419151#M120497</link>
      <description>&lt;P&gt;Thanks for the response. The pdf is very interesting.&lt;/P&gt;

&lt;P&gt;I believe this would be quite messy when you try and apply across 12 months. Any alternatives?&lt;/P&gt;</description>
      <pubDate>Wed, 04 Jul 2018 14:49:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Overlaying-a-previous-years-data-on-chart/m-p/419151#M120497</guid>
      <dc:creator>jackreeves</dc:creator>
      <dc:date>2018-07-04T14:49:19Z</dc:date>
    </item>
    <item>
      <title>Re: Overlaying a previous years data on chart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Overlaying-a-previous-years-data-on-chart/m-p/419152#M120498</link>
      <description>&lt;P&gt;Added below to search and has worked &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;
&lt;CODE&gt;| appendcols &lt;BR /&gt;
    [ search index=finance sourcetype=hfm_actuals Country1="EMEIA" AND Organisation="DTS_DWS" "Financial Year ending"=2018 &lt;BR /&gt;
    | eval _time=relative_time((_time),"+1year") &lt;BR /&gt;
    | chart sum(ICOS) as "FY18 Actuals" over Month]&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Jul 2018 15:30:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Overlaying-a-previous-years-data-on-chart/m-p/419152#M120498</guid>
      <dc:creator>jackreeves</dc:creator>
      <dc:date>2018-07-04T15:30:01Z</dc:date>
    </item>
    <item>
      <title>Re: Overlaying a previous years data on chart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Overlaying-a-previous-years-data-on-chart/m-p/419153#M120499</link>
      <description>&lt;P&gt;If you are using Splunk 6.5 or higher, the &lt;CODE&gt;timewrap&lt;/CODE&gt; function should be available and does exactly this. &lt;/P&gt;

&lt;P&gt;&lt;A href="https://answers.splunk.com/answers/468177/is-timewrap-an-official-spl-command-in-splunk-65.html"&gt;https://answers.splunk.com/answers/468177/is-timewrap-an-official-spl-command-in-splunk-65.html&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;&lt;A href="https://docs.splunk.com/Documentation/Splunk/6.5.0/SearchReference/Timewrap"&gt;https://docs.splunk.com/Documentation/Splunk/6.5.0/SearchReference/Timewrap&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;You would first summarize your data using timechart, then use timewrap in the next pipe.&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;|timechart span=1m sum(my_field) | timewrap span=1y&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;The above should give you a year-over-year chart by month.&lt;/P&gt;</description>
      <pubDate>Mon, 06 Aug 2018 12:35:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Overlaying-a-previous-years-data-on-chart/m-p/419153#M120499</guid>
      <dc:creator>grittonc</dc:creator>
      <dc:date>2018-08-06T12:35:30Z</dc:date>
    </item>
  </channel>
</rss>

