<?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: Why am I unable to convert _time to epoch with my search? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Why-am-I-unable-to-convert-time-to-epoch-with-my-search/m-p/229961#M68136</link>
    <description>&lt;P&gt;Before you jump on doing all the calculation and conversions, the _time is a special field in Splunk whose actual value is already in epoch format but displayed in human readable format when show in Splunk UI. Any operation done with value of _time is already in epoch. If you want to see the epoch value of it, just create a new field with same value as _time &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your base search | eval Processed_time=_time | table Processed_Time
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 02 Mar 2016 19:22:18 GMT</pubDate>
    <dc:creator>somesoni2</dc:creator>
    <dc:date>2016-03-02T19:22:18Z</dc:date>
    <item>
      <title>Why am I unable to convert _time to epoch with my search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-am-I-unable-to-convert-time-to-epoch-with-my-search/m-p/229958#M68133</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;_time
2016-03-02 07:00:13.405
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Above _time is the data format in the logs. I need to find difference between a few dates, so I'm trying to convert to epoch&lt;BR /&gt;
Used the following search, but when I table the output, I don't get the converted time:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval Processedtime=strptime(_time,"%Y-%m-%d %H:%M:%S") | table Processedtime
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Appreciate any suggestions.&lt;/P&gt;</description>
      <pubDate>Wed, 02 Mar 2016 07:18:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-am-I-unable-to-convert-time-to-epoch-with-my-search/m-p/229958#M68133</guid>
      <dc:creator>arunsubram</dc:creator>
      <dc:date>2016-03-02T07:18:27Z</dc:date>
    </item>
    <item>
      <title>Re: Why am I unable to convert _time to epoch with my search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-am-I-unable-to-convert-time-to-epoch-with-my-search/m-p/229959#M68134</link>
      <description>&lt;P&gt;hi,&lt;BR /&gt;
You will have to use "%s" ... you can refer &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.3.2/SearchReference/Commontimeformatvariables"&gt;here&lt;/A&gt; for details.&lt;BR /&gt;
Eg:&lt;BR /&gt;
&lt;CODE&gt;| eval Processedtime=strptime(_time,"%s") | table _time,Processedtime&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Mar 2016 18:59:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-am-I-unable-to-convert-time-to-epoch-with-my-search/m-p/229959#M68134</guid>
      <dc:creator>Yasaswy</dc:creator>
      <dc:date>2016-03-02T18:59:44Z</dc:date>
    </item>
    <item>
      <title>Re: Why am I unable to convert _time to epoch with my search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-am-I-unable-to-convert-time-to-epoch-with-my-search/m-p/229960#M68135</link>
      <description>&lt;P&gt;Before going through the pin of converting epoch, maybe the "delta" command will do what you are looking to achieve. Delta will compute the difference between nearby results using the value of a specific numeric field. When used on the _time field it returns the difference in seconds.&lt;/P&gt;</description>
      <pubDate>Wed, 02 Mar 2016 19:02:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-am-I-unable-to-convert-time-to-epoch-with-my-search/m-p/229960#M68135</guid>
      <dc:creator>bgraabek_splunk</dc:creator>
      <dc:date>2016-03-02T19:02:46Z</dc:date>
    </item>
    <item>
      <title>Re: Why am I unable to convert _time to epoch with my search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-am-I-unable-to-convert-time-to-epoch-with-my-search/m-p/229961#M68136</link>
      <description>&lt;P&gt;Before you jump on doing all the calculation and conversions, the _time is a special field in Splunk whose actual value is already in epoch format but displayed in human readable format when show in Splunk UI. Any operation done with value of _time is already in epoch. If you want to see the epoch value of it, just create a new field with same value as _time &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your base search | eval Processed_time=_time | table Processed_Time
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 02 Mar 2016 19:22:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-am-I-unable-to-convert-time-to-epoch-with-my-search/m-p/229961#M68136</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-03-02T19:22:18Z</dc:date>
    </item>
    <item>
      <title>Re: Why am I unable to convert _time to epoch with my search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-am-I-unable-to-convert-time-to-epoch-with-my-search/m-p/229962#M68137</link>
      <description>&lt;P&gt;thanks this worked. &lt;/P&gt;</description>
      <pubDate>Thu, 03 Mar 2016 07:01:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-am-I-unable-to-convert-time-to-epoch-with-my-search/m-p/229962#M68137</guid>
      <dc:creator>arunsubram</dc:creator>
      <dc:date>2016-03-03T07:01:01Z</dc:date>
    </item>
    <item>
      <title>Re: Why am I unable to convert _time to epoch with my search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-am-I-unable-to-convert-time-to-epoch-with-my-search/m-p/229963#M68138</link>
      <description>&lt;P&gt;Noted, Thanks for the answer&lt;/P&gt;</description>
      <pubDate>Thu, 10 Jan 2019 07:52:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-am-I-unable-to-convert-time-to-epoch-with-my-search/m-p/229963#M68138</guid>
      <dc:creator>christian_miran</dc:creator>
      <dc:date>2019-01-10T07:52:55Z</dc:date>
    </item>
  </channel>
</rss>

