<?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: Convert this time format to epoch in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Convert-this-time-format-to-epoch/m-p/154781#M43523</link>
    <description>&lt;P&gt;2/11/2020 11:49:00 AM   2/11/2020 9:55:00 PM&lt;/P&gt;

&lt;P&gt;How to convert this into Secs.. Conersion of AM and PM is not working as expected&lt;/P&gt;

&lt;P&gt;| eval "Bridge End Date In Sec"=tonumber(strftime(strptime('Bridge End Date',"%m/%d/%Y %H:%M:%S %p"),"%s")) &lt;BR /&gt;
| eval "Bridge Start Date In Sec"=tonumber(strftime(strptime('Bridge Start Date',"%m/%d/%Y %H:%M:%S %p"),"%s")) &lt;/P&gt;</description>
    <pubDate>Thu, 05 Mar 2020 20:26:28 GMT</pubDate>
    <dc:creator>ashanka</dc:creator>
    <dc:date>2020-03-05T20:26:28Z</dc:date>
    <item>
      <title>Convert this time format to epoch</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Convert-this-time-format-to-epoch/m-p/154772#M43514</link>
      <description>&lt;P&gt;I have a time in the format of: &lt;BR /&gt;
3:21:34 AM 12/8/2014&lt;/P&gt;

&lt;P&gt;I'm trying to convert this to epoch time.  Can anyone lend a hand?&lt;/P&gt;

&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Mon, 08 Dec 2014 17:43:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Convert-this-time-format-to-epoch/m-p/154772#M43514</guid>
      <dc:creator>hagjos43</dc:creator>
      <dc:date>2014-12-08T17:43:46Z</dc:date>
    </item>
    <item>
      <title>Re: Convert this time format to epoch</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Convert-this-time-format-to-epoch/m-p/154773#M43515</link>
      <description>&lt;P&gt;try this&lt;/P&gt;

&lt;P&gt;eval t="your time field"&lt;/P&gt;</description>
      <pubDate>Mon, 08 Dec 2014 17:53:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Convert-this-time-format-to-epoch/m-p/154773#M43515</guid>
      <dc:creator>kml_uvce</dc:creator>
      <dc:date>2014-12-08T17:53:28Z</dc:date>
    </item>
    <item>
      <title>Re: Convert this time format to epoch</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Convert-this-time-format-to-epoch/m-p/154774#M43516</link>
      <description>&lt;P&gt;Thanks, but that did not work &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;BR /&gt;
Returns a result like this: 10:26:26 AM 12/2/2014&lt;/P&gt;

&lt;P&gt;My query is: &lt;BR /&gt;
    sourcetype=WinEventLog:Security EventCode=520  | eval t=New_Time&lt;/P&gt;</description>
      <pubDate>Mon, 08 Dec 2014 18:11:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Convert-this-time-format-to-epoch/m-p/154774#M43516</guid>
      <dc:creator>hagjos43</dc:creator>
      <dc:date>2014-12-08T18:11:57Z</dc:date>
    </item>
    <item>
      <title>Re: Convert this time format to epoch</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Convert-this-time-format-to-epoch/m-p/154775#M43517</link>
      <description>&lt;P&gt;try this..&lt;BR /&gt;
eval t=_time&lt;/P&gt;

&lt;P&gt;t will be your new field&lt;/P&gt;</description>
      <pubDate>Mon, 08 Dec 2014 18:26:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Convert-this-time-format-to-epoch/m-p/154775#M43517</guid>
      <dc:creator>kml_uvce</dc:creator>
      <dc:date>2014-12-08T18:26:32Z</dc:date>
    </item>
    <item>
      <title>Re: Convert this time format to epoch</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Convert-this-time-format-to-epoch/m-p/154776#M43518</link>
      <description>&lt;P&gt;Try any of strptime or convert command. &lt;/P&gt;

