<?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: How to plot data for two different time ranges in the same visualization? in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-plot-data-for-two-different-time-ranges-in-the-same/m-p/159059#M9820</link>
    <description>&lt;P&gt;Here is a much more elegant solution which can plot all days on the same day in timechart:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval series=strftime(_time, "%m-%d") | eval time_delta=(now-_time)/86400,time_day=ceiling(time_delta),_time=_time+time_day*86400 | eval day=case(time_day=0,"Today",time_day=1,"Yesterday",time_day=8,"SD last week") | timechart fixedrange=false sum(count) by day
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This allows you to plot any time range by series or to assign nice names in the case statement to each day based on its relation to the current time/day.  86400 is the number of seconds in a day.&lt;/P&gt;</description>
    <pubDate>Mon, 07 Aug 2017 18:25:28 GMT</pubDate>
    <dc:creator>landen99</dc:creator>
    <dc:date>2017-08-07T18:25:28Z</dc:date>
    <item>
      <title>How to plot data for two different time ranges in the same visualization?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-plot-data-for-two-different-time-ranges-in-the-same/m-p/159054#M9815</link>
      <description>&lt;P&gt;Hello, word!&lt;/P&gt;

&lt;P&gt;I've started with Splunk a few days ago and still have a lot of questions.&lt;/P&gt;

&lt;P&gt;I'd like to plot on the same graphic two different date ranges for the same metric (count by id). My aim is to compare two different scenarios around the same data (represented by an id), before and after a ux change in the website. Can you please help me?&lt;/P&gt;</description>
      <pubDate>Tue, 24 Feb 2015 19:57:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-plot-data-for-two-different-time-ranges-in-the-same/m-p/159054#M9815</guid>
      <dc:creator>mrncst</dc:creator>
      <dc:date>2015-02-24T19:57:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to plot data for two different time ranges in the same visualization?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-plot-data-for-two-different-time-ranges-in-the-same/m-p/159055#M9816</link>
      <description>&lt;P&gt;Hey There,&lt;/P&gt;

&lt;P&gt;there are tons of posts on how to achieve this functionality.&lt;/P&gt;

&lt;P&gt;&lt;A href="http://blogs.splunk.com/2012/02/19/compare-two-time-ranges-in-one-report/"&gt;http://blogs.splunk.com/2012/02/19/compare-two-time-ranges-in-one-report/&lt;/A&gt;    by Jon Webster&lt;/P&gt;

&lt;P&gt;There is an app called Time Wrap in the splunk app base. Hope this will walk you in the right direction.&lt;/P&gt;

&lt;P&gt;Thanks,&lt;BR /&gt;
Raghav&lt;/P&gt;</description>
      <pubDate>Tue, 24 Feb 2015 20:30:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-plot-data-for-two-different-time-ranges-in-the-same/m-p/159055#M9816</guid>
      <dc:creator>Raghav2384</dc:creator>
      <dc:date>2015-02-24T20:30:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to plot data for two different time ranges in the same visualization?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-plot-data-for-two-different-time-ranges-in-the-same/m-p/159056#M9817</link>
      <description>&lt;P&gt;Thank you for your time!&lt;/P&gt;

&lt;P&gt;I'm following the post instructions and my search displays a visualization but the lines aren't superimposed:&lt;/P&gt;

&lt;P&gt;My search query:&lt;/P&gt;

&lt;P&gt;index=ux app=* country=BRA type=UIInputError id=client-first-name earliest=-2d@d latest=-1d@d | eval ReportKey="today" | append [search index=ux app=* country=BRA type=UIInputError id=client-first-name earliest=-4d@d latest=-3d@d | eval ReportKey="yesterday"| eval _time=_time+60*60*24] | timechart span=10m count(id) by ReportKey&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 19:02:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-plot-data-for-two-different-time-ranges-in-the-same/m-p/159056#M9817</guid>
      <dc:creator>mrncst</dc:creator>
      <dc:date>2020-09-28T19:02:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to plot data for two different time ranges in the same visualization?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-plot-data-for-two-different-time-ranges-in-the-same/m-p/159057#M9818</link>
      <description>&lt;P&gt;The time difference between two searches is 2 days. Update your time adjustment to 2 days &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval _time =  _time + 2*86400
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 24 Feb 2015 22:17:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-plot-data-for-two-different-time-ranges-in-the-same/m-p/159057#M9818</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2015-02-24T22:17:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to plot data for two different time ranges in the same visualization?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-plot-data-for-two-different-time-ranges-in-the-same/m-p/159058#M9819</link>
      <description>&lt;P&gt;Please accept as answer / leave comments so that it would be easier for others to see the post.&lt;/P&gt;

&lt;P&gt;Thanks,&lt;BR /&gt;
Raghav&lt;/P&gt;</description>
      <pubDate>Tue, 03 Mar 2015 20:51:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-plot-data-for-two-different-time-ranges-in-the-same/m-p/159058#M9819</guid>
      <dc:creator>Raghav2384</dc:creator>
      <dc:date>2015-03-03T20:51:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to plot data for two different time ranges in the same visualization?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-plot-data-for-two-different-time-ranges-in-the-same/m-p/159059#M9820</link>
      <description>&lt;P&gt;Here is a much more elegant solution which can plot all days on the same day in timechart:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval series=strftime(_time, "%m-%d") | eval time_delta=(now-_time)/86400,time_day=ceiling(time_delta),_time=_time+time_day*86400 | eval day=case(time_day=0,"Today",time_day=1,"Yesterday",time_day=8,"SD last week") | timechart fixedrange=false sum(count) by day
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This allows you to plot any time range by series or to assign nice names in the case statement to each day based on its relation to the current time/day.  86400 is the number of seconds in a day.&lt;/P&gt;</description>
      <pubDate>Mon, 07 Aug 2017 18:25:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-plot-data-for-two-different-time-ranges-in-the-same/m-p/159059#M9820</guid>
      <dc:creator>landen99</dc:creator>
      <dc:date>2017-08-07T18:25:28Z</dc:date>
    </item>
  </channel>
</rss>

