<?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: How to subtract a static number (e.g.. minutes, hours, seconds) from a timestamp? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-subtract-a-static-number-e-g-minutes-hours-seconds-from-a/m-p/276966#M83526</link>
    <description>&lt;P&gt;Hi, how can I convert this format of Time?&lt;/P&gt;

&lt;P&gt;start time: 2015-12-13T23:55:02+00:00 &lt;BR /&gt;
end time : 2015-12-15T23:55:02+00:00 &lt;/P&gt;

&lt;P&gt;And then I need to get the time taken from start to end TMA = (Start time - End Time) | table TMA&lt;/P&gt;

&lt;P&gt;Can you  help me out?&lt;/P&gt;

&lt;P&gt;Thanks.&lt;/P&gt;</description>
    <pubDate>Mon, 14 Dec 2015 17:38:37 GMT</pubDate>
    <dc:creator>gabrell</dc:creator>
    <dc:date>2015-12-14T17:38:37Z</dc:date>
    <item>
      <title>How to subtract a static number (e.g.. minutes, hours, seconds) from a timestamp?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-subtract-a-static-number-e-g-minutes-hours-seconds-from-a/m-p/276963#M83523</link>
      <description>&lt;P&gt;Hello, &lt;/P&gt;

&lt;P&gt;I have a timestamp formatted as &lt;CODE&gt;2015-10-14T10:04:47.962Z&lt;/CODE&gt; and I'd like to add or subtract a fixed number of minutes from it.  I've tried things similar to timestamp-5m and stuff that I'm too embarrassed to put here, to no avail.  Your help is GREATLY appreciated.&lt;/P&gt;</description>
      <pubDate>Thu, 10 Dec 2015 17:57:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-subtract-a-static-number-e-g-minutes-hours-seconds-from-a/m-p/276963#M83523</guid>
      <dc:creator>jclemons7</dc:creator>
      <dc:date>2015-12-10T17:57:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to subtract a static number (e.g.. minutes, hours, seconds) from a timestamp?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-subtract-a-static-number-e-g-minutes-hours-seconds-from-a/m-p/276964#M83524</link>
      <description>&lt;P&gt;There are two ways to do that (perhaps others will have more), but both require the timestamp be converted to epoch time first.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | eval ts=strptime(timestamp, "%Y-%m-%dT%H:%M:%S.%3N%Z") | eval newts=ts-300 | ...

... | eval ts=strptime(timestamp, "%Y-%m-%dT%H:%M:%S.%3N%Z") | eval newts=relative_time(ts, -5m) | ...
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 10 Dec 2015 18:15:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-subtract-a-static-number-e-g-minutes-hours-seconds-from-a/m-p/276964#M83524</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2015-12-10T18:15:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to subtract a static number (e.g.. minutes, hours, seconds) from a timestamp?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-subtract-a-static-number-e-g-minutes-hours-seconds-from-a/m-p/276965#M83525</link>
      <description>&lt;P&gt;Your answer worked, but it dawned on me that I already had the value in epoch.. so I just did this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval ts=(_time - (5 * 60))  | ..... 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 10 Dec 2015 18:58:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-subtract-a-static-number-e-g-minutes-hours-seconds-from-a/m-p/276965#M83525</guid>
      <dc:creator>jclemons7</dc:creator>
      <dc:date>2015-12-10T18:58:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to subtract a static number (e.g.. minutes, hours, seconds) from a timestamp?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-subtract-a-static-number-e-g-minutes-hours-seconds-from-a/m-p/276966#M83526</link>
      <description>&lt;P&gt;Hi, how can I convert this format of Time?&lt;/P&gt;

&lt;P&gt;start time: 2015-12-13T23:55:02+00:00 &lt;BR /&gt;
end time : 2015-12-15T23:55:02+00:00 &lt;/P&gt;

&lt;P&gt;And then I need to get the time taken from start to end TMA = (Start time - End Time) | table TMA&lt;/P&gt;

&lt;P&gt;Can you  help me out?&lt;/P&gt;

&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Mon, 14 Dec 2015 17:38:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-subtract-a-static-number-e-g-minutes-hours-seconds-from-a/m-p/276966#M83526</guid>
      <dc:creator>gabrell</dc:creator>
      <dc:date>2015-12-14T17:38:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to subtract a static number (e.g.. minutes, hours, seconds) from a timestamp?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-subtract-a-static-number-e-g-minutes-hours-seconds-from-a/m-p/276967#M83527</link>
      <description>&lt;P&gt;Please post a new question.&lt;/P&gt;</description>
      <pubDate>Mon, 14 Dec 2015 17:58:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-subtract-a-static-number-e-g-minutes-hours-seconds-from-a/m-p/276967#M83527</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2015-12-14T17:58:15Z</dc:date>
    </item>
  </channel>
</rss>

