<?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 Sorting of Fields base on Timestamp in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/Sorting-of-Fields-base-on-Timestamp/m-p/46295#M2282</link>
    <description>&lt;P&gt;Hello!&lt;/P&gt;

&lt;P&gt;Im trying to sort a field based on the timestamp.&lt;/P&gt;

&lt;P&gt;This is my current search command&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=log | eval date_readable=date_mday." ".date_month | stats count by date_readable
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Using this search command, I'm able to produce the following graph in my dashboard.&lt;BR /&gt;
Graph: &lt;A href="http://i40.tinypic.com/2ai0zzn.png"&gt;http://i40.tinypic.com/2ai0zzn.png&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;However, the date is not sort in a correct sequence. Is there anyway for me to sort the &lt;EM&gt;date_readable&lt;/EM&gt; field according to timestamp?&lt;/P&gt;

&lt;P&gt;Thanks!&lt;/P&gt;</description>
    <pubDate>Mon, 26 Aug 2013 14:16:16 GMT</pubDate>
    <dc:creator>Zyon</dc:creator>
    <dc:date>2013-08-26T14:16:16Z</dc:date>
    <item>
      <title>Sorting of Fields base on Timestamp</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Sorting-of-Fields-base-on-Timestamp/m-p/46295#M2282</link>
      <description>&lt;P&gt;Hello!&lt;/P&gt;

&lt;P&gt;Im trying to sort a field based on the timestamp.&lt;/P&gt;

&lt;P&gt;This is my current search command&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=log | eval date_readable=date_mday." ".date_month | stats count by date_readable
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Using this search command, I'm able to produce the following graph in my dashboard.&lt;BR /&gt;
Graph: &lt;A href="http://i40.tinypic.com/2ai0zzn.png"&gt;http://i40.tinypic.com/2ai0zzn.png&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;However, the date is not sort in a correct sequence. Is there anyway for me to sort the &lt;EM&gt;date_readable&lt;/EM&gt; field according to timestamp?&lt;/P&gt;

&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Mon, 26 Aug 2013 14:16:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Sorting-of-Fields-base-on-Timestamp/m-p/46295#M2282</guid>
      <dc:creator>Zyon</dc:creator>
      <dc:date>2013-08-26T14:16:16Z</dc:date>
    </item>
    <item>
      <title>Re: Sorting of Fields base on Timestamp</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Sorting-of-Fields-base-on-Timestamp/m-p/46296#M2283</link>
      <description>&lt;P&gt;Well, from what it looks like in the picture, it is sorted on &lt;CODE&gt;date_readable&lt;/CODE&gt;. Unfortunately for you, &lt;CODE&gt;date_readable&lt;/CODE&gt; has no special meaning to Splunk - it's just a string.&lt;/P&gt;

&lt;P&gt;I'd suggest that you do the following instead;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=log | timechart span=1d count 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;That will sort it automatically.&lt;/P&gt;

&lt;HR /&gt;

&lt;P&gt;UPDATE:&lt;/P&gt;

&lt;P&gt;linu1988 has a point here - there is a difference between &lt;CODE&gt;_time&lt;/CODE&gt; and the &lt;CODE&gt;date_*&lt;/CODE&gt; fields. In your original search query, you used the &lt;CODE&gt;date_*&lt;/CODE&gt; fields, but the &lt;CODE&gt;timechart&lt;/CODE&gt; approach I suggested uses &lt;CODE&gt;_time&lt;/CODE&gt;.&lt;/P&gt;

&lt;P&gt;See lguinns excellent explanation here;&lt;/P&gt;

&lt;P&gt;&lt;A href="http://answers.splunk.com/answers/99451/variance-betweeen-_time-and-date_-fields"&gt;&lt;/A&gt;&lt;A href="http://answers.splunk.com/answers/99451/variance-betweeen-" target="test_blank"&gt;http://answers.splunk.com/answers/99451/variance-betweeen-&lt;/A&gt;&lt;EM&gt;time-and-date&lt;/EM&gt;-fields&lt;/P&gt;

&lt;P&gt;/K&lt;/P&gt;</description>
      <pubDate>Mon, 26 Aug 2013 14:43:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Sorting-of-Fields-base-on-Timestamp/m-p/46296#M2283</guid>
      <dc:creator>kristian_kolb</dc:creator>
      <dc:date>2013-08-26T14:43:38Z</dc:date>
    </item>
    <item>
      <title>Re: Sorting of Fields base on Timestamp</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Sorting-of-Fields-base-on-Timestamp/m-p/46297#M2284</link>
      <description>&lt;P&gt;because it's still a string not a date.&lt;/P&gt;

&lt;P&gt;Convert into time using strftime()/ convert then do a sort then chart...&lt;/P&gt;</description>
      <pubDate>Mon, 26 Aug 2013 14:56:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Sorting-of-Fields-base-on-Timestamp/m-p/46297#M2284</guid>
      <dc:creator>linu1988</dc:creator>
      <dc:date>2013-08-26T14:56:09Z</dc:date>
    </item>
    <item>
      <title>Re: Sorting of Fields base on Timestamp</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Sorting-of-Fields-base-on-Timestamp/m-p/46298#M2285</link>
      <description>&lt;P&gt;If the eventtime is matching with the log time, if not _time needs to assigned from logs then chart...&lt;/P&gt;</description>
      <pubDate>Mon, 26 Aug 2013 14:57:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Sorting-of-Fields-base-on-Timestamp/m-p/46298#M2285</guid>
      <dc:creator>linu1988</dc:creator>
      <dc:date>2013-08-26T14:57:12Z</dc:date>
    </item>
    <item>
      <title>Re: Sorting of Fields base on Timestamp</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Sorting-of-Fields-base-on-Timestamp/m-p/46299#M2286</link>
      <description>&lt;P&gt;sourcetype=log | timechart span=1d count works for me! Thanks a lot! (:&lt;/P&gt;</description>
      <pubDate>Mon, 26 Aug 2013 15:00:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Sorting-of-Fields-base-on-Timestamp/m-p/46299#M2286</guid>
      <dc:creator>Zyon</dc:creator>
      <dc:date>2013-08-26T15:00:39Z</dc:date>
    </item>
  </channel>
</rss>

