<?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: count of a field, and then sort by day in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/count-of-a-field-and-then-sort-by-day/m-p/497213#M138501</link>
    <description>&lt;P&gt;@barneser &lt;/P&gt;

&lt;P&gt;Can you please share more details with sample output?? meanwhile can you please try this ?&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;index=profile_new | chart count(cn1) over date_mday by cs2 | sort date_mday&lt;/CODE&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 05 Dec 2019 12:12:51 GMT</pubDate>
    <dc:creator>kamlesh_vaghela</dc:creator>
    <dc:date>2019-12-05T12:12:51Z</dc:date>
    <item>
      <title>count of a field, and then sort by day</title>
      <link>https://community.splunk.com/t5/Splunk-Search/count-of-a-field-and-then-sort-by-day/m-p/497211#M138499</link>
      <description>&lt;P&gt;Im looking to count by a field and that works with first part of syntex , then sort it by date.&lt;BR /&gt;
both work independantly ,but not together.&lt;/P&gt;

&lt;P&gt;Any ideas?&lt;/P&gt;

&lt;P&gt;index=profile_new| stats count(cn1) by cs2 | stats count as daycount by date_mday&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 03:11:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/count-of-a-field-and-then-sort-by-day/m-p/497211#M138499</guid>
      <dc:creator>barneser</dc:creator>
      <dc:date>2020-09-30T03:11:31Z</dc:date>
    </item>
    <item>
      <title>Re: count of a field, and then sort by day</title>
      <link>https://community.splunk.com/t5/Splunk-Search/count-of-a-field-and-then-sort-by-day/m-p/497212#M138500</link>
      <description>&lt;P&gt;Hi @barneser,&lt;BR /&gt;
after a stats command, you have only the fields that you used in the stats command.&lt;BR /&gt;
So in your example, after the first stats command you have only count(cn1) and cs2, you haven't more date_mday or other fields.&lt;BR /&gt;
If you need another field you have to add it to stats command using values or earliest (for dates).&lt;BR /&gt;
For more infos see at &lt;A href="https://docs.splunk.com/Documentation/Splunk/8.0.0/SearchReference/Stats"&gt;https://docs.splunk.com/Documentation/Splunk/8.0.0/SearchReference/Stats&lt;/A&gt; .&lt;/P&gt;

&lt;P&gt;Anyway, if you could describe better what you want to have as result, I could help you, because I don't understand your requisite.&lt;/P&gt;

&lt;P&gt;In other words, if you run a statistic for cs2, what do you mean with "sort by date"?&lt;/P&gt;

&lt;P&gt;Ciao.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Thu, 05 Dec 2019 12:11:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/count-of-a-field-and-then-sort-by-day/m-p/497212#M138500</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2019-12-05T12:11:07Z</dc:date>
    </item>
    <item>
      <title>Re: count of a field, and then sort by day</title>
      <link>https://community.splunk.com/t5/Splunk-Search/count-of-a-field-and-then-sort-by-day/m-p/497213#M138501</link>
      <description>&lt;P&gt;@barneser &lt;/P&gt;

&lt;P&gt;Can you please share more details with sample output?? meanwhile can you please try this ?&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;index=profile_new | chart count(cn1) over date_mday by cs2 | sort date_mday&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Dec 2019 12:12:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/count-of-a-field-and-then-sort-by-day/m-p/497213#M138501</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2019-12-05T12:12:51Z</dc:date>
    </item>
  </channel>
</rss>

