<?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: Response Time search with a additional calculation in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Response-Time-search-with-a-additional-calculation/m-p/148554#M185411</link>
    <description>&lt;P&gt;You shouldn't be using a dot in your values there, this makes for an invalid integer. Use&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | eval newtime=if(newtime&amp;gt;=45001,45000,newtime)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 01 May 2014 13:22:00 GMT</pubDate>
    <dc:creator>Ayn</dc:creator>
    <dc:date>2014-05-01T13:22:00Z</dc:date>
    <item>
      <title>Response Time search with a additional calculation</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Response-Time-search-with-a-additional-calculation/m-p/148552#M185409</link>
      <description>&lt;P&gt;Hi there Splunkers&lt;/P&gt;

&lt;P&gt;I need some assistance with a search.  We are calculating the response time between transactions by taking the last event and deducting if from the first event.  That all works perfectly in this search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="my_index* host="the_host*" sourcetype=my_sourcetype Message_Type="123" OR Message_Type="456" | rex field=_raw "\d+:\d+:\d+\.(?&amp;lt;MilliSeconds&amp;gt;\d+)" | eval calctime=(_time*1000) | eval newtime=calctime+MilliSeconds  | stats  latest(newtime) as end earliest(newtime) as begin by UUID | eval responsetime=end-begin | eval Response_Time=round(responsetime/1000,3) | stats max(Response_Time) as Response_Time  | chart first(Response_Time) as RT_Max
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The challenge is to create a second scenario where, if the time exceeds 45.001 seconds (say, 54.269 or 67.598 seconds), then it should return a value of 45.000 seconds where the value still need to be calculable in the search....&lt;/P&gt;

&lt;P&gt;I tried to use the "eval if" command but it gives and error&lt;BR /&gt;
eval if(newtime=&amp;lt;"45.001", "45.000", newtime)&lt;/P&gt;

&lt;P&gt;Any assistance will be appreciated, thanks.&lt;/P&gt;</description>
      <pubDate>Thu, 01 May 2014 11:06:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Response-Time-search-with-a-additional-calculation/m-p/148552#M185409</guid>
      <dc:creator>denisevw</dc:creator>
      <dc:date>2014-05-01T11:06:03Z</dc:date>
    </item>
    <item>
      <title>Re: Response Time search with a additional calculation</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Response-Time-search-with-a-additional-calculation/m-p/148553#M185410</link>
      <description>&lt;P&gt;If you want limit the maximum value of Response_Time, try&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;eval Response_Time=if(Response_Time&amp;gt;45,45,Response_Time)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If you want to create a new variable, try&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;eval newtime=if(Response_Time&amp;gt;45,45,Response_Time)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 01 May 2014 12:09:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Response-Time-search-with-a-additional-calculation/m-p/148553#M185410</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2014-05-01T12:09:20Z</dc:date>
    </item>
    <item>
      <title>Re: Response Time search with a additional calculation</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Response-Time-search-with-a-additional-calculation/m-p/148554#M185411</link>
      <description>&lt;P&gt;You shouldn't be using a dot in your values there, this makes for an invalid integer. Use&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | eval newtime=if(newtime&amp;gt;=45001,45000,newtime)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 01 May 2014 13:22:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Response-Time-search-with-a-additional-calculation/m-p/148554#M185411</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2014-05-01T13:22:00Z</dc:date>
    </item>
    <item>
      <title>Re: Response Time search with a additional calculation</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Response-Time-search-with-a-additional-calculation/m-p/148555#M185412</link>
      <description>&lt;P&gt;Thanks for the instant feedback.&lt;/P&gt;

&lt;P&gt;I've added your recommendation and it worked with&lt;BR /&gt;
eval  Response_Time=if(restime&amp;gt;45,"45.000",restime)&lt;BR /&gt;
just needed to rearrange some naming and it worked perfect.&lt;/P&gt;</description>
      <pubDate>Fri, 02 May 2014 10:09:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Response-Time-search-with-a-additional-calculation/m-p/148555#M185412</guid>
      <dc:creator>denisevw</dc:creator>
      <dc:date>2014-05-02T10:09:13Z</dc:date>
    </item>
    <item>
      <title>Re: Response Time search with a additional calculation</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Response-Time-search-with-a-additional-calculation/m-p/148556#M185413</link>
      <description>&lt;P&gt;Please accept the answer.&lt;/P&gt;</description>
      <pubDate>Fri, 02 May 2014 11:28:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Response-Time-search-with-a-additional-calculation/m-p/148556#M185413</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2014-05-02T11:28:23Z</dc:date>
    </item>
    <item>
      <title>Re: Response Time search with a additional calculation</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Response-Time-search-with-a-additional-calculation/m-p/148557#M185414</link>
      <description>&lt;P&gt;A strange thing is happening here...&lt;/P&gt;

&lt;P&gt;When I run the search, time picked for previous week, it shows different results in Verbose Mode and Fast Mode\Smart Mode.&lt;BR /&gt;
In Verbose Mode is accurate but, in Fast Mode\Smart Mode, it is totally wrong!&lt;BR /&gt;
When I add the search to the Dashboard (Inline or Report), it obviously saves it in the Fast Mode\Smart Mode.&lt;/P&gt;

&lt;P&gt;What is the reason for this and how can I add "Verbose Mode" to the Inline search in the Dashboard?&lt;/P&gt;</description>
      <pubDate>Fri, 02 May 2014 11:28:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Response-Time-search-with-a-additional-calculation/m-p/148557#M185414</guid>
      <dc:creator>denisevw</dc:creator>
      <dc:date>2014-05-02T11:28:50Z</dc:date>
    </item>
  </channel>
</rss>

