<?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: subtract response time value in 'ms' from the _time field and assign it to new field. in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/subtract-response-time-value-in-ms-from-the-time-field-and/m-p/327543#M97502</link>
    <description>&lt;P&gt;When sending a post including code, be sure to mark it as code with the button that say 101 010.  That will keep the interface from treating pieces of it as html and format instructions.&lt;/P&gt;

&lt;P&gt;What part of your sample event is the elapsed ms?&lt;/P&gt;</description>
    <pubDate>Tue, 28 Feb 2017 20:11:33 GMT</pubDate>
    <dc:creator>DalJeanis</dc:creator>
    <dc:date>2017-02-28T20:11:33Z</dc:date>
    <item>
      <title>subtract response time value in 'ms' from the _time field and assign it to new field.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/subtract-response-time-value-in-ms-from-the-time-field-and/m-p/327541#M97500</link>
      <description>&lt;P&gt;Hi, &lt;/P&gt;

&lt;P&gt;Our application logs an event at the end of completion of an api call with response time in milliseconds(ms) like this &amp;lt;16ms&amp;gt;.  I have already extracted the response time into field "ex_time" .   we need to find the start time of the api call and assign it to a field possibly... where the start time is difference between log event timestamp (_time) and response time (ex_time).  how can we achieve this ?  &lt;/P&gt;

&lt;P&gt;start_time = _time - ex_time &lt;/P&gt;

&lt;P&gt;The start time should be in same format as the _time field. &lt;/P&gt;

&lt;P&gt;Sample event --&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;[02/28/17 10:24:12.5387]&lt;/STRONG&gt; DEBUG {14679}: &amp;lt;6189c8b7-59f9-4c63-bb91-6b1eb4435706&amp;gt;MilestonesAclManager.CheckPermissions(, "2") by dren.lock/Elapssecom/b7b05b47-c853-4dcd-9dd0-3dfab3c2cf77. &lt;STRONG&gt;,&amp;lt;16ms&amp;gt;&lt;/STRONG&gt; &lt;/P&gt;

&lt;P&gt;Any hints and help appreciated.&lt;BR /&gt;
Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 13:02:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/subtract-response-time-value-in-ms-from-the-time-field-and/m-p/327541#M97500</guid>
      <dc:creator>nmohammed</dc:creator>
      <dc:date>2020-09-29T13:02:44Z</dc:date>
    </item>
    <item>
      <title>Re: subtract response time value in 'ms' from the _time field and assign it to new field.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/subtract-response-time-value-in-ms-from-the-time-field-and/m-p/327542#M97501</link>
      <description>&lt;P&gt;The _time is a special field whose underlying values is in epoch format. Give this a try&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your base search | eval start_time=_time-(ex_time/1000) | convert ctime(start_time) 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You can also specify your own format like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your base search | eval start_time=_time-round(ex_time/1000,4) | convert ctime(start_time) timeformat="%m/%d/%y %H:%M:%S.%4N")
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 28 Feb 2017 19:28:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/subtract-response-time-value-in-ms-from-the-time-field-and/m-p/327542#M97501</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-02-28T19:28:11Z</dc:date>
    </item>
    <item>
      <title>Re: subtract response time value in 'ms' from the _time field and assign it to new field.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/subtract-response-time-value-in-ms-from-the-time-field-and/m-p/327543#M97502</link>
      <description>&lt;P&gt;When sending a post including code, be sure to mark it as code with the button that say 101 010.  That will keep the interface from treating pieces of it as html and format instructions.&lt;/P&gt;

&lt;P&gt;What part of your sample event is the elapsed ms?&lt;/P&gt;</description>
      <pubDate>Tue, 28 Feb 2017 20:11:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/subtract-response-time-value-in-ms-from-the-time-field-and/m-p/327543#M97502</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2017-02-28T20:11:33Z</dc:date>
    </item>
    <item>
      <title>Re: subtract response time value in 'ms' from the _time field and assign it to new field.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/subtract-response-time-value-in-ms-from-the-time-field-and/m-p/327544#M97503</link>
      <description>&lt;P&gt;Thanks SomeSoni. the second one worked as expected. &lt;/P&gt;</description>
      <pubDate>Tue, 28 Feb 2017 22:00:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/subtract-response-time-value-in-ms-from-the-time-field-and/m-p/327544#M97503</guid>
      <dc:creator>nmohammed</dc:creator>
      <dc:date>2017-02-28T22:00:49Z</dc:date>
    </item>
  </channel>
</rss>

