<?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 Convert date string to timestamp in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Convert-date-string-to-timestamp/m-p/538506#M90243</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have a field called datetime - example is datetime=Wed Feb 03 17:56:37 UTC 2021&lt;/P&gt;&lt;P&gt;I essentially want to convert this so I can evaluate the difference between the event timestamp with this datetime field. I have already converted the event timestamp using: | eval input=strptime(_time, "%m/%d/%Y %I:%M %p") ---&amp;gt; this would show me 2021-02-03 18:07:42.958&lt;/P&gt;&lt;P&gt;How do I convert the datetime field so it's in the same format and how to show the difference between these fields?&lt;/P&gt;</description>
    <pubDate>Wed, 03 Feb 2021 18:30:23 GMT</pubDate>
    <dc:creator>Master162</dc:creator>
    <dc:date>2021-02-03T18:30:23Z</dc:date>
    <item>
      <title>Convert date string to timestamp</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Convert-date-string-to-timestamp/m-p/538506#M90243</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have a field called datetime - example is datetime=Wed Feb 03 17:56:37 UTC 2021&lt;/P&gt;&lt;P&gt;I essentially want to convert this so I can evaluate the difference between the event timestamp with this datetime field. I have already converted the event timestamp using: | eval input=strptime(_time, "%m/%d/%Y %I:%M %p") ---&amp;gt; this would show me 2021-02-03 18:07:42.958&lt;/P&gt;&lt;P&gt;How do I convert the datetime field so it's in the same format and how to show the difference between these fields?&lt;/P&gt;</description>
      <pubDate>Wed, 03 Feb 2021 18:30:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Convert-date-string-to-timestamp/m-p/538506#M90243</guid>
      <dc:creator>Master162</dc:creator>
      <dc:date>2021-02-03T18:30:23Z</dc:date>
    </item>
    <item>
      <title>Re: Convert date string to timestamp</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Convert-date-string-to-timestamp/m-p/538514#M90245</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/231175"&gt;@Master162&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;Please try this;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval datetime_epoc=strptime(datetime,"%a %b %d %H:%M:%S %Z %Y") 
| eval diff=_time-datetime_epoc&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 03 Feb 2021 20:10:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Convert-date-string-to-timestamp/m-p/538514#M90245</guid>
      <dc:creator>scelikok</dc:creator>
      <dc:date>2021-02-03T20:10:33Z</dc:date>
    </item>
  </channel>
</rss>

