<?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 show other field related to filtered out results with stats count in one query in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/how-to-show-other-field-related-to-filtered-out-results-with/m-p/531916#M150257</link>
    <description>&lt;P&gt;Hi there,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am not sure if I am missing out the obvious but I would pretty much like to be able to run stats count of a certain field and get highest10 results of that field and then be able to see other data specifically related to that 10 results.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;To be more specific, I would like to see a list of fieldA by count and with highest value something similar to this&lt;BR /&gt;i&lt;STRONG&gt;ndex=mysearch | stats count by fieldA | sort count - | head 10&amp;nbsp;&lt;/STRONG&gt;&lt;BR /&gt;but I would als like to be able to see fieldB values that are related to those ten results however if I run&amp;nbsp;&lt;BR /&gt;&lt;STRONG&gt;index=mysearch | stats count by fieldA,fieldB | sort count - | head 10&lt;/STRONG&gt; then the results for the FieldA are not the same as in the previous query&lt;/P&gt;&lt;P&gt;Just to sum it up, I would like to see the fieldB values that are related to the head 10 results of fieldA but I am not interested in seeing the stats count of both fieldA and fieldB together.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I really hope this makes sense.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Thank you in advance for your help!&lt;/P&gt;</description>
    <pubDate>Thu, 03 Dec 2020 20:16:14 GMT</pubDate>
    <dc:creator>loocayak</dc:creator>
    <dc:date>2020-12-03T20:16:14Z</dc:date>
    <item>
      <title>how to show other field related to filtered out results with stats count in one query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-show-other-field-related-to-filtered-out-results-with/m-p/531916#M150257</link>
      <description>&lt;P&gt;Hi there,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am not sure if I am missing out the obvious but I would pretty much like to be able to run stats count of a certain field and get highest10 results of that field and then be able to see other data specifically related to that 10 results.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;To be more specific, I would like to see a list of fieldA by count and with highest value something similar to this&lt;BR /&gt;i&lt;STRONG&gt;ndex=mysearch | stats count by fieldA | sort count - | head 10&amp;nbsp;&lt;/STRONG&gt;&lt;BR /&gt;but I would als like to be able to see fieldB values that are related to those ten results however if I run&amp;nbsp;&lt;BR /&gt;&lt;STRONG&gt;index=mysearch | stats count by fieldA,fieldB | sort count - | head 10&lt;/STRONG&gt; then the results for the FieldA are not the same as in the previous query&lt;/P&gt;&lt;P&gt;Just to sum it up, I would like to see the fieldB values that are related to the head 10 results of fieldA but I am not interested in seeing the stats count of both fieldA and fieldB together.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I really hope this makes sense.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Thank you in advance for your help!&lt;/P&gt;</description>
      <pubDate>Thu, 03 Dec 2020 20:16:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-show-other-field-related-to-filtered-out-results-with/m-p/531916#M150257</guid>
      <dc:creator>loocayak</dc:creator>
      <dc:date>2020-12-03T20:16:14Z</dc:date>
    </item>
    <item>
      <title>Re: how to show other field related to filtered out results with stats count in one query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-show-other-field-related-to-filtered-out-results-with/m-p/531926#M150261</link>
      <description>&lt;P&gt;First, the counts from the two searches are different because the criteria are different.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;stats count by fieldA,fieldB&lt;/LI-CODE&gt;&lt;P&gt;Does not mean "give me counts for fieldA and fieldB".&amp;nbsp; It means "give me counts for all combinations of fieldA and fieldB".&lt;/P&gt;&lt;P&gt;Second, &lt;FONT face="courier new,courier"&gt;stats&lt;/FONT&gt; is a transforming command.&amp;nbsp; That means it changes the results, specifically by dropping all fields not referenced in the command.&amp;nbsp; That's why you don't see the other data related to the 10 results.&amp;nbsp; Fix that by using either &lt;FONT face="courier new,courier"&gt;eventstats&lt;/FONT&gt; or &lt;FONT face="courier new,courier"&gt;streamstats&lt;/FONT&gt;.&lt;/P&gt;</description>
      <pubDate>Thu, 03 Dec 2020 21:41:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-show-other-field-related-to-filtered-out-results-with/m-p/531926#M150261</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2020-12-03T21:41:47Z</dc:date>
    </item>
  </channel>
</rss>

