<?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: Top X chart in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/Top-X-chart/m-p/150874#M9198</link>
    <description>&lt;P&gt;for me works as folowing.&lt;BR /&gt;
index="XXX" sourcetype="XXX" source=XXXX Host="10.*" Risk_Factor!="None" &lt;BR /&gt;
| stats cont by Risk_Factor &lt;BR /&gt;
| sort by -Risk_Factor&lt;BR /&gt;
|head 3&lt;BR /&gt;
"| some statistic"&lt;/P&gt;

&lt;P&gt;.. done, so I'm Know that I'm very late, but it works&lt;/P&gt;</description>
    <pubDate>Tue, 29 Sep 2020 16:01:15 GMT</pubDate>
    <dc:creator>ThomasControlwa</dc:creator>
    <dc:date>2020-09-29T16:01:15Z</dc:date>
    <item>
      <title>Top X chart</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Top-X-chart/m-p/150866#M9190</link>
      <description>&lt;P&gt;Hi, &lt;/P&gt;

&lt;P&gt;I'm trying to return my top 3 hosts reporting vulnerabilities, in a bar chart stacked by risk. So this means I want host A B and C, because they report say 100 entries each (as opposed to host D and E only reporting 20 each), and then I want to split each host into the Risk numbers that make up the 100.&lt;/P&gt;

&lt;P&gt;So far I have;&lt;BR /&gt;
index="XXX" sourcetype="XXX" source=&lt;EM&gt;XXXX&lt;/EM&gt; Host="10.*" Risk_Factor!="None" | chart count BY Host,Risk_Factor&lt;/P&gt;

&lt;P&gt;This gives me what I want in terms of a stacked chart showing the counts of risk, but I can't seem to return only the top 3.&lt;/P&gt;

&lt;P&gt;The search;&lt;BR /&gt;
index="XXX" sourcetype="XXX" source=&lt;EM&gt;XXXX&lt;/EM&gt; Host="10.*" Risk_Factor!="None" | top limit=3 Host | chart count BY Host,Risk_Factor&lt;/P&gt;

&lt;P&gt;seems to break the chart.&lt;/P&gt;

&lt;P&gt;Not sure what i'm doing wrong here.&lt;/P&gt;

&lt;P&gt;Any help appreciated. &lt;/P&gt;

&lt;P&gt;Thanks&lt;BR /&gt;
Derek.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 15:53:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Top-X-chart/m-p/150866#M9190</guid>
      <dc:creator>DerekKing</dc:creator>
      <dc:date>2020-09-28T15:53:18Z</dc:date>
    </item>
    <item>
      <title>Re: Top X chart</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Top-X-chart/m-p/150867#M9191</link>
      <description>&lt;P&gt;Maybe you try something like&lt;BR /&gt;
    | sort by -Risk_Factor | head 3&lt;/P&gt;</description>
      <pubDate>Fri, 14 Feb 2014 13:38:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Top-X-chart/m-p/150867#M9191</guid>
      <dc:creator>Moritz</dc:creator>
      <dc:date>2014-02-14T13:38:56Z</dc:date>
    </item>
    <item>
      <title>Re: Top X chart</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Top-X-chart/m-p/150868#M9192</link>
      <description>&lt;P&gt;Hi, &lt;/P&gt;

&lt;P&gt;No, this just gives me the first three entries that appear on the chart.&lt;/P&gt;

&lt;P&gt;Somehow I need to count the number of entries by host, then sort on that field, and then I guess chart and head&lt;/P&gt;

&lt;P&gt;It's the counting all entries by the host i'm struggling with I think....&lt;/P&gt;</description>
      <pubDate>Fri, 14 Feb 2014 14:37:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Top-X-chart/m-p/150868#M9192</guid>
      <dc:creator>DerekKing</dc:creator>
      <dc:date>2014-02-14T14:37:06Z</dc:date>
    </item>
    <item>
      <title>Re: Top X chart</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Top-X-chart/m-p/150869#M9193</link>
      <description>&lt;P&gt;How about something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="XXX" sourcetype="XXX" source=XXXX Host="10.*" Risk_Factor!="None" 