&lt;P&gt;e.g.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| gentimes start=-1 | eval YourDate="3:21:34 AM 12/8/2014" | table YourDate 
| eval epoch1=strptime(YourDate,"%H:%M:%S %p %m/%d/%Y") 
| convert timeformat="%H:%M:%S %p %m/%d/%Y" mktime(YourDate) as epoch2
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 08 Dec 2014 18:53:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Convert-this-time-format-to-epoch/m-p/154776#M43518</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2014-12-08T18:53:56Z</dc:date>
    </item>
    <item>
      <title>Re: Convert this time format to epoch</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Convert-this-time-format-to-epoch/m-p/154777#M43519</link>
      <description>&lt;P&gt;Perfect, thank you very much!&lt;/P&gt;</description>
      <pubDate>Wed, 10 Dec 2014 15:52:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Convert-this-time-format-to-epoch/m-p/154777#M43519</guid>
      <dc:creator>hagjos43</dc:creator>
      <dc:date>2014-12-10T15:52:18Z</dc:date>
    </item>
    <item>
      <title>Re: Convert this time format to epoch</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Convert-this-time-format-to-epoch/m-p/154778#M43520</link>
      <description>&lt;P&gt;I got same results for both AM and PM &lt;/P&gt;</description>
      <pubDate>Sun, 30 Jul 2017 04:43:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Convert-this-time-format-to-epoch/m-p/154778#M43520</guid>
      <dc:creator>nagarjuna280</dc:creator>
      <dc:date>2017-07-30T04:43:31Z</dc:date>
    </item>
    <item>
      <title>Re: Convert this time format to epoch</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Convert-this-time-format-to-epoch/m-p/154779#M43521</link>
      <description>&lt;P&gt;Can you tell me what is the unit of the time which is converted to Epoch format?&lt;BR /&gt;
@somesoni2&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jan 2018 10:17:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Convert-this-time-format-to-epoch/m-p/154779#M43521</guid>
      <dc:creator>pratikkadam</dc:creator>
      <dc:date>2018-01-24T10:17:22Z</dc:date>
    </item>
    <item>
      <title>Re: Convert this time format to epoch</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Convert-this-time-format-to-epoch/m-p/154780#M43522</link>
      <description>&lt;P&gt;It's in seconds&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jan 2018 10:39:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Convert-this-time-format-to-epoch/m-p/154780#M43522</guid>
      <dc:creator>493669</dc:creator>
      <dc:date>2018-01-24T10:39:13Z</dc:date>
    </item>
    <item>
      <title>Re: Convert this time format to epoch</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Convert-this-time-format-to-epoch/m-p/154781#M43523</link>
      <description>&lt;P&gt;2/11/2020 11:49:00 AM   2/11/2020 9:55:00 PM&lt;/P&gt;

&lt;P&gt;How to convert this into Secs.. Conersion of AM and PM is not working as expected&lt;/P&gt;

&lt;P&gt;| eval "Bridge End Date In Sec"=tonumber(strftime(strptime('Bridge End Date',"%m/%d/%Y %H:%M:%S %p"),"%s")) &lt;BR /&gt;
| eval "Bridge Start Date In Sec"=tonumber(strftime(strptime('Bridge Start Date',"%m/%d/%Y %H:%M:%S %p"),"%s")) &lt;/P&gt;</description>
      <pubDate>Thu, 05 Mar 2020 20:26:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Convert-this-time-format-to-epoch/m-p/154781#M43523</guid>
      <dc:creator>ashanka</dc:creator>
      <dc:date>2020-03-05T20:26:28Z</dc:date>
    </item>
    <item>
      <title>Re: Convert this time format to epoch</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Convert-this-time-format-to-epoch/m-p/154782#M43524</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;| eval "Bridge End Date In Sec"=strptime('Bridge End Date',"%m/%d/%Y %H:%M:%S %p")
| eval "Bridge Start Date In Sec"=strptime('Bridge Start Date',"%m/%d/%Y %H:%M:%S %p")
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 05 Mar 2020 22:08:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Convert-this-time-format-to-epoch/m-p/154782#M43524</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-03-05T22:08:39Z</dc:date>
    </item>
  </channel>
</rss>

