<?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: _time being treated as a string when run with table command in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/time-being-treated-as-a-string-when-run-with-table-command/m-p/547252#M155157</link>
    <description>&lt;P&gt;The dates are in chronological order, just reversed. The time is shown as midnight when displayed in the event list, but all the times are just dates so splunk optimises the display as only dates are present.&lt;/P&gt;</description>
    <pubDate>Thu, 08 Apr 2021 18:28:02 GMT</pubDate>
    <dc:creator>ITWhisperer</dc:creator>
    <dc:date>2021-04-08T18:28:02Z</dc:date>
    <item>
      <title>_time being treated as a string when run with table command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/time-being-treated-as-a-string-when-run-with-table-command/m-p/547247#M155154</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have the following CSV data that I've uploaded into Splunk&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;iso_code,continent,location,date,total_cases
USA,North America,United States,2020-01-22,1.0
USA,North America,United States,2020-01-23,1.0
USA,North America,United States,2020-01-24,2.0
USA,North America,United States,2020-01-25,2.0&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My props.conf is as below&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[csv-c1]
BREAK_ONLY_BEFORE_DATE =
DATETIME_CONFIG =
INDEXED_EXTRACTIONS = csv
KV_MODE = none
LINE_BREAKER = ([\r\n]+)
NO_BINARY_CHECK = true
SHOULD_LINEMERGE = false
TIMESTAMP_FIELDS = date
TIME_FORMAT = %Y-%m-%d
category = Structured
description = Comma-separated value format. Set header and other settings in "Delimited Settings"
disabled = false
pulldown_type = true&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now, when I perform the search on this data the events are listed with the expected _time values&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="_time_field_full.PNG" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/13671i9003EB47858B337B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="_time_field_full.PNG" alt="_time_field_full.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;But when I try to create a table with _time field, it appears as if Splunk treats the _time field as a string and not as a date object. Notice that the chronological order of the dates is lost as well as the HH:MM::SS part.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="time_as_String.PNG" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/13672iDFC58E15FF510A8C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="time_as_String.PNG" alt="time_as_String.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Can someone please point out why Splunk is behaving this way ? Surprisingly if I index the same data with the current timestamp, everything works fine and _time does not lose its chronological order or its HH:MM:SS part its displayed using the table command&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Apr 2021 18:05:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/time-being-treated-as-a-string-when-run-with-table-command/m-p/547247#M155154</guid>
      <dc:creator>termcap</dc:creator>
      <dc:date>2021-04-08T18:05:29Z</dc:date>
    </item>
    <item>
      <title>Re: _time being treated as a string when run with table command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/time-being-treated-as-a-string-when-run-with-table-command/m-p/547252#M155157</link>
      <description>&lt;P&gt;The dates are in chronological order, just reversed. The time is shown as midnight when displayed in the event list, but all the times are just dates so splunk optimises the display as only dates are present.&lt;/P&gt;</description>
      <pubDate>Thu, 08 Apr 2021 18:28:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/time-being-treated-as-a-string-when-run-with-table-command/m-p/547252#M155157</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-04-08T18:28:02Z</dc:date>
    </item>
    <item>
      <title>Re: _time being treated as a string when run with table command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/time-being-treated-as-a-string-when-run-with-table-command/m-p/547260#M155161</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The latest date I have is for yesterday: 08/04/2021 and the oldest date I have is 01/01/2020. In the below screenshot you will see that dates are mixed up with 2021&amp;nbsp;dates appearing between 2020 dates.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="random_mixed.PNG" style="width: 110px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/13674i1BA85FA6259A29F4/image-size/medium?v=v2&amp;amp;px=400" role="button" title="random_mixed.PNG" alt="random_mixed.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Apr 2021 19:35:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/time-being-treated-as-a-string-when-run-with-table-command/m-p/547260#M155161</guid>
      <dc:creator>termcap</dc:creator>
      <dc:date>2021-04-08T19:35:50Z</dc:date>
    </item>
    <item>
      <title>Re: _time being treated as a string when run with table command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/time-being-treated-as-a-string-when-run-with-table-command/m-p/547338#M155193</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/161352"&gt;@gcusello&lt;/a&gt;&amp;nbsp;kindly have a look at this behavior, your comment would be highly appreciated.&lt;/P&gt;</description>
      <pubDate>Fri, 09 Apr 2021 10:33:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/time-being-treated-as-a-string-when-run-with-table-command/m-p/547338#M155193</guid>
      <dc:creator>termcap</dc:creator>
      <dc:date>2021-04-09T10:33:04Z</dc:date>
    </item>
    <item>
      <title>Re: _time being treated as a string when run with table command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/time-being-treated-as-a-string-when-run-with-table-command/m-p/547347#M155198</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/229611"&gt;@termcap&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;as&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt; said, t&lt;SPAN&gt;he dates are in chronological order, but probably in the second search they are displayed in the order of your ingestion csv file.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;You can check this analyzing your csv file, probably the order that you see in you second search is the same of the csv file.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If you want to order them, you can sort them.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If instead you use the current timestamp, obviously they will be in index order, but if you index using current time as timestamp and you display _time and timestamp, probably you'll have the _time column ordered by time and the timestamp column in the sare order of now.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Ciao.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Giuseppe&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Apr 2021 11:19:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/time-being-treated-as-a-string-when-run-with-table-command/m-p/547347#M155198</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2021-04-09T11:19:45Z</dc:date>
    </item>
    <item>
      <title>Re: _time being treated as a string when run with table command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/time-being-treated-as-a-string-when-run-with-table-command/m-p/547411#M155235</link>
      <description>&lt;P&gt;Thank you for your comments&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/161352"&gt;@gcusello&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp;Is there a way to force Splunk to display the HH:MM:SS part when using the table command ?&lt;/P&gt;</description>
      <pubDate>Fri, 09 Apr 2021 16:08:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/time-being-treated-as-a-string-when-run-with-table-command/m-p/547411#M155235</guid>
      <dc:creator>termcap</dc:creator>
      <dc:date>2021-04-09T16:08:21Z</dc:date>
    </item>
    <item>
      <title>Re: _time being treated as a string when run with table command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/time-being-treated-as-a-string-when-run-with-table-command/m-p/547412#M155236</link>
      <description>&lt;P&gt;You could try adding:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| fieldformat _time=strftime(_time,"%Y-%m-%d %H:%M:%S")&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 09 Apr 2021 16:12:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/time-being-treated-as-a-string-when-run-with-table-command/m-p/547412#M155236</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-04-09T16:12:19Z</dc:date>
    </item>
  </channel>
</rss>

