<?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 how to change the date format in splunk? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/how-to-change-the-date-format-in-splunk/m-p/272874#M52402</link>
    <description>&lt;P&gt;I have the date format like 2016-03-09 11:43:40.870 ( "%Y-%m-%d %H:%M:%S)&lt;/P&gt;

&lt;P&gt;But i want to change the above date format like  03-09-2016 11:43:40.870 (%m-%d-%Y %H:%M:%S)&lt;/P&gt;

&lt;P&gt;Thanks in advance &lt;/P&gt;</description>
    <pubDate>Tue, 31 May 2016 08:49:28 GMT</pubDate>
    <dc:creator>shankarananthth</dc:creator>
    <dc:date>2016-05-31T08:49:28Z</dc:date>
    <item>
      <title>how to change the date format in splunk?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/how-to-change-the-date-format-in-splunk/m-p/272874#M52402</link>
      <description>&lt;P&gt;I have the date format like 2016-03-09 11:43:40.870 ( "%Y-%m-%d %H:%M:%S)&lt;/P&gt;

&lt;P&gt;But i want to change the above date format like  03-09-2016 11:43:40.870 (%m-%d-%Y %H:%M:%S)&lt;/P&gt;

&lt;P&gt;Thanks in advance &lt;/P&gt;</description>
      <pubDate>Tue, 31 May 2016 08:49:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/how-to-change-the-date-format-in-splunk/m-p/272874#M52402</guid>
      <dc:creator>shankarananthth</dc:creator>
      <dc:date>2016-05-31T08:49:28Z</dc:date>
    </item>
    <item>
      <title>Re: how to change the date format in splunk?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/how-to-change-the-date-format-in-splunk/m-p/272875#M52403</link>
      <description>&lt;P&gt;Try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | eval date=strftime(strptime(date,"%Y-%m-%d %H:%M:%S"), "%m-%d-%Y %H:%M:%S") | ...
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 31 May 2016 13:00:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/how-to-change-the-date-format-in-splunk/m-p/272875#M52403</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2016-05-31T13:00:57Z</dc:date>
    </item>
    <item>
      <title>Re: how to change the date format in splunk?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/how-to-change-the-date-format-in-splunk/m-p/272876#M52404</link>
      <description>&lt;P&gt;At search time you can do this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval newDate=strftime(strptime(oldDate, "%Y-%m-%d %H:%M:%S"), "%m-%d-%Y %H:%M:%S")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;or like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rex mode=sed field=oldDate "s/(\d{4})-(\d+-\d+) /\2-\1 /"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;At index time, like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;SEDCMD-englishDateToUSA "s/(\d{4})-(\d+-\d+) /\2-\1 /"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 31 May 2016 13:01:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/how-to-change-the-date-format-in-splunk/m-p/272876#M52404</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2016-05-31T13:01:35Z</dc:date>
    </item>
  </channel>
</rss>

