<?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 Changing Time Format in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Changing-Time-Format/m-p/368928#M66985</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I have a search that displays the "UserID Expiration Date" field as "12/6/2019 21:01"&lt;/P&gt;

&lt;P&gt;I would like to convert this to a format of the field  "2019-12-6"  (leaving out the time)&lt;/P&gt;

&lt;P&gt;I appreciate all the help. This forum is awesome with awesome people.&lt;/P&gt;

&lt;P&gt;Alan&lt;/P&gt;</description>
    <pubDate>Fri, 29 Dec 2017 21:32:55 GMT</pubDate>
    <dc:creator>ajdyer2000</dc:creator>
    <dc:date>2017-12-29T21:32:55Z</dc:date>
    <item>
      <title>Changing Time Format</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Changing-Time-Format/m-p/368928#M66985</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I have a search that displays the "UserID Expiration Date" field as "12/6/2019 21:01"&lt;/P&gt;

&lt;P&gt;I would like to convert this to a format of the field  "2019-12-6"  (leaving out the time)&lt;/P&gt;

&lt;P&gt;I appreciate all the help. This forum is awesome with awesome people.&lt;/P&gt;

&lt;P&gt;Alan&lt;/P&gt;</description>
      <pubDate>Fri, 29 Dec 2017 21:32:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Changing-Time-Format/m-p/368928#M66985</guid>
      <dc:creator>ajdyer2000</dc:creator>
      <dc:date>2017-12-29T21:32:55Z</dc:date>
    </item>
    <item>
      <title>Re: Changing Time Format</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Changing-Time-Format/m-p/368929#M66986</link>
      <description>&lt;P&gt;Run anywhere search that shows what you want:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;| makeresults | eval expiration_original="12/6/2019 21:01" | eval expiration_new=strftime(strptime(expiration_original, "%m/%d/%Y %H:%M"), "%Y-%m-%d")&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Dec 2017 21:43:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Changing-Time-Format/m-p/368929#M66986</guid>
      <dc:creator>micahkemp</dc:creator>
      <dc:date>2017-12-29T21:43:57Z</dc:date>
    </item>
    <item>
      <title>Re: Changing Time Format</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Changing-Time-Format/m-p/368930#M66987</link>
      <description>&lt;P&gt;Try like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your current search with field "UserID Expiration Date"
| eval "UserID Expiration Date"=strftime(strptime('UserID Expiration Date',"%m/%d/%Y %H:%M"),"%Y-%m-%d")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;OR&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your current search with field "UserID Expiration Date"
| eval "UserID Expiration Date"=replace('UserID Expiration Date',"^(\d+)\/(\d+\/(\d+)(.+)","\3-\1-\2")
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 29 Dec 2017 21:45:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Changing-Time-Format/m-p/368930#M66987</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-12-29T21:45:27Z</dc:date>
    </item>
    <item>
      <title>Re: Changing Time Format</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Changing-Time-Format/m-p/368931#M66988</link>
      <description>&lt;P&gt;hey, try this.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=your_base_search | rex field="UserID Expiration Date" "(?P&amp;lt;Date&amp;gt;[^\s]+)"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This will create &lt;CODE&gt;Date&lt;/CODE&gt; field which will have the values which you want!&lt;/P&gt;

&lt;P&gt;Let me know if this helps you!&lt;/P&gt;</description>
      <pubDate>Tue, 02 Jan 2018 05:54:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Changing-Time-Format/m-p/368931#M66988</guid>
      <dc:creator>mayurr98</dc:creator>
      <dc:date>2018-01-02T05:54:41Z</dc:date>
    </item>
  </channel>
</rss>

