<?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 Converting Time and Date to a Uniform Value in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Converting-Time-and-Date-to-a-Uniform-Value/m-p/436615#M76174</link>
    <description>&lt;P&gt;Hi,&lt;BR /&gt;
I have 3 data sources and all have different time and date formats.&lt;/P&gt;

&lt;P&gt;Field1&lt;BR /&gt;
2019-06-07 17:05:28.513&lt;BR /&gt;
Field2&lt;BR /&gt;
Tue, 06 Aug 2019 19:17:24 +0000&lt;BR /&gt;
Field3&lt;BR /&gt;
20190718140413.500000-240&lt;/P&gt;

&lt;P&gt;I would like to have them all converted to  mm/dd/yyyy  hour minutes&lt;BR /&gt;
Field1&lt;BR /&gt;
06/07/2019 17:05&lt;BR /&gt;
Field2&lt;BR /&gt;
08/06/2019 19:47&lt;BR /&gt;
Field3&lt;BR /&gt;
07/18/2019 14:04&lt;/P&gt;

&lt;P&gt;Thank you &lt;BR /&gt;
Alan&lt;/P&gt;</description>
    <pubDate>Thu, 08 Aug 2019 20:44:18 GMT</pubDate>
    <dc:creator>ajdyer2000</dc:creator>
    <dc:date>2019-08-08T20:44:18Z</dc:date>
    <item>
      <title>Converting Time and Date to a Uniform Value</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Converting-Time-and-Date-to-a-Uniform-Value/m-p/436615#M76174</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;
I have 3 data sources and all have different time and date formats.&lt;/P&gt;

&lt;P&gt;Field1&lt;BR /&gt;
2019-06-07 17:05:28.513&lt;BR /&gt;
Field2&lt;BR /&gt;
Tue, 06 Aug 2019 19:17:24 +0000&lt;BR /&gt;
Field3&lt;BR /&gt;
20190718140413.500000-240&lt;/P&gt;

&lt;P&gt;I would like to have them all converted to  mm/dd/yyyy  hour minutes&lt;BR /&gt;
Field1&lt;BR /&gt;
06/07/2019 17:05&lt;BR /&gt;
Field2&lt;BR /&gt;
08/06/2019 19:47&lt;BR /&gt;
Field3&lt;BR /&gt;
07/18/2019 14:04&lt;/P&gt;

&lt;P&gt;Thank you &lt;BR /&gt;
Alan&lt;/P&gt;</description>
      <pubDate>Thu, 08 Aug 2019 20:44:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Converting-Time-and-Date-to-a-Uniform-Value/m-p/436615#M76174</guid>
      <dc:creator>ajdyer2000</dc:creator>
      <dc:date>2019-08-08T20:44:18Z</dc:date>
    </item>
    <item>
      <title>Re: Converting Time and Date to a Uniform Value</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Converting-Time-and-Date-to-a-Uniform-Value/m-p/436616#M76175</link>
      <description>&lt;P&gt;Do you want to do this at index time or search time?&lt;BR /&gt;
To be clear, are these 3 data sources separate sourcetypes?&lt;/P&gt;</description>
      <pubDate>Thu, 08 Aug 2019 20:53:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Converting-Time-and-Date-to-a-Uniform-Value/m-p/436616#M76175</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2019-08-08T20:53:40Z</dc:date>
    </item>
    <item>
      <title>Re: Converting Time and Date to a Uniform Value</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Converting-Time-and-Date-to-a-Uniform-Value/m-p/436617#M76176</link>
      <description>&lt;P&gt;&lt;CODE&gt;strptime&lt;/CODE&gt; and &lt;CODE&gt;strftime&lt;/CODE&gt; are your friends for this problem.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults
| eval Field1="2019-06-07 17:05:28.513",Field2="Tue, 06 Aug 2019 19:17:24 +0000",Field3="20190718140413.500000-240"
| eval Date1=strftime(strptime(Field1, "%Y-%m-%d %H:%M"),"%m/%d/%Y %H:%M"), Date2=strftime(strptime(Field2, "%a, %d %b %Y %H:%M"),"%m/%d/%Y %H:%M"), Date3=strftime(strptime(Field3,"%Y%m%d%H%M"),"%m/%d/%Y %H:%M")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;STRONG&gt;Reference:&lt;/STRONG&gt;&lt;BR /&gt;
&lt;A href="https://docs.splunk.com/Documentation/Splunk/7.3.1/SearchReference/Commontimeformatvariables"&gt;https://docs.splunk.com/Documentation/Splunk/7.3.1/SearchReference/Commontimeformatvariables&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Can you upvote and accept the answer if it's helped you? Thanks.&lt;/P&gt;</description>
      <pubDate>Fri, 09 Aug 2019 06:45:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Converting-Time-and-Date-to-a-Uniform-Value/m-p/436617#M76176</guid>
      <dc:creator>jawaharas</dc:creator>
      <dc:date>2019-08-09T06:45:46Z</dc:date>
    </item>
    <item>
      <title>Re: Converting Time and Date to a Uniform Value</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Converting-Time-and-Date-to-a-Uniform-Value/m-p/436618#M76177</link>
      <description>&lt;P&gt;Awesome !!!  Thank you so much!!!! &lt;/P&gt;</description>
      <pubDate>Fri, 09 Aug 2019 19:57:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Converting-Time-and-Date-to-a-Uniform-Value/m-p/436618#M76177</guid>
      <dc:creator>ajdyer2000</dc:creator>
      <dc:date>2019-08-09T19:57:16Z</dc:date>
    </item>
  </channel>
</rss>

