<?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: help on stats(dc) command in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/help-on-stats-dc-command/m-p/418542#M171808</link>
    <description>&lt;P&gt;it doesnt works&lt;BR /&gt;
I have always different events for a same host when an host has many process_name &amp;gt;80%&lt;BR /&gt;
index=x" sourcetype="perfmonmk:process" process_name=* process_cpu_used_percent&amp;gt;80 &lt;BR /&gt;
| stats dc(host) &lt;/P&gt;

&lt;P&gt;I just want to count 1 event when an host has one or many process_name &amp;gt;80%&lt;BR /&gt;
could you help me please?&lt;/P&gt;</description>
    <pubDate>Wed, 30 Sep 2020 00:06:40 GMT</pubDate>
    <dc:creator>jip31</dc:creator>
    <dc:date>2020-09-30T00:06:40Z</dc:date>
    <item>
      <title>help on stats(dc) command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/help-on-stats-dc-command/m-p/418539#M171805</link>
      <description>&lt;P&gt;hello&lt;/P&gt;

&lt;P&gt;I use the search below in order to display cpu using is &amp;gt; to 80% by host and by process-name&lt;BR /&gt;
So a same host can have many process where cpu using is &amp;gt; to 80%&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="x" sourcetype="y" process_name=* 
| where process_cpu_used_percent&amp;gt;80 
| table host process_name process_cpu_used_percent
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Now I need to count the number of host which have a process_name using more than 80% of CPU&lt;BR /&gt;
If the same host has many process &amp;gt; to 80% I want to count only one host&lt;BR /&gt;
I dont succeed to do this&lt;BR /&gt;
could you help me please??&lt;/P&gt;</description>
      <pubDate>Wed, 17 Apr 2019 13:35:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/help-on-stats-dc-command/m-p/418539#M171805</guid>
      <dc:creator>jip31</dc:creator>
      <dc:date>2019-04-17T13:35:02Z</dc:date>
    </item>
    <item>
      <title>Re: help on stats(dc) command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/help-on-stats-dc-command/m-p/418540#M171806</link>
      <description>&lt;P&gt;The distinct count function of stat should help with this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; index="x" sourcetype="y" process_cpu_used_percent&amp;gt;80
| stats dc(host) as unique_hosts
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;A href="https://docs.splunk.com/Documentation/Splunk/7.2.5/SearchReference/Stats"&gt;https://docs.splunk.com/Documentation/Splunk/7.2.5/SearchReference/Stats&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Apr 2019 13:57:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/help-on-stats-dc-command/m-p/418540#M171806</guid>
      <dc:creator>pkeenan87</dc:creator>
      <dc:date>2019-04-17T13:57:44Z</dc:date>
    </item>
    <item>
      <title>Re: help on stats(dc) command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/help-on-stats-dc-command/m-p/418541#M171807</link>
      <description>&lt;P&gt;@jip31 - Can you please share sample data and expected sample output .&lt;/P&gt;</description>
      <pubDate>Wed, 17 Apr 2019 14:49:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/help-on-stats-dc-command/m-p/418541#M171807</guid>
      <dc:creator>Vijeta</dc:creator>
      <dc:date>2019-04-17T14:49:53Z</dc:date>
    </item>
    <item>
      <title>Re: help on stats(dc) command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/help-on-stats-dc-command/m-p/418542#M171808</link>
      <description>&lt;P&gt;it doesnt works&lt;BR /&gt;
I have always different events for a same host when an host has many process_name &amp;gt;80%&lt;BR /&gt;
index=x" sourcetype="perfmonmk:process" process_name=* process_cpu_used_percent&amp;gt;80 &lt;BR /&gt;
| stats dc(host) &lt;/P&gt;

&lt;P&gt;I just want to count 1 event when an host has one or many process_name &amp;gt;80%&lt;BR /&gt;
could you help me please?&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 00:06:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/help-on-stats-dc-command/m-p/418542#M171808</guid>
      <dc:creator>jip31</dc:creator>
      <dc:date>2020-09-30T00:06:40Z</dc:date>
    </item>
    <item>
      <title>Re: help on stats(dc) command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/help-on-stats-dc-command/m-p/418543#M171809</link>
      <description>&lt;P&gt;@jip31 Not exactly sure what you looking for but can you try below. Also what is the final output you need host field and count or more fields ?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;  index="x" sourcetype="y" process_cpu_used_percent&amp;gt;80|stats count by host
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 17 Apr 2019 17:15:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/help-on-stats-dc-command/m-p/418543#M171809</guid>
      <dc:creator>Vijeta</dc:creator>
      <dc:date>2019-04-17T17:15:20Z</dc:date>
    </item>
  </channel>
</rss>

