<?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: Timewrap: Compare last 24 hours to the same day over the last 4 weeks in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Timewrap-Compare-last-24-hours-to-the-same-day-over-the-last-4/m-p/436910#M169065</link>
    <description>&lt;P&gt;when you say "last 24 hours" do you mean a specific DAY like 'Tuesday' or do you mean a rolling 24 hours (like 4pm Monday to 4pm Tuesday)?&lt;/P&gt;</description>
    <pubDate>Tue, 05 Jun 2018 19:50:59 GMT</pubDate>
    <dc:creator>kmaron</dc:creator>
    <dc:date>2018-06-05T19:50:59Z</dc:date>
    <item>
      <title>Timewrap: Compare last 24 hours to the same day over the last 4 weeks</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Timewrap-Compare-last-24-hours-to-the-same-day-over-the-last-4/m-p/436909#M169064</link>
      <description>&lt;P&gt;I would like to compare the last 24 hours to the same day the previous 4 weeks.&lt;/P&gt;</description>
      <pubDate>Tue, 05 Jun 2018 15:42:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Timewrap-Compare-last-24-hours-to-the-same-day-over-the-last-4/m-p/436909#M169064</guid>
      <dc:creator>RMoore01</dc:creator>
      <dc:date>2018-06-05T15:42:12Z</dc:date>
    </item>
    <item>
      <title>Re: Timewrap: Compare last 24 hours to the same day over the last 4 weeks</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Timewrap-Compare-last-24-hours-to-the-same-day-over-the-last-4/m-p/436910#M169065</link>
      <description>&lt;P&gt;when you say "last 24 hours" do you mean a specific DAY like 'Tuesday' or do you mean a rolling 24 hours (like 4pm Monday to 4pm Tuesday)?&lt;/P&gt;</description>
      <pubDate>Tue, 05 Jun 2018 19:50:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Timewrap-Compare-last-24-hours-to-the-same-day-over-the-last-4/m-p/436910#M169065</guid>
      <dc:creator>kmaron</dc:creator>
      <dc:date>2018-06-05T19:50:59Z</dc:date>
    </item>
    <item>
      <title>Re: Timewrap: Compare last 24 hours to the same day over the last 4 weeks</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Timewrap-Compare-last-24-hours-to-the-same-day-over-the-last-4/m-p/436911#M169066</link>
      <description>&lt;P&gt;When I say "last 24 hours" I am talking about earliest=now and 24 hours from then and then the same time for the same day the previous 4 weeks.&lt;BR /&gt;
The start time depends on when I run it, it is not a static variable.&lt;BR /&gt;
Example:&lt;BR /&gt;
Sunday 6/10/18 10:37 AM and the last 24 hours.&lt;BR /&gt;
Sunday 6/03/18 10:37 AM and the last 24 hours.&lt;BR /&gt;
Sunday 5/27/18 10:37 AM and the last 24 hours.&lt;BR /&gt;
Sunday 5/20/18 10:37 AM and the last 24 hours.&lt;/P&gt;</description>
      <pubDate>Sun, 10 Jun 2018 17:39:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Timewrap-Compare-last-24-hours-to-the-same-day-over-the-last-4/m-p/436911#M169066</guid>
      <dc:creator>RMoore01</dc:creator>
      <dc:date>2018-06-10T17:39:24Z</dc:date>
    </item>
    <item>
      <title>Re: Timewrap: Compare last 24 hours to the same day over the last 4 weeks</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Timewrap-Compare-last-24-hours-to-the-same-day-over-the-last-4/m-p/436912#M169067</link>
      <description>&lt;P&gt;Hi RMoore01,&lt;/P&gt;

