<?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 responseTime field toady to last week without using append in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Compare-responseTime-field-toady-to-last-week-without-using/m-p/252519#M75566</link>
    <description>&lt;P&gt;Thankyou so much sundareshr, your query did helped me out appreciate your quick response. i need to have this query in ITSI in ITSI i need to specify threshold field "Current" and "Last week" as kpi to monitor real time.&lt;BR /&gt;
 is there a way i could divide the field "when" into two separate fields "Current" and Last week".&lt;/P&gt;</description>
    <pubDate>Sat, 27 Aug 2016 16:50:01 GMT</pubDate>
    <dc:creator>appache</dc:creator>
    <dc:date>2016-08-27T16:50:01Z</dc:date>
    <item>
      <title>Compare responseTime field toady to last week without using append</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Compare-responseTime-field-toady-to-last-week-without-using/m-p/252517#M75564</link>
      <description>&lt;P&gt;Hello, I have a problem comparing responseTime field last minute with last week (monday - sunday).&lt;BR /&gt;
Below query give the results what i am seeking for, but append command limits to 50000 events, So avg(responseTime) is not accurate for the last week. &lt;/P&gt;

&lt;P&gt;index=abc  sourcetype=123&lt;BR /&gt;
| eval responseTime1=responseTime/1000 &lt;BR /&gt;
| append [search index=abc earliest=-1w@w1 latest=@w1   sourcetype=123 | eval responseTime7=responseTime/1000 ]&lt;BR /&gt;&lt;BR /&gt;
| stats avg(responseTime1) AS one avg(responseTime7) AS two  by application &lt;/P&gt;

&lt;P&gt;I have tried many examples which i found in splunk answers but none of them are suitable for my requirement.&lt;/P&gt;

&lt;P&gt;Can someone help me with this one?&lt;/P&gt;

&lt;P&gt;Thank you very much in advance!...&lt;/P&gt;</description>
      <pubDate>Sat, 27 Aug 2016 15:46:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Compare-responseTime-field-toady-to-last-week-without-using/m-p/252517#M75564</guid>
      <dc:creator>appache</dc:creator>
      <dc:date>2016-08-27T15:46:53Z</dc:date>
    </item>
    <item>
      <title>Re: Compare responseTime field toady to last week without using append</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Compare-responseTime-field-toady-to-last-week-without-using/m-p/252518#M75565</link>
      <description>&lt;P&gt;Try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=abc sourcetype=123 earliest=-1w@w1 
