<?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 How to get stats max count of a field by another field? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-stats-max-count-of-a-field-by-another-field/m-p/587210#M204519</link>
    <description>&lt;P&gt;Hi There, I am looking to produce an output where the field with maximum count is display based on another field.&lt;/P&gt;
&lt;P&gt;for, eg I am looking something command like&amp;nbsp;&lt;/P&gt;
&lt;P&gt;| stats max(count(errors) by status&lt;/P&gt;
&lt;P&gt;time&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;status&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;errors&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; count&lt;/P&gt;
&lt;TABLE width="408px"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="166px" height="25px"&gt;2022-03-02 05:30&lt;/TD&gt;
&lt;TD width="82px" height="25px"&gt;100&lt;/TD&gt;
&lt;TD width="114px" height="25px"&gt;not found&lt;/TD&gt;
&lt;TD width="46px" height="25px"&gt;100&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="166px" height="25px"&gt;2022-03-02 05:30&lt;/TD&gt;
&lt;TD width="82px" height="25px"&gt;200&lt;/TD&gt;
&lt;TD width="114px" height="25px"&gt;success&lt;/TD&gt;
&lt;TD width="46px" height="25px"&gt;300&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="166px" height="25px"&gt;2022-03-02 05:30&lt;/TD&gt;
&lt;TD width="82px" height="25px"&gt;300&lt;/TD&gt;
&lt;TD width="114px" height="25px"&gt;failed&lt;/TD&gt;
&lt;TD width="46px" height="25px"&gt;500&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="166px" height="25px"&gt;2022-03-02 06:30&lt;/TD&gt;
&lt;TD width="82px" height="25px"&gt;100&lt;/TD&gt;
&lt;TD width="114px" height="25px"&gt;not found&lt;/TD&gt;
&lt;TD width="46px" height="25px"&gt;400&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="166px" height="25px"&gt;2022-03-02 06:30&lt;/TD&gt;
&lt;TD width="82px" height="25px"&gt;200&lt;/TD&gt;
&lt;TD width="114px" height="25px"&gt;success&lt;/TD&gt;
&lt;TD width="46px" height="25px"&gt;500&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="166px" height="25px"&gt;2022-03-02 06:30&lt;/TD&gt;
&lt;TD width="82px" height="25px"&gt;300&lt;/TD&gt;
&lt;TD width="114px" height="25px"&gt;failed&lt;/TD&gt;
&lt;TD width="46px" height="25px"&gt;600&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="166px" height="25px"&gt;2022-03-02 07:30&lt;/TD&gt;
&lt;TD width="82px" height="25px"&gt;100&lt;/TD&gt;
&lt;TD width="114px" height="25px"&gt;not found&lt;/TD&gt;
&lt;TD width="46px" height="25px"&gt;200&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="166px" height="25px"&gt;2022-03-02 07:30&lt;/TD&gt;
&lt;TD width="82px" height="25px"&gt;200&lt;/TD&gt;
&lt;TD width="114px" height="25px"&gt;success&lt;/TD&gt;
&lt;TD width="46px" height="25px"&gt;700&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="166px" height="25px"&gt;2022-03-02 07:30&lt;/TD&gt;
&lt;TD width="82px" height="25px"&gt;300&lt;/TD&gt;
&lt;TD width="114px" height="25px"&gt;failed&lt;/TD&gt;
&lt;TD width="46px" height="25px"&gt;200&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What I am looking for is the max count each status and error&lt;/P&gt;
&lt;P&gt;time&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;status&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;errors&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; count&lt;/P&gt;
&lt;TABLE width="408px"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="166px" height="25px"&gt;2022-03-02 05:30&lt;/TD&gt;
&lt;TD width="82px" height="25px"&gt;100&lt;/TD&gt;
&lt;TD width="114px" height="25px"&gt;not found&lt;/TD&gt;
&lt;TD width="46px" height="25px"&gt;400&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="166px" height="25px"&gt;2022-03-02 06:30&lt;/TD&gt;
&lt;TD width="82px" height="25px"&gt;200&lt;/TD&gt;
&lt;TD width="114px" height="25px"&gt;success&lt;/TD&gt;
&lt;TD width="46px" height="25px"&gt;700&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="166px" height="25px"&gt;2022-03-02 07:30&lt;/TD&gt;
&lt;TD width="82px" height="25px"&gt;300&lt;/TD&gt;
&lt;TD width="114px" height="25px"&gt;failed&lt;/TD&gt;
&lt;TD width="46px" height="25px"&gt;600&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I tried many thing but with no luck, if someone could help with this.&lt;/P&gt;</description>
    <pubDate>Wed, 02 Mar 2022 23:40:08 GMT</pubDate>
    <dc:creator>bijodev1</dc:creator>
    <dc:date>2022-03-02T23:40:08Z</dc:date>
    <item>
      <title>How to get stats max count of a field by another field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-stats-max-count-of-a-field-by-another-field/m-p/587210#M204519</link>
      <description>&lt;P&gt;Hi There, I am looking to produce an output where the field with maximum count is display based on another field.&lt;/P&gt;
&lt;P&gt;for, eg I am looking something command like&amp;nbsp;&lt;/P&gt;
&lt;P&gt;| stats max(count(errors) by status&lt;/P&gt;
&lt;P&gt;time&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;status&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;errors&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; count&lt;/P&gt;
&lt;TABLE width="408px"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="166px" height="25px"&gt;2022-03-02 05:30&lt;/TD&gt;
&lt;TD width="82px" height="25px"&gt;100&lt;/TD&gt;
&lt;TD width="114px" height="25px"&gt;not found&lt;/TD&gt;
&lt;TD width="46px" height="25px"&gt;100&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="166px" height="25px"&gt;2022-03-02 05:30&lt;/TD&gt;
&lt;TD width="82px" height="25px"&gt;200&lt;/TD&gt;
&lt;TD width="114px" height="25px"&gt;success&lt;/TD&gt;
&lt;TD width="46px" height="25px"&gt;300&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="166px" height="25px"&gt;2022-03-02 05:30&lt;/TD&gt;
&lt;TD width="82px" height="25px"&gt;300&lt;/TD&gt;
&lt;TD width="114px" height="25px"&gt;failed&lt;/TD&gt;
&lt;TD width="46px" height="25px"&gt;500&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="166px" height="25px"&gt;2022-03-02 06:30&lt;/TD&gt;
&lt;TD width="82px" height="25px"&gt;100&lt;/TD&gt;
&lt;TD width="114px" height="25px"&gt;not found&lt;/TD&gt;
&lt;TD width="46px" height="25px"&gt;400&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="166px" height="25px"&gt;2022-03-02 06:30&lt;/TD&gt;
&lt;TD width="82px" height="25px"&gt;200&lt;/TD&gt;
&lt;TD width="114px" height="25px"&gt;success&lt;/TD&gt;
&lt;TD width="46px" height="25px"&gt;500&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="166px" height="25px"&gt;2022-03-02 06:30&lt;/TD&gt;
&lt;TD width="82px" height="25px"&gt;300&lt;/TD&gt;
&lt;TD width="114px" height="25px"&gt;failed&lt;/TD&gt;
&lt;TD width="46px" height="25px"&gt;600&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="166px" height="25px"&gt;2022-03-02 07:30&lt;/TD&gt;
&lt;TD width="82px" height="25px"&gt;100&lt;/TD&gt;
&lt;TD width="114px" height="25px"&gt;not found&lt;/TD&gt;
&lt;TD width="46px" height="25px"&gt;200&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="166px" height="25px"&gt;2022-03-02 07:30&lt;/TD&gt;
&lt;TD width="82px" height="25px"&gt;200&lt;/TD&gt;
&lt;TD width="114px" height="25px"&gt;success&lt;/TD&gt;
&lt;TD width="46px" height="25px"&gt;700&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="166px" height="25px"&gt;2022-03-02 07:30&lt;/TD&gt;
&lt;TD width="82px" height="25px"&gt;300&lt;/TD&gt;
&lt;TD width="114px" height="25px"&gt;failed&lt;/TD&gt;
&lt;TD width="46px" height="25px"&gt;200&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What I am looking for is the max count each status and error&lt;/P&gt;
&lt;P&gt;time&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;status&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;errors&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; count&lt;/P&gt;
&lt;TABLE width="408px"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="166px" height="25px"&gt;2022-03-02 05:30&lt;/TD&gt;
&lt;TD width="82px" height="25px"&gt;100&lt;/TD&gt;
&lt;TD width="114px" height="25px"&gt;not found&lt;/TD&gt;
&lt;TD width="46px" height="25px"&gt;400&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="166px" height="25px"&gt;2022-03-02 06:30&lt;/TD&gt;
&lt;TD width="82px" height="25px"&gt;200&lt;/TD&gt;
&lt;TD width="114px" height="25px"&gt;success&lt;/TD&gt;
&lt;TD width="46px" height="25px"&gt;700&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="166px" height="25px"&gt;2022-03-02 07:30&lt;/TD&gt;
&lt;TD width="82px" height="25px"&gt;300&lt;/TD&gt;
&lt;TD width="114px" height="25px"&gt;failed&lt;/TD&gt;
&lt;TD width="46px" height="25px"&gt;600&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I tried many thing but with no luck, if someone could help with this.&lt;/P&gt;</description>
      <pubDate>Wed, 02 Mar 2022 23:40:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-stats-max-count-of-a-field-by-another-field/m-p/587210#M204519</guid>
      <dc:creator>bijodev1</dc:creator>
      <dc:date>2022-03-02T23:40:08Z</dc:date>
    </item>
    <item>
      <title>Re: stats max count of a field by another field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-stats-max-count-of-a-field-by-another-field/m-p/587212#M204521</link>
      <description>&lt;P&gt;Try something like this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Your base search which gives fields _time status errors count
| eventstats max(count) as max by status errors
| where count=max | fields -max&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 02 Mar 2022 13:00:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-stats-max-count-of-a-field-by-another-field/m-p/587212#M204521</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2022-03-02T13:00:27Z</dc:date>
    </item>
    <item>
      <title>Re: stats max count of a field by another field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-stats-max-count-of-a-field-by-another-field/m-p/587213#M204522</link>
      <description>&lt;P&gt;It looks like there is a one-to-one relationship between status and errors, so would this work?&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| stats max(count) as count values(errors) as errors max(time) as time by status&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 02 Mar 2022 13:04:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-stats-max-count-of-a-field-by-another-field/m-p/587213#M204522</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-03-02T13:04:19Z</dc:date>
    </item>
    <item>
      <title>Re: stats max count of a field by another field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-stats-max-count-of-a-field-by-another-field/m-p/587265#M204541</link>
      <description>&lt;P&gt;thank you everyone.&lt;/P&gt;&lt;P&gt;Took me sometime , But this one worked for me&lt;/P&gt;&lt;P&gt;my search&amp;nbsp;&lt;BR /&gt;| stats count by _time status errors&lt;BR /&gt;| sort -count&lt;BR /&gt;| dedup _time status&lt;BR /&gt;| sort _time&lt;/P&gt;</description>
      <pubDate>Wed, 02 Mar 2022 16:28:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-stats-max-count-of-a-field-by-another-field/m-p/587265#M204541</guid>
      <dc:creator>bijodev1</dc:creator>
      <dc:date>2022-03-02T16:28:52Z</dc:date>
    </item>
  </channel>
</rss>

