<?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: how to change the order of display of column in stats which is grouped by &amp;quot;count by&amp;quot; in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-change-the-order-of-display-of-column-in-stats-which-is/m-p/596170#M207529</link>
    <description>&lt;P&gt;Thanks for replying but its not working for me&lt;/P&gt;</description>
    <pubDate>Mon, 02 May 2022 14:47:54 GMT</pubDate>
    <dc:creator>manimuthu</dc:creator>
    <dc:date>2022-05-02T14:47:54Z</dc:date>
    <item>
      <title>How to change the order of display of column in stats which is grouped by "count by"?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-change-the-order-of-display-of-column-in-stats-which-is/m-p/596167#M207526</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;
&lt;P&gt;My query has,&lt;/P&gt;
&lt;P&gt;.... | stats latest(time) as recent_event,latest(key) as recent_key, count by field1,field2&lt;/P&gt;
&lt;P&gt;and the output has columns (order) like&lt;/P&gt;
&lt;P&gt;field1&amp;nbsp; field2&amp;nbsp; recent_event&amp;nbsp; &amp;nbsp;recent_key&amp;nbsp; count&lt;/P&gt;
&lt;P&gt;(where count is obtained because of "count by")&lt;/P&gt;
&lt;P&gt;Is it possible to change the order of the columns&lt;/P&gt;
&lt;P&gt;recent_event&amp;nbsp; &amp;nbsp; &amp;nbsp; count&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;field1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;recent_key&amp;nbsp; &amp;nbsp; &amp;nbsp; field2&amp;nbsp; &amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 02 May 2022 16:56:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-change-the-order-of-display-of-column-in-stats-which-is/m-p/596167#M207526</guid>
      <dc:creator>manimuthu</dc:creator>
      <dc:date>2022-05-02T16:56:12Z</dc:date>
    </item>
    <item>
      <title>Re: how to change the order of display of column in stats which is grouped by "count by"</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-change-the-order-of-display-of-column-in-stats-which-is/m-p/596168#M207527</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/244409"&gt;@manimuthu&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;at the end of your search you have to add a table command, something like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Your_search
| stats latest(time) as recent_event,latest(key) as recent_key, count by field1 field2
| table recent_event count field1 recent_key field2   &lt;/LI-CODE&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Mon, 02 May 2022 14:34:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-change-the-order-of-display-of-column-in-stats-which-is/m-p/596168#M207527</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2022-05-02T14:34:53Z</dc:date>
    </item>
    <item>
      <title>Re: how to change the order of display of column in stats which is grouped by "count by"</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-change-the-order-of-display-of-column-in-stats-which-is/m-p/596170#M207529</link>
      <description>&lt;P&gt;Thanks for replying but its not working for me&lt;/P&gt;</description>
      <pubDate>Mon, 02 May 2022 14:47:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-change-the-order-of-display-of-column-in-stats-which-is/m-p/596170#M207529</guid>
      <dc:creator>manimuthu</dc:creator>
      <dc:date>2022-05-02T14:47:54Z</dc:date>
    </item>
    <item>
      <title>Re: how to change the order of display of column in stats which is grouped by "count by"</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-change-the-order-of-display-of-column-in-stats-which-is/m-p/596171#M207530</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/244409"&gt;@manimuthu&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;Why it isn't working for you, what's the limitation?&lt;/P&gt;&lt;P&gt;The only other option is to insert a row like this in the panel visualizing the search results:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;fields&amp;gt;recent_event,count,field1,recent_key,field2&amp;lt;/fields&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Mon, 02 May 2022 14:51:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-change-the-order-of-display-of-column-in-stats-which-is/m-p/596171#M207530</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2022-05-02T14:51:47Z</dc:date>
    </item>
    <item>
      <title>Re: how to change the order of display of column in stats which is grouped by "count by"</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-change-the-order-of-display-of-column-in-stats-which-is/m-p/596172#M207531</link>
      <description>&lt;P&gt;sorry i am totally new to splunk. the number of seach result differs before and after adding&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| table recent_event count field1 recent_key field2  &lt;/LI-CODE&gt;&lt;P&gt;by using "count by " the events are grouped based on field1 &amp;amp; field2 (is my understanding correct) and the count of each group is displayed by default under count column.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 02 May 2022 15:08:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-change-the-order-of-display-of-column-in-stats-which-is/m-p/596172#M207531</guid>
      <dc:creator>manimuthu</dc:creator>
      <dc:date>2022-05-02T15:08:50Z</dc:date>
    </item>
    <item>
      <title>Re: how to change the order of display of column in stats which is grouped by "count by"</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-change-the-order-of-display-of-column-in-stats-which-is/m-p/596173#M207532</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/244409"&gt;@manimuthu&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;this isn't possible, probably you're analyzing data from different time frames, if you analyze data e.g. of yesterday or one hour ago (in other words: until now), you'll have the same results, because the row I hinted to add doesn't change the results.&lt;/P&gt;&lt;P&gt;Anyway, yes, the stats command groups data by the two fields and gives the result in the count column.&lt;/P&gt;&lt;P&gt;For your knowledge, I hint to follow the Splunk Search Tutorial, to better understand how Splunk works&amp;nbsp;&lt;A href="https://docs.splunk.com/Documentation/SplunkCloud/latest/SearchTutorial/WelcometotheSearchTutorial" target="_blank"&gt;https://docs.splunk.com/Documentation/SplunkCloud/latest/SearchTutorial/WelcometotheSearchTutorial&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Mon, 02 May 2022 15:29:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-change-the-order-of-display-of-column-in-stats-which-is/m-p/596173#M207532</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2022-05-02T15:29:13Z</dc:date>
    </item>
  </channel>
</rss>

