<?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: Issue using sort command with inputlookup command in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Issue-using-sort-command-with-inputlookup-command/m-p/546824#M155020</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/28050"&gt;@sdkp03&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;Since TIMESTAMP values are string , in order to be sort as time you need to change to epoc or %Y%m%d%H%M%S. Epoc is easier for your case, please try below;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| inputlookup test.csv 
| eval timestamp=strptime(TIMESTAMP,"%d%m%y %H:%M:%S")
| sort - timestamp
| fields - timestamp&lt;/LI-CODE&gt;</description>
    <pubDate>Tue, 06 Apr 2021 09:04:42 GMT</pubDate>
    <dc:creator>scelikok</dc:creator>
    <dc:date>2021-04-06T09:04:42Z</dc:date>
    <item>
      <title>Issue using sort command with inputlookup command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Issue-using-sort-command-with-inputlookup-command/m-p/546822#M155019</link>
      <description>&lt;P&gt;I have a lookup file with 3 fields - source, status, timestamp.&amp;nbsp; Timestamp is saved as per below:&lt;/P&gt;&lt;P&gt;eval timestamp=strftime(_time,"%d%m%y %H:%M:%S")&lt;/P&gt;&lt;P&gt;Sample data:&lt;/P&gt;&lt;P&gt;ABC, 1, 20/03/21 04:45:46&lt;/P&gt;&lt;P&gt;ABC, 0, 27/03/21 11:17:31&lt;/P&gt;&lt;P&gt;ABC, 1, 29/03/21 14:33:06&lt;/P&gt;&lt;P&gt;ABC, 0, 01/04/21 12:56:41&lt;/P&gt;&lt;P&gt;Search query I am using is - | inputlookup test.csv | sort -TIMESTAMP&lt;/P&gt;&lt;P&gt;result as below:&lt;/P&gt;&lt;P&gt;ABC, 1, 29/03/21 14:33:06&lt;BR /&gt;ABC, 0, 27/03/21 11:17:31&lt;BR /&gt;ABC, 1, 20/03/21 04:45:46&lt;BR /&gt;ABC, 0, 01/04/21 12:56:41&lt;/P&gt;&lt;P&gt;and when I use query - |inputlookup test.csv | sort TIMESTAMP&lt;/P&gt;&lt;P&gt;ABC, 0, 01/04/21 12:56:41&lt;BR /&gt;ABC, 1, 20/03/21 04:45:46&lt;BR /&gt;ABC, 0, 27/03/21 11:17:31&lt;BR /&gt;ABC, 1, 29/03/21 14:33:06&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is weird because sort is happening just based on date! I am not even able to use eval on TIMESTAMP field(result is always empty). Have tried addinfo, where timestamp&amp;gt;now-xxx with no luck.&lt;/P&gt;</description>
      <pubDate>Tue, 06 Apr 2021 08:55:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Issue-using-sort-command-with-inputlookup-command/m-p/546822#M155019</guid>
      <dc:creator>sdkp03</dc:creator>
      <dc:date>2021-04-06T08:55:55Z</dc:date>
    </item>
    <item>
      <title>Re: Issue using sort command with inputlookup command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Issue-using-sort-command-with-inputlookup-command/m-p/546824#M155020</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/28050"&gt;@sdkp03&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;Since TIMESTAMP values are string , in order to be sort as time you need to change to epoc or %Y%m%d%H%M%S. Epoc is easier for your case, please try below;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| inputlookup test.csv 
| eval timestamp=strptime(TIMESTAMP,"%d%m%y %H:%M:%S")
| sort - timestamp
| fields - timestamp&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 06 Apr 2021 09:04:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Issue-using-sort-command-with-inputlookup-command/m-p/546824#M155020</guid>
      <dc:creator>scelikok</dc:creator>
      <dc:date>2021-04-06T09:04:42Z</dc:date>
    </item>
    <item>
      <title>Re: Issue using sort command with inputlookup command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Issue-using-sort-command-with-inputlookup-command/m-p/546849#M155030</link>
      <description>&lt;P class="lia-align-left"&gt;What he said above.... However, if you want to display the timestamp in Human readable then I would do a&amp;nbsp;&lt;/P&gt;&lt;P class="lia-align-left"&gt;| sort -timestamp&lt;/P&gt;&lt;P class="lia-align-left"&gt;| table TIMESTAMP&lt;/P&gt;</description>
      <pubDate>Tue, 06 Apr 2021 11:21:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Issue-using-sort-command-with-inputlookup-command/m-p/546849#M155030</guid>
      <dc:creator>Funderburg78</dc:creator>
      <dc:date>2021-04-06T11:21:08Z</dc:date>
    </item>
    <item>
      <title>Re: Issue using sort command with inputlookup command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Issue-using-sort-command-with-inputlookup-command/m-p/546953#M155054</link>
      <description>&lt;P&gt;As posted in the description eval on TIMESTAMP isn't working. Please see below attached snapshot, eval timestamp is blank.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="downloads.jpg" style="width: 999px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/13646i41EDD4B7778DF61E/image-size/large?v=v2&amp;amp;px=999" role="button" title="downloads.jpg" alt="downloads.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Apr 2021 01:03:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Issue-using-sort-command-with-inputlookup-command/m-p/546953#M155054</guid>
      <dc:creator>sdkp03</dc:creator>
      <dc:date>2021-04-07T01:03:05Z</dc:date>
    </item>
    <item>
      <title>Re: Issue using sort command with inputlookup command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Issue-using-sort-command-with-inputlookup-command/m-p/546956#M155055</link>
      <description>&lt;P&gt;Not sure I can see the image perfectly but are you doing&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;strptime(TIMESTAMP, "%d%m%y...")&lt;/LI-CODE&gt;&lt;P&gt;If so, you are missing the / character in your dates between day month year&lt;/P&gt;&lt;P&gt;Also, reiterating the others, whenever dealing with dates, use epoch for calculations or if using strings, always use %F %T (shorthand for %Y-%m-%d %H:%M:%S) as that will give you consistency if having to treat them as strings&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Apr 2021 01:52:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Issue-using-sort-command-with-inputlookup-command/m-p/546956#M155055</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2021-04-07T01:52:16Z</dc:date>
    </item>
    <item>
      <title>Re: Issue using sort command with inputlookup command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Issue-using-sort-command-with-inputlookup-command/m-p/546962#M155058</link>
      <description>&lt;P&gt;Missing / was the issue. Thanks for pointing that out. Its working as expected now &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Apr 2021 03:23:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Issue-using-sort-command-with-inputlookup-command/m-p/546962#M155058</guid>
      <dc:creator>sdkp03</dc:creator>
      <dc:date>2021-04-07T03:23:28Z</dc:date>
    </item>
  </channel>
</rss>