| top Risk_Factor by Host limit=3 
| fields - percent
| chart values(count) AS count by Host Risk_Factor
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 14 Feb 2014 15:11:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Top-X-chart/m-p/150869#M9193</guid>
      <dc:creator>wpreston</dc:creator>
      <dc:date>2014-02-14T15:11:40Z</dc:date>
    </item>
    <item>
      <title>Re: Top X chart</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Top-X-chart/m-p/150870#M9194</link>
      <description>&lt;P&gt;Sorry, I had it wrong in my earlier answer.  There may be a more elegant search to get what you want, but this is what I came up with.  Use a subsearch to determine the hosts that you need, then report on the Risk_Factor of those hosts:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;search index="XXX" sourcetype="XXX" source=XXXX 
[search index="XXX" sourcetype="XXX" source=XXXX Host="10.*" Risk_Factor!="None"
    | top 3 host 
    | fields host]
| chart count by Host Risk_Factor
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 14 Feb 2014 15:25:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Top-X-chart/m-p/150870#M9194</guid>
      <dc:creator>wpreston</dc:creator>
      <dc:date>2014-02-14T15:25:57Z</dc:date>
    </item>
    <item>
      <title>Re: Top X chart</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Top-X-chart/m-p/150871#M9195</link>
      <description>&lt;P&gt;Hi, thanks for the help on this. I can't believe i'm having so much trouble.. Neither are working for me unfortunately.&lt;/P&gt;

&lt;P&gt;First example gives me null back, and the second tells me that the "search will not match any events".&lt;/P&gt;</description>
      <pubDate>Fri, 14 Feb 2014 15:45:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Top-X-chart/m-p/150871#M9195</guid>
      <dc:creator>DerekKing</dc:creator>
      <dc:date>2014-02-14T15:45:35Z</dc:date>
    </item>
    <item>
      <title>Re: Top X chart</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Top-X-chart/m-p/150872#M9196</link>
      <description>&lt;P&gt;I think I made a typo in my other answer, and I can't post comments from my workplace for some reason, so here's a new answer.  The "host" in the &lt;STRONG&gt;top&lt;/STRONG&gt; and &lt;STRONG&gt;fields&lt;/STRONG&gt; commands should be capitalized. Also, your Risk_Factor should probably be included in the main search.  How about:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;search index="XXX" sourcetype="XXX" source=XXXX Risk_Factor!="None"
[search index="XXX" sourcetype="XXX" source=XXXX Host="10.*" Risk_Factor!="None"
    | top 3 Host 
    | fields Host]
| chart count by Host Risk_Factor
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 14 Feb 2014 16:10:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Top-X-chart/m-p/150872#M9196</guid>
      <dc:creator>wpreston</dc:creator>
      <dc:date>2014-02-14T16:10:12Z</dc:date>
    </item>
    <item>
      <title>Re: Top X chart</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Top-X-chart/m-p/150873#M9197</link>
      <description>&lt;P&gt;Try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="XXX" sourcetype="XXX" source=XXXX Risk_Factor!="None"
| stats count by Host Risk_Factor | sort Risk_Factor,-count | streamstats count as sno by Risk_Factor | where sno &amp;lt; 4 | fields - sno
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 14 Feb 2014 21:12:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Top-X-chart/m-p/150873#M9197</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2014-02-14T21:12:40Z</dc:date>
    </item>
    <item>
      <title>Re: Top X chart</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Top-X-chart/m-p/150874#M9198</link>
      <description>&lt;P&gt;for me works as folowing.&lt;BR /&gt;
index="XXX" sourcetype="XXX" source=XXXX Host="10.*" Risk_Factor!="None" &lt;BR /&gt;
| stats cont by Risk_Factor &lt;BR /&gt;
| sort by -Risk_Factor&lt;BR /&gt;
|head 3&lt;BR /&gt;
"| some statistic"&lt;/P&gt;

&lt;P&gt;.. done, so I'm Know that I'm very late, but it works&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 16:01:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Top-X-chart/m-p/150874#M9198</guid>
      <dc:creator>ThomasControlwa</dc:creator>
      <dc:date>2020-09-29T16:01:15Z</dc:date>
    </item>
  </channel>
</rss>

