<?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: compare response time from yesterday to today in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/compare-response-time-from-yesterday-to-today/m-p/297027#M165565</link>
    <description>&lt;P&gt;could you try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=prd_banking_server Bank_Code = 108 earliest=-1d@d latest=now
| eval Duration_Sec = duration/1000
| multikv 
| eval ReportKey=if(_time&amp;gt;=relative_time(now(),"@d"),"Today","Yesterday")
| timechart span=60m avg(Duration_Sec) by ReportKey
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I'm basically just trying to remove the subsearch in general and compiling ReportKey into one eval statement to define today and yesterday.&lt;/P&gt;

&lt;P&gt;if you need yesterdays time to be shifted a day, add  &lt;CODE&gt;|eval _time=if(ReportKey="Yesterday",_time+86400,_time)&lt;/CODE&gt; before the &lt;CODE&gt;timechart&lt;/CODE&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 13 Oct 2017 17:42:05 GMT</pubDate>
    <dc:creator>cmerriman</dc:creator>
    <dc:date>2017-10-13T17:42:05Z</dc:date>
    <item>
      <title>compare response time from yesterday to today</title>
      <link>https://community.splunk.com/t5/Splunk-Search/compare-response-time-from-yesterday-to-today/m-p/297026#M165564</link>
      <description>&lt;P&gt;Trying to compare response time from yesterday to today.  This search seems to be working, but very, very slow.  Any suggestions on how to improve it?  &lt;/P&gt;

&lt;P&gt;sourcetype=prd_banking_server Bank_Code = 108 earliest=@d latest=now&lt;BR /&gt;
| eval Duration_Sec = duration/1000&lt;BR /&gt;
| multikv &lt;BR /&gt;
| eval ReportKey="Today"&lt;BR /&gt;
| append&lt;BR /&gt;
    [search sourcetype=prd_banking_server Bank_Code = 108 earliest=-1d@d latest=-24@h&lt;BR /&gt;
    | eval Duration_Sec = duration/1000&lt;BR /&gt;
    | multikv&lt;BR /&gt;
    | eval ReportKey="Yesterday"&lt;BR /&gt;
    | eval _time=_time+(60*60*24*7)]&lt;BR /&gt;
| timechart span=60m avg(Duration_Sec) by ReportKey&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 16:10:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/compare-response-time-from-yesterday-to-today/m-p/297026#M165564</guid>
      <dc:creator>mightaswelby</dc:creator>
      <dc:date>2020-09-29T16:10:25Z</dc:date>
    </item>
    <item>
      <title>Re: compare response time from yesterday to today</title>
      <link>https://community.splunk.com/t5/Splunk-Search/compare-response-time-from-yesterday-to-today/m-p/297027#M165565</link>
      <description>&lt;P&gt;could you try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=prd_banking_server Bank_Code = 108 earliest=-1d@d latest=now
| eval Duration_Sec = duration/1000
| multikv 
| eval ReportKey=if(_time&amp;gt;=relative_time(now(),"@d"),"Today","Yesterday")
| timechart span=60m avg(Duration_Sec) by ReportKey
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I'm basically just trying to remove the subsearch in general and compiling ReportKey into one eval statement to define today and yesterday.&lt;/P&gt;

&lt;P&gt;if you need yesterdays time to be shifted a day, add  &lt;CODE&gt;|eval _time=if(ReportKey="Yesterday",_time+86400,_time)&lt;/CODE&gt; before the &lt;CODE&gt;timechart&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 13 Oct 2017 17:42:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/compare-response-time-from-yesterday-to-today/m-p/297027#M165565</guid>
      <dc:creator>cmerriman</dc:creator>
      <dc:date>2017-10-13T17:42:05Z</dc:date>
    </item>
    <item>
      <title>Re: compare response time from yesterday to today</title>
      <link>https://community.splunk.com/t5/Splunk-Search/compare-response-time-from-yesterday-to-today/m-p/297028#M165566</link>
      <description>&lt;P&gt;Have you tried the timewrap command? I just did this, and if you choose Line Chart in visualization, looks pretty cool, and seems to be pretty fast:&lt;/P&gt;

&lt;P&gt;sourcetype=prd_banking_server Bank_Code = 108 earliest=-2d@d &lt;BR /&gt;
|eval Duration=duration/1000&lt;BR /&gt;
| timechart avg(Duration) span=1h&lt;BR /&gt;
| timewrap series=relative 24h&lt;/P&gt;

&lt;P&gt;I obviously used different data:) I did it w/apache logs, and used response_time to generate the viz.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 16:10:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/compare-response-time-from-yesterday-to-today/m-p/297028#M165566</guid>
      <dc:creator>sshelly_splunk</dc:creator>
      <dc:date>2020-09-29T16:10:35Z</dc:date>
    </item>
    <item>
      <title>Re: compare response time from yesterday to today</title>
      <link>https://community.splunk.com/t5/Splunk-Search/compare-response-time-from-yesterday-to-today/m-p/297029#M165567</link>
      <description>&lt;P&gt;after looking again, i see your shifting Yesterday a week ahead, [&lt;CODE&gt;60*60*24*7&lt;/CODE&gt;] . you can use 604800 in the &lt;CODE&gt;_time&lt;/CODE&gt; eval i provided, i'm just not sure why you're shifting it a week. &lt;/P&gt;</description>
      <pubDate>Fri, 13 Oct 2017 17:46:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/compare-response-time-from-yesterday-to-today/m-p/297029#M165567</guid>
      <dc:creator>cmerriman</dc:creator>
      <dc:date>2017-10-13T17:46:29Z</dc:date>
    </item>
    <item>
      <title>Re: compare response time from yesterday to today</title>
      <link>https://community.splunk.com/t5/Splunk-Search/compare-response-time-from-yesterday-to-today/m-p/297030#M165568</link>
      <description>&lt;P&gt;@cmerriman - a day... a week...Hey, to God it's a thousand years anyway, right?&lt;/P&gt;

&lt;P&gt;I also notice that what the OP posted, his "yesterday" search ended at the hour cutoff beforen 24 secondws ago. &lt;/P&gt;</description>
      <pubDate>Fri, 13 Oct 2017 19:16:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/compare-response-time-from-yesterday-to-today/m-p/297030#M165568</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2017-10-13T19:16:51Z</dc:date>
    </item>
  </channel>
</rss>

