<?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: Can you help me change the format of this date field? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-change-the-format-of-this-date-field/m-p/439145#M166932</link>
    <description>&lt;P&gt;You can use this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|eval c=len(&amp;lt;yourdatefieldname&amp;gt;)|eval y="0".&amp;lt;yourfieldname&amp;gt;|eval x = if(c=5,y,&amp;lt;yourfieldname&amp;gt;)|eval date=strftime(strptime(x,"%m%d%y"),"%Y/%m/%d")
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 19 Oct 2018 21:21:43 GMT</pubDate>
    <dc:creator>Vijeta</dc:creator>
    <dc:date>2018-10-19T21:21:43Z</dc:date>
    <item>
      <title>Can you help me change the format of this date field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-change-the-format-of-this-date-field/m-p/439142#M166929</link>
      <description>&lt;P&gt;I have a modify date field in my ingested data.  The date format of this field is MMDDYY with no "/" or "-".  &lt;/P&gt;

&lt;P&gt;Is there a way to change the format of this field during search to where it can be MM/DD/YYYY?  &lt;/P&gt;

&lt;P&gt;Also, I want the search to be able to read this modify field to only search and display events from the previous day.  The ingested data is a complete file with only new entries added to the ingested data, so I can't use the time picker for last 24 hours.  It will retrieve the entire file.&lt;/P&gt;</description>
      <pubDate>Fri, 19 Oct 2018 17:37:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-change-the-format-of-this-date-field/m-p/439142#M166929</guid>
      <dc:creator>sheaross</dc:creator>
      <dc:date>2018-10-19T17:37:18Z</dc:date>
    </item>
    <item>
      <title>Re: Can you help me change the format of this date field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-change-the-format-of-this-date-field/m-p/439143#M166930</link>
      <description>&lt;P&gt;In search query you can change time format-&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;...|eval date=strftime(strptime(&amp;lt;yourfieldname&amp;gt;,"%m%d%y"),"%m/%d/%Y")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;also if you use TIME_FORMAT stanza in props.conf to set your time field as _time then you can use time range to search data...so that _time will be your time field&lt;/P&gt;</description>
      <pubDate>Fri, 19 Oct 2018 17:56:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-change-the-format-of-this-date-field/m-p/439143#M166930</guid>
      <dc:creator>493669</dc:creator>
      <dc:date>2018-10-19T17:56:50Z</dc:date>
    </item>
    <item>
      <title>Re: Can you help me change the format of this date field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-change-the-format-of-this-date-field/m-p/439144#M166931</link>
      <description>&lt;P&gt;That works, for the dates that MMDDYY and I did not mention that some of the date do not have a 0 in front of the month.  For example: September is 9 instead of 09.  This query will only for months with two digits.&lt;BR /&gt;
Any other ideas?&lt;/P&gt;</description>
      <pubDate>Fri, 19 Oct 2018 20:54:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-change-the-format-of-this-date-field/m-p/439144#M166931</guid>
      <dc:creator>sheaross</dc:creator>
      <dc:date>2018-10-19T20:54:19Z</dc:date>
    </item>
    <item>
      <title>Re: Can you help me change the format of this date field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-change-the-format-of-this-date-field/m-p/439145#M166932</link>
      <description>&lt;P&gt;You can use this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|eval c=len(&amp;lt;yourdatefieldname&amp;gt;)|eval y="0".&amp;lt;yourfieldname&amp;gt;|eval x = if(c=5,y,&amp;lt;yourfieldname&amp;gt;)|eval date=strftime(strptime(x,"%m%d%y"),"%Y/%m/%d")
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 19 Oct 2018 21:21:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-change-the-format-of-this-date-field/m-p/439145#M166932</guid>
      <dc:creator>Vijeta</dc:creator>
      <dc:date>2018-10-19T21:21:43Z</dc:date>
    </item>
    <item>
      <title>Re: Can you help me change the format of this date field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-change-the-format-of-this-date-field/m-p/439146#M166933</link>
      <description>&lt;P&gt;you can append leading zero to month if it is not present.-&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|eval length=len(&amp;lt;yourfieldname&amp;gt;)|eval mon="0".&amp;lt;yourfieldname&amp;gt; |eval &amp;lt;yourfieldname&amp;gt; = if(length=5,mon,&amp;lt;yourfieldname&amp;gt;)|eval date=strftime(strptime(&amp;lt;yourfieldname&amp;gt;,"%m%d%y"),"%m/%d/%Y")
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 20 Oct 2018 06:06:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-change-the-format-of-this-date-field/m-p/439146#M166933</guid>
      <dc:creator>493669</dc:creator>
      <dc:date>2018-10-20T06:06:44Z</dc:date>
    </item>
    <item>
      <title>Re: Can you help me change the format of this date field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-change-the-format-of-this-date-field/m-p/439147#M166934</link>
      <description>&lt;P&gt;This answer worked for the leading zero.&lt;/P&gt;

&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Mon, 22 Oct 2018 14:31:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-change-the-format-of-this-date-field/m-p/439147#M166934</guid>
      <dc:creator>sheaross</dc:creator>
      <dc:date>2018-10-22T14:31:40Z</dc:date>
    </item>
  </channel>
</rss>

