<?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: Comparing current hour to previous day's hour. in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Comparing-current-hour-to-previous-day-s-hour/m-p/474181#M192463</link>
    <description>&lt;P&gt;hi @philgopaul -  Did this resolve your issue?&lt;/P&gt;</description>
    <pubDate>Sun, 29 Sep 2019 07:26:58 GMT</pubDate>
    <dc:creator>Sukisen1981</dc:creator>
    <dc:date>2019-09-29T07:26:58Z</dc:date>
    <item>
      <title>Comparing current hour to previous day's hour.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Comparing-current-hour-to-previous-day-s-hour/m-p/474179#M192461</link>
      <description>&lt;P&gt;index=&lt;STRONG&gt;&lt;EM&gt;XYZ&lt;/EM&gt;&lt;/STRONG&gt; &lt;EM&gt;trunkgroup&lt;/EM&gt;| stats count(_raw) as Total_Calls, count(eval(Sip_Resp=="200")) as Completed_Calls by OTG&lt;BR /&gt;
|  search Total_Calls&amp;gt;500 | eval Completion_Percentage= (Completed_Calls/Total_Calls * 100)|eval Completion_Percentage=round(Completion_Percentage,2)&lt;/P&gt;

&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;I have this simple query that provides total amount of calls, how many were completed, and the completion percentage.&lt;/P&gt;

&lt;P&gt;I would like to add to this query where I compare it to the previous day at the same hour.  &lt;/P&gt;

&lt;P&gt;I would like this query to be &lt;STRONG&gt;dynamic&lt;/STRONG&gt; where it is always comparing the previous day's hour.&lt;/P&gt;

&lt;P&gt;What can I append to this search query that will show me the data yesterday at the same hour?&lt;/P&gt;

&lt;P&gt;Any help would be greatly appreciated!&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 02:05:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Comparing-current-hour-to-previous-day-s-hour/m-p/474179#M192461</guid>
      <dc:creator>philgopaul</dc:creator>
      <dc:date>2020-09-30T02:05:52Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing current hour to previous day's hour.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Comparing-current-hour-to-previous-day-s-hour/m-p/474180#M192462</link>
      <description>&lt;P&gt;try this:&lt;BR /&gt;
this evaluates the count on the delivered _audit index for today's current hour vs yesterday's current hour.If this is what you need, merely replace your index etc. the stuff from timechart onwards remains the same&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="_audit" |timechart span=1h count | timewrap 1day|eval flg=strftime(now(),"%H")|eval mrkr=strftime(_time,"%H")|where mrkr=flg
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 09 Sep 2019 18:15:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Comparing-current-hour-to-previous-day-s-hour/m-p/474180#M192462</guid>
      <dc:creator>Sukisen1981</dc:creator>
      <dc:date>2019-09-09T18:15:30Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing current hour to previous day's hour.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Comparing-current-hour-to-previous-day-s-hour/m-p/474181#M192463</link>
      <description>&lt;P&gt;hi @philgopaul -  Did this resolve your issue?&lt;/P&gt;</description>
      <pubDate>Sun, 29 Sep 2019 07:26:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Comparing-current-hour-to-previous-day-s-hour/m-p/474181#M192463</guid>
      <dc:creator>Sukisen1981</dc:creator>
      <dc:date>2019-09-29T07:26:58Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing current hour to previous day's hour.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Comparing-current-hour-to-previous-day-s-hour/m-p/474182#M192464</link>
      <description>&lt;P&gt;No, this is not helpful. Cannot get query to work with that suggestion&lt;/P&gt;</description>
      <pubDate>Fri, 08 Nov 2019 15:48:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Comparing-current-hour-to-previous-day-s-hour/m-p/474182#M192464</guid>
      <dc:creator>philgopaul</dc:creator>
      <dc:date>2019-11-08T15:48:53Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing current hour to previous day's hour.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Comparing-current-hour-to-previous-day-s-hour/m-p/474183#M192465</link>
      <description>&lt;P&gt;I cannot get that query to work w/ timechart command.  I prefer to use stats command.&lt;/P&gt;

&lt;P&gt;I am still not understanding how to compare data to previous hour.&lt;/P&gt;

&lt;P&gt;I have this query which is similar to original post.&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;P&gt;index=XYZ |stats count(_raw) as Total,&lt;BR /&gt;
count(eval(txnStatus=="ok")) as&lt;BR /&gt;
Success,&lt;BR /&gt;
count(eval(txnStatus=="cc_fail")) as&lt;BR /&gt;
"Failed" |eval Comp_Percentage=&lt;BR /&gt;
(Success/Total * 100)|eval&lt;BR /&gt;
Comp_Percentage=round(Comp_Percentage,2)&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;How do I add a &lt;STRONG&gt;count&lt;/STRONG&gt; to that query where I am looking at &lt;STRONG&gt;previous day at the same hour&lt;/STRONG&gt;?&lt;/P&gt;

&lt;P&gt;Thanks for any guidance you can provide.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 02:54:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Comparing-current-hour-to-previous-day-s-hour/m-p/474183#M192465</guid>
      <dc:creator>philgopaul</dc:creator>
      <dc:date>2020-09-30T02:54:37Z</dc:date>
    </item>
  </channel>
</rss>