&lt;P&gt;I find the command &lt;CODE&gt;multisearch&lt;/CODE&gt; really handy for this kind of comparison, also it is a very fast/efficient way to search two different time ranges. Although &lt;CODE&gt;multisearch&lt;/CODE&gt; uses sub search syntax, it is actually not effected by any sub search limitations - from the docs &lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Multisearch"&gt;http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Multisearch&lt;/A&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;With the multisearch command, the events from each subsearch are interleaved. Therefore the multisearch command is not restricted by the subsearch limitations.
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Okay, now for the example; take this run everywhere example to see how it can be done :&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| multisearch 
    [ search index=_internal sourcetype=splunkd earliest=-2w@-24h@h latest=-2w@-0h@h 
    | eval event="1", when="then" ] 
    [ search index=_internal sourcetype=splunkd earliest=-24h@h latest=-0h@h 
    | eval event="1", when="now" ] 
    | chart sum(event) AS events over date_hour by when
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This will give you a chart with the sum of events over the last 24 hours (second search) and the same time range 2 weeks ago (First search). I had to use 2 weeks because it searches &lt;CODE&gt;index=_internal&lt;/CODE&gt; &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;If you add a &lt;CODE&gt;where&lt;/CODE&gt; to the SPL, you can compare the events and show it in a graph like this:&lt;BR /&gt;
&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/5123i2AE95FDFF4C3553E/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;Hope this helps ...&lt;/P&gt;

&lt;P&gt;cheers, MuS&lt;/P&gt;</description>
      <pubDate>Sun, 10 Jun 2018 18:41:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Timewrap-Compare-last-24-hours-to-the-same-day-over-the-last-4/m-p/436912#M169067</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2018-06-10T18:41:14Z</dc:date>
    </item>
    <item>
      <title>Re: Timewrap: Compare last 24 hours to the same day over the last 4 weeks</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Timewrap-Compare-last-24-hours-to-the-same-day-over-the-last-4/m-p/436913#M169068</link>
      <description>&lt;P&gt;This is very helpful, but I need the actual date and times instead of date_hour.&lt;/P&gt;</description>
      <pubDate>Mon, 11 Jun 2018 13:54:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Timewrap-Compare-last-24-hours-to-the-same-day-over-the-last-4/m-p/436913#M169068</guid>
      <dc:creator>RMoore01</dc:creator>
      <dc:date>2018-06-11T13:54:59Z</dc:date>
    </item>
    <item>
      <title>Re: Timewrap: Compare last 24 hours to the same day over the last 4 weeks</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Timewrap-Compare-last-24-hours-to-the-same-day-over-the-last-4/m-p/436914#M169069</link>
      <description>&lt;P&gt;That will be more difficult, and comparing the results will be complicated as well....but let me try something; there are always options &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Jun 2018 18:38:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Timewrap-Compare-last-24-hours-to-the-same-day-over-the-last-4/m-p/436914#M169069</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2018-06-11T18:38:03Z</dc:date>
    </item>
    <item>
      <title>Re: Timewrap: Compare last 24 hours to the same day over the last 4 weeks</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Timewrap-Compare-last-24-hours-to-the-same-day-over-the-last-4/m-p/436915#M169070</link>
      <description>&lt;P&gt;so, this one will give you the &lt;CODE&gt;_time&lt;/CODE&gt; but only for the last 24 hours:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| multisearch 
    [ search index=_internal sourcetype=splunkd earliest=-2w@-24h@h latest=-2w@-0h@h 
    | eval event="1", when="then" ] 
    [ search index=_internal sourcetype=splunkd earliest=-24h@h latest=-0h@h 
    | eval event="1", when="now" ] 
| bin _time span=1h 
| fields event when date_hour 
| chart sum(event) AS events values(_time) AS _time over date_hour by when 
| where 'events: now' &amp;gt; 'events: then'  | table "VALUE_time: now" events* | rename "VALUE_time: now" AS _time
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;the events represented by &lt;CODE&gt;then&lt;/CODE&gt; are in the same hour just two weeks earlier in this example.&lt;/P&gt;

&lt;P&gt;cheers, MuS&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jun 2018 04:21:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Timewrap-Compare-last-24-hours-to-the-same-day-over-the-last-4/m-p/436915#M169070</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2018-06-12T04:21:06Z</dc:date>
    </item>
  </channel>
</rss>