| eval when=if(_time&amp;gt;relative_time(now(), "-1m@m", "Current", "Last Week")
| eval responseTime=responseTime/1000 
| chart avg(responseTime) AS one by application when
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The relative_time function checks to see if time the event occured is greater than -1min from now, it considers it as current. You can adjust the -1m to whatever you need it to be.&lt;/P&gt;</description>
      <pubDate>Sat, 27 Aug 2016 16:29:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Compare-responseTime-field-toady-to-last-week-without-using/m-p/252518#M75565</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2016-08-27T16:29:53Z</dc:date>
    </item>
    <item>
      <title>Re: Compare responseTime field toady to last week without using append</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Compare-responseTime-field-toady-to-last-week-without-using/m-p/252519#M75566</link>
      <description>&lt;P&gt;Thankyou so much sundareshr, your query did helped me out appreciate your quick response. i need to have this query in ITSI in ITSI i need to specify threshold field "Current" and "Last week" as kpi to monitor real time.&lt;BR /&gt;
 is there a way i could divide the field "when" into two separate fields "Current" and Last week".&lt;/P&gt;</description>
      <pubDate>Sat, 27 Aug 2016 16:50:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Compare-responseTime-field-toady-to-last-week-without-using/m-p/252519#M75566</guid>
      <dc:creator>appache</dc:creator>
      <dc:date>2016-08-27T16:50:01Z</dc:date>
    </item>
    <item>
      <title>Re: Compare responseTime field toady to last week without using append</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Compare-responseTime-field-toady-to-last-week-without-using/m-p/252520#M75567</link>
      <description>&lt;P&gt;You mean something like this?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;eval Current=if(_time&amp;gt;relative_time(now(), "-1m@m"), 1, 0)  | eval "Last Week"=if(_time&amp;lt;relative_time(now(), "-1m@m"), 1, 0)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 27 Aug 2016 17:07:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Compare-responseTime-field-toady-to-last-week-without-using/m-p/252520#M75567</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2016-08-27T17:07:38Z</dc:date>
    </item>
    <item>
      <title>Re: Compare responseTime field toady to last week without using append</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Compare-responseTime-field-toady-to-last-week-without-using/m-p/252521#M75568</link>
      <description>&lt;P&gt;No, when had (| chart avg(responseTime) AS one by application when)  we get Current and Lastweek fields out of it. even if we separate "when" into current and lastweek it still gives o and 1 for both.&lt;BR /&gt;
Now  "When" is a field in interesting fields on our left. Instead of that i need Current and Lastweek as a fields &lt;BR /&gt;
 i am expecting as below &lt;BR /&gt;
|chart avg(responseTime) AS one by application Current LastWeek&lt;/P&gt;

&lt;P&gt;application         Current              LastWeek&lt;BR /&gt;
1                           values                 values&lt;BR /&gt;
2                           values                 values&lt;BR /&gt;
3                           values                 values&lt;/P&gt;</description>
      <pubDate>Sat, 27 Aug 2016 17:53:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Compare-responseTime-field-toady-to-last-week-without-using/m-p/252521#M75568</guid>
      <dc:creator>appache</dc:creator>
      <dc:date>2016-08-27T17:53:57Z</dc:date>
    </item>
    <item>
      <title>Re: Compare responseTime field toady to last week without using append</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Compare-responseTime-field-toady-to-last-week-without-using/m-p/252522#M75569</link>
      <description>&lt;P&gt;Sorry, I am missing something. Don't you get the desired output when you do &lt;CODE&gt;(| chart avg(responseTime) AS one by application when&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 27 Aug 2016 18:11:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Compare-responseTime-field-toady-to-last-week-without-using/m-p/252522#M75569</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2016-08-27T18:11:44Z</dc:date>
    </item>
    <item>
      <title>Re: Compare responseTime field toady to last week without using append</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Compare-responseTime-field-toady-to-last-week-without-using/m-p/252523#M75570</link>
      <description>&lt;P&gt;When we do (| chart avg(responseTime) AS one by application when ) &lt;BR /&gt;
"when"  populates two sub fields "Current" and "Lastweek"&lt;BR /&gt;
instead of having sub fields in "when" is it possible to have "Current" and "Lastweek" as a separate fields like "when".&lt;/P&gt;</description>
      <pubDate>Sat, 27 Aug 2016 18:23:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Compare-responseTime-field-toady-to-last-week-without-using/m-p/252523#M75570</guid>
      <dc:creator>appache</dc:creator>
      <dc:date>2016-08-27T18:23:28Z</dc:date>
    </item>
    <item>
      <title>Re: Compare responseTime field toady to last week without using append</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Compare-responseTime-field-toady-to-last-week-without-using/m-p/252524#M75571</link>
      <description>&lt;P&gt;even like the above example if we divide the field into two separate fields again we have two sub fields in Current and LastWeek. this doesnt work in ITSI. because we cant use any aggregations in ITSI except eventstats. Until unless we have Current and LastWeek as an separate fields intresting fields on our left hand side without having sub fields "0" and "1" i wont be able to use this query&lt;/P&gt;</description>
      <pubDate>Sat, 27 Aug 2016 18:35:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Compare-responseTime-field-toady-to-last-week-without-using/m-p/252524#M75571</guid>
      <dc:creator>appache</dc:creator>
      <dc:date>2016-08-27T18:35:46Z</dc:date>
    </item>
    <item>
      <title>Re: Compare responseTime field toady to last week without using append</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Compare-responseTime-field-toady-to-last-week-without-using/m-p/252525#M75572</link>
      <description>&lt;P&gt;Like this? &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;eval Current=if(_time&amp;gt;relative_time(now(), "-1m@m"), 1, null())  | eval "Last Week"=if(_time&amp;lt;relative_time(now(), "-1m@m"), 1, null())
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 27 Aug 2016 19:00:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Compare-responseTime-field-toady-to-last-week-without-using/m-p/252525#M75572</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2016-08-27T19:00:38Z</dc:date>
    </item>
    <item>
      <title>Re: Compare responseTime field toady to last week without using append</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Compare-responseTime-field-toady-to-last-week-without-using/m-p/252526#M75573</link>
      <description>&lt;P&gt;Or like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=abc sourcetype=123 earliest=-1w@w1 
 | eval when=if(_time&amp;gt;relative_time(now(), "-1m@m", "Current", "Last Week")
 | eval responseTime=responseTime/1000 
 | stats avg(eval(if(when="Current", responseTime, null()) as Current avg(eval(if(when="Last Week", responseTime, null()) as "Last Week"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 27 Aug 2016 19:02:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Compare-responseTime-field-toady-to-last-week-without-using/m-p/252526#M75573</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2016-08-27T19:02:57Z</dc:date>
    </item>
    <item>
      <title>Re: Compare responseTime field toady to last week without using append</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Compare-responseTime-field-toady-to-last-week-without-using/m-p/252527#M75574</link>
      <description>&lt;P&gt;Thankyou sundareshr, it did work, how do i specify latest time in the query to limit to only last week (august 14 -aug 21), now its taking till today. if iam adding latest=@w1 i am not able to get "current" field&lt;/P&gt;</description>
      <pubDate>Sat, 27 Aug 2016 21:32:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Compare-responseTime-field-toady-to-last-week-without-using/m-p/252527#M75574</guid>
      <dc:creator>appache</dc:creator>
      <dc:date>2016-08-27T21:32:52Z</dc:date>
    </item>
    <item>
      <title>Re: Compare responseTime field toady to last week without using append</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Compare-responseTime-field-toady-to-last-week-without-using/m-p/252528#M75575</link>
      <description>&lt;P&gt;If its only last week, what will you be comparing against?&lt;/P&gt;</description>
      <pubDate>Sun, 28 Aug 2016 13:24:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Compare-responseTime-field-toady-to-last-week-without-using/m-p/252528#M75575</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2016-08-28T13:24:02Z</dc:date>
    </item>
    <item>
      <title>Re: Compare responseTime field toady to last week without using append</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Compare-responseTime-field-toady-to-last-week-without-using/m-p/252529#M75576</link>
      <description>&lt;P&gt;I apologize for not being clear appreciate your help, i need to compare avg(responsetime) of only last week (ex: monday - sunday), compare with avg(responsetime) of last min by application and calculate the variance(difference) of both avg_responsetime fields in percentage. &lt;BR /&gt;
last week field should change be static through out the week and it should change only on every monday giving last monday to sunday avg_responsetime.  and the current fields should be dynamic every min as well as variance%.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 10:46:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Compare-responseTime-field-toady-to-last-week-without-using/m-p/252529#M75576</guid>
      <dc:creator>appache</dc:creator>
      <dc:date>2020-09-29T10:46:29Z</dc:date>
    </item>
    <item>
      <title>Re: Compare responseTime field toady to last week without using append</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Compare-responseTime-field-toady-to-last-week-without-using/m-p/252530#M75577</link>
      <description>&lt;P&gt;See of this gives you some ideas&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=abc sourcetype=123 earliest=-1w@w1 
  | eval when=case(_time&amp;gt;relative_time(now(), "-1m@m"), "Current", _time&amp;gt;relative_time(now(), "-1w@w1") AND _time&amp;lt;relative_time(now(), "-1w@w6"), "Last Week", 1=1, "Somewhere in between")
  | eval responseTime=responseTime/1000 
  | stats avg(eval(if(when="Current", responseTime, null()) as Current avg(eval(if(when="Last Week", responseTime, null()) as "Last Week"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 28 Aug 2016 17:58:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Compare-responseTime-field-toady-to-last-week-without-using/m-p/252530#M75577</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2016-08-28T17:58:01Z</dc:date>
    </item>
  </channel>
</rss>

