<?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 change date/time format for field in csv lookup table in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/change-date-time-format-for-field-in-csv-lookup-table/m-p/452431#M78391</link>
    <description>&lt;P&gt;Having a bit of an issue understanding how to apply this to change the date/time format of a field from a lookup table.  The issue I am having is that when sorting by "Completion Date" the dates do not sort correct because of the format.  For example Jan/7/2019 will show higher than Jan/17/2019.  So the idea was to convert the timestamp to include a 0 (Jan/07/2019) so it sorts properly.  Any help is appreciated.&lt;/P&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/6751i0F7E6F275DECEEFA/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;It works in testing as per below, I can't get it to apply to my query:&lt;/P&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/6752i060F3BB26D598AAA/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 21 Mar 2019 18:03:27 GMT</pubDate>
    <dc:creator>DeanDeleon0</dc:creator>
    <dc:date>2019-03-21T18:03:27Z</dc:date>
    <item>
      <title>change date/time format for field in csv lookup table</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/change-date-time-format-for-field-in-csv-lookup-table/m-p/452431#M78391</link>
      <description>&lt;P&gt;Having a bit of an issue understanding how to apply this to change the date/time format of a field from a lookup table.  The issue I am having is that when sorting by "Completion Date" the dates do not sort correct because of the format.  For example Jan/7/2019 will show higher than Jan/17/2019.  So the idea was to convert the timestamp to include a 0 (Jan/07/2019) so it sorts properly.  Any help is appreciated.&lt;/P&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/6751i0F7E6F275DECEEFA/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;It works in testing as per below, I can't get it to apply to my query:&lt;/P&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/6752i060F3BB26D598AAA/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Mar 2019 18:03:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/change-date-time-format-for-field-in-csv-lookup-table/m-p/452431#M78391</guid>
      <dc:creator>DeanDeleon0</dc:creator>
      <dc:date>2019-03-21T18:03:27Z</dc:date>
    </item>
    <item>
      <title>Re: change date/time format for field in csv lookup table</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/change-date-time-format-for-field-in-csv-lookup-table/m-p/452432#M78392</link>
      <description>&lt;P&gt;You can gat the table to sort correctly by using a (hidden) sort field...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;your query here&amp;gt; | eval sortTime=strptime(YourTimeField,"YourConversion") | sort + sortTime | table your,fields,without,sortTime
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This way Splunk first sorts the events by the &lt;CODE&gt;sortTime&lt;/CODE&gt; field, which is Unix TImestamp, so in correct order, and then just not displays it. &lt;/P&gt;</description>
      <pubDate>Thu, 21 Mar 2019 18:25:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/change-date-time-format-for-field-in-csv-lookup-table/m-p/452432#M78392</guid>
      <dc:creator>DMohn</dc:creator>
      <dc:date>2019-03-21T18:25:18Z</dc:date>
    </item>
    <item>
      <title>Re: change date/time format for field in csv lookup table</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/change-date-time-format-for-field-in-csv-lookup-table/m-p/452433#M78393</link>
      <description>&lt;P&gt;Hi DMohn,&lt;/P&gt;

&lt;P&gt;It turns out,  "YourTimeField" doesn't like to work with things with spaces between.. such as "Completion Date".  I renamed it to "Completion_Date" and finally got it to work.  This helped a lot.  Thanks!&lt;/P&gt;</description>
      <pubDate>Mon, 25 Mar 2019 16:10:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/change-date-time-format-for-field-in-csv-lookup-table/m-p/452433#M78393</guid>
      <dc:creator>DeanDeleon0</dc:creator>
      <dc:date>2019-03-25T16:10:25Z</dc:date>
    </item>
    <item>
      <title>Re: change date/time format for field in csv lookup table</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/change-date-time-format-for-field-in-csv-lookup-table/m-p/452434#M78394</link>
      <description>&lt;P&gt;If you have field names with spaces in them, you need to quote the fields! Or replace the name with underscores, just as you did. And yes, in this special case, Splunk will have difficulties recognizing the former as a variable and the latter as a string.&lt;/P&gt;

&lt;P&gt;Thats why it is always a good practice to go with non-space field names, and do the conversion (remaming) at the very end!&lt;/P&gt;</description>
      <pubDate>Mon, 25 Mar 2019 16:54:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/change-date-time-format-for-field-in-csv-lookup-table/m-p/452434#M78394</guid>
      <dc:creator>DMohn</dc:creator>
      <dc:date>2019-03-25T16:54:29Z</dc:date>
    </item>
  </channel>
</rss>

