<?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: Why is the event sort not reflecting in Statistics tab? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Why-is-the-event-sort-not-reflecting-in-Statistics-tab/m-p/334707#M61879</link>
    <description>&lt;P&gt;The Events tab shows the events show in default sorting of reverse chronological (recent events first). The result in Statistics tabs are shown based on SPL that you've written. If your query generates a timestamp in string format, the string sort would be applied. Generally, we'd say to apply sorting in epoch format for accurate results and then convert to string format. More accurate suggestions can be provided if you can share you current search.&lt;/P&gt;</description>
    <pubDate>Wed, 07 Mar 2018 17:26:24 GMT</pubDate>
    <dc:creator>somesoni2</dc:creator>
    <dc:date>2018-03-07T17:26:24Z</dc:date>
    <item>
      <title>Why is the event sort not reflecting in Statistics tab?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-is-the-event-sort-not-reflecting-in-Statistics-tab/m-p/334706#M61878</link>
      <description>&lt;P&gt;I have an xml containing steps with timestamps. When I run a search, I am able to sort the events based on the timestamps I have extracted from the xml.&lt;/P&gt;

&lt;P&gt;In the &lt;STRONG&gt;Events&lt;/STRONG&gt; tab, my xml steps sort properly based on the timestamp, but when I switch to the &lt;STRONG&gt;Statistics&lt;/STRONG&gt; tab, my xml steps(events) appear in alphabetical order instead of sorting based on the timestamp.&lt;/P&gt;

&lt;P&gt;Why does the sort work when in the Events tab but not when in the Statistics tab when the search query is the same?&lt;/P&gt;

&lt;P&gt;Any help will be appreciated.&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 07 Mar 2018 17:10:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-is-the-event-sort-not-reflecting-in-Statistics-tab/m-p/334706#M61878</guid>
      <dc:creator>mawomommoh</dc:creator>
      <dc:date>2018-03-07T17:10:33Z</dc:date>
    </item>
    <item>
      <title>Re: Why is the event sort not reflecting in Statistics tab?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-is-the-event-sort-not-reflecting-in-Statistics-tab/m-p/334707#M61879</link>
      <description>&lt;P&gt;The Events tab shows the events show in default sorting of reverse chronological (recent events first). The result in Statistics tabs are shown based on SPL that you've written. If your query generates a timestamp in string format, the string sort would be applied. Generally, we'd say to apply sorting in epoch format for accurate results and then convert to string format. More accurate suggestions can be provided if you can share you current search.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Mar 2018 17:26:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-is-the-event-sort-not-reflecting-in-Statistics-tab/m-p/334707#M61879</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2018-03-07T17:26:24Z</dc:date>
    </item>
    <item>
      <title>Re: Why is the event sort not reflecting in Statistics tab?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-is-the-event-sort-not-reflecting-in-Statistics-tab/m-p/334708#M61880</link>
      <description>&lt;P&gt;This is my current search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;host=XXXX index=XXXX 
| eval NewTime=strptime(StartTime,"%Y-%m-%dT%H:%M:%S.%3N") | eval _time=NewTime 
| sort _time| eventstats max(_time) AS lastestScan by Description 
| where _time=lastestScan | stats count by Description, StepResult| eval color=case(StepResult=="Passed","green",StepResult=="Skipped","gold", StepResult=="Failed","red")
            | eval StepResult = Description
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;'StartTime' is the extracted field from the xml. It sorts fine in the Events tab but not in the Statistics tab.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Mar 2018 17:41:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-is-the-event-sort-not-reflecting-in-Statistics-tab/m-p/334708#M61880</guid>
      <dc:creator>mawomommoh</dc:creator>
      <dc:date>2018-03-07T17:41:28Z</dc:date>
    </item>
    <item>
      <title>Re: Why is the event sort not reflecting in Statistics tab?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-is-the-event-sort-not-reflecting-in-Statistics-tab/m-p/334709#M61881</link>
      <description>&lt;P&gt;You're not using _time field in your final result (in stats command). Your result will be sorted by Description and StepResult field values. Could you explain what sorting you're expecting in Statistics tab???&lt;/P&gt;</description>
      <pubDate>Wed, 07 Mar 2018 19:07:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-is-the-event-sort-not-reflecting-in-Statistics-tab/m-p/334709#M61881</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2018-03-07T19:07:24Z</dc:date>
    </item>
    <item>
      <title>Re: Why is the event sort not reflecting in Statistics tab?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-is-the-event-sort-not-reflecting-in-Statistics-tab/m-p/334710#M61882</link>
      <description>&lt;P&gt;Oh, I see. I am expecting sorting based on &lt;STRONG&gt;_time&lt;/STRONG&gt; field in the Statistics tab. How do I go about that?&lt;/P&gt;</description>
      <pubDate>Wed, 07 Mar 2018 19:12:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-is-the-event-sort-not-reflecting-in-Statistics-tab/m-p/334710#M61882</guid>
      <dc:creator>mawomommoh</dc:creator>
      <dc:date>2018-03-07T19:12:23Z</dc:date>
    </item>
    <item>
      <title>Re: Why is the event sort not reflecting in Statistics tab?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-is-the-event-sort-not-reflecting-in-Statistics-tab/m-p/334711#M61883</link>
      <description>&lt;P&gt;Try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;host=XXXX index=XXXX 
 | eval NewTime=strptime(StartTime,"%Y-%m-%dT%H:%M:%S.%3N") | eval _time=NewTime 
 | sort _time| eventstats max(_time) AS lastestScan by Description 
 | where _time=lastestScan | stats count by _time Description, StepResult| eval color=case(StepResult=="Passed","green",StepResult=="Skipped","gold", StepResult=="Failed","red")
 | eval StepResult = Description
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This will give results sorted ascending order of _time. If you want descending order, just add &lt;CODE&gt;| sort -_time&lt;/CODE&gt; in the end.&lt;/P&gt;

&lt;P&gt;Also, your last eval just overwrites value of StepResult field with value of Description field. Do you want to show two field with same value here?&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 18:15:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-is-the-event-sort-not-reflecting-in-Statistics-tab/m-p/334711#M61883</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2020-09-29T18:15:37Z</dc:date>
    </item>
    <item>
      <title>Re: Why is the event sort not reflecting in Statistics tab?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-is-the-event-sort-not-reflecting-in-Statistics-tab/m-p/334712#M61884</link>
      <description>&lt;P&gt;It worked. Thanks!&lt;/P&gt;

&lt;P&gt;Yes, based on what I am working on I need those two fields to have the same value.&lt;/P&gt;

&lt;P&gt;You can add your answer so I give you credit.&lt;/P&gt;

&lt;P&gt;Thanks for the assistance once again. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Mar 2018 19:37:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-is-the-event-sort-not-reflecting-in-Statistics-tab/m-p/334712#M61884</guid>
      <dc:creator>mawomommoh</dc:creator>
      <dc:date>2018-03-07T19:37:08Z</dc:date>
    </item>
    <item>
      <title>Re: Why is the event sort not reflecting in Statistics tab?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-is-the-event-sort-not-reflecting-in-Statistics-tab/m-p/334713#M61885</link>
      <description>&lt;P&gt;@mawomommoh - We converted @somesoni2's comment to an answer so you can accept it. &lt;/P&gt;</description>
      <pubDate>Wed, 07 Mar 2018 20:02:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-is-the-event-sort-not-reflecting-in-Statistics-tab/m-p/334713#M61885</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2018-03-07T20:02:38Z</dc:date>
    </item>
  </channel>
</rss>

