<?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 find count for each field value? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-count-for-each-field-value/m-p/431235#M171699</link>
    <description>&lt;P&gt;Events:&lt;/P&gt;

&lt;P&gt;SEVERITY=5,  INCIDENT=INC1929283737&lt;/P&gt;

&lt;P&gt;Command&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="_internal" component=root OR component=Metrics OR eventtype=splunkd-log OR eventtype=splunkd-access SEVERITY=* INCIDENT=*  | stats count(eval(component="Metrics")) as Metrics_count, count(eval(component="root")) as Root_count, count(eval(eventtype="splunkd-log")) as Splunkd_log_count, count(eval(eventtype="splunkd-access")) as Splunkd_access_count
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I want to pull &lt;CODE&gt;# of incident&lt;/CODE&gt; and &lt;CODE&gt;severity&lt;/CODE&gt;, when &lt;CODE&gt;component=root OR component=Metrics OR eventtype=splunkd-log OR eventtype=splunkd-access&lt;/CODE&gt; .... basically it should show, what is &lt;CODE&gt;severity&lt;/CODE&gt; and &lt;CODE&gt;incident&lt;/CODE&gt; in table for &lt;CODE&gt;root&lt;/CODE&gt;:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;root severity incident  Metrics severity incident splunkd-log severity incident
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 25 Apr 2019 04:33:23 GMT</pubDate>
    <dc:creator>rakesh44</dc:creator>
    <dc:date>2019-04-25T04:33:23Z</dc:date>
    <item>
      <title>How to find count for each field value?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-count-for-each-field-value/m-p/431235#M171699</link>
      <description>&lt;P&gt;Events:&lt;/P&gt;

&lt;P&gt;SEVERITY=5,  INCIDENT=INC1929283737&lt;/P&gt;

&lt;P&gt;Command&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="_internal" component=root OR component=Metrics OR eventtype=splunkd-log OR eventtype=splunkd-access SEVERITY=* INCIDENT=*  | stats count(eval(component="Metrics")) as Metrics_count, count(eval(component="root")) as Root_count, count(eval(eventtype="splunkd-log")) as Splunkd_log_count, count(eval(eventtype="splunkd-access")) as Splunkd_access_count
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I want to pull &lt;CODE&gt;# of incident&lt;/CODE&gt; and &lt;CODE&gt;severity&lt;/CODE&gt;, when &lt;CODE&gt;component=root OR component=Metrics OR eventtype=splunkd-log OR eventtype=splunkd-access&lt;/CODE&gt; .... basically it should show, what is &lt;CODE&gt;severity&lt;/CODE&gt; and &lt;CODE&gt;incident&lt;/CODE&gt; in table for &lt;CODE&gt;root&lt;/CODE&gt;:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;root severity incident  Metrics severity incident splunkd-log severity incident
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 25 Apr 2019 04:33:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-find-count-for-each-field-value/m-p/431235#M171699</guid>
      <dc:creator>rakesh44</dc:creator>
      <dc:date>2019-04-25T04:33:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to find count for each field value?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-count-for-each-field-value/m-p/431236#M171700</link>
      <description>&lt;P&gt;@rakesh44 &lt;BR /&gt;
Didn't get your proper requirement:&lt;/P&gt;

&lt;P&gt;something like this can work for you:&lt;BR /&gt;
     index="_internal" component=root OR component=Metrics OR eventtype=splunkd-log OR eventtype=splunkd-access SEVERITY=* INCIDENT=*  | stats values(SEVERITY), count(INCIDENT) by component&lt;/P&gt;

&lt;P&gt;if you by both fields i.e. component and eventtype, then use coalesce to convert them into a single field and then use it in stats.&lt;/P&gt;</description>
      <pubDate>Thu, 25 Apr 2019 07:35:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-find-count-for-each-field-value/m-p/431236#M171700</guid>
      <dc:creator>vishaltaneja070</dc:creator>
      <dc:date>2019-04-25T07:35:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to find count for each field value?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-count-for-each-field-value/m-p/431237#M171701</link>
      <description>&lt;P&gt;You could try a search like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="_internal" component=root OR component=Metrics OR eventtype=splunkd-log OR eventtype=splunkd-access SEVERITY=* INCIDENT=*  | eval type=case(component="Metrics","Metrics",component="root","Root",eventtype="splunkd-log","Splunkd-Log",eventtype="splunkd-access","Splunkd-Access",1=1,"other") | stats count by type severity | xyseries type severity count
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This would give you a table like such:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;                  Severity 1      Severity 2    ....
Metrics           1               2
Root              5
Splunkd-Log       6               8
Splunkd-Access                    3
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 25 Apr 2019 08:59:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-find-count-for-each-field-value/m-p/431237#M171701</guid>
      <dc:creator>DMohn</dc:creator>
      <dc:date>2019-04-25T08:59:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to find count for each field value?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-count-for-each-field-value/m-p/431238#M171702</link>
      <description>&lt;P&gt;Thanks for quick reply unfortunately your command did not worked. Below is my requirement&lt;/P&gt;

&lt;P&gt;I have one field called components and under these i have value, root, splunkd_log, metrics and splunkd-access. I have field incident =INC12335 and severity=5 in events.&lt;/P&gt;

&lt;P&gt;I want to find how many Incident  with severity are raised when component=slunkd_log and component=metrics and component=splunkd-access. &lt;/P&gt;

&lt;P&gt;Basically it should show how many Incident with severity is there for when  component=slunkd_log &lt;/P&gt;

&lt;P&gt;Basically it should show how many Incident with severity is there for when component=metrics &lt;/P&gt;

&lt;P&gt;Basically it should show how many Incident with severity is there for when component=splunkd-access. &lt;/P&gt;

&lt;P&gt;Basically it should show how many Incident with severity is there for when component=root&lt;/P&gt;</description>
      <pubDate>Thu, 25 Apr 2019 09:59:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-find-count-for-each-field-value/m-p/431238#M171702</guid>
      <dc:creator>rakesh44</dc:creator>
      <dc:date>2019-04-25T09:59:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to find count for each field value?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-count-for-each-field-value/m-p/431239#M171703</link>
      <description>&lt;P&gt;Thanks for quick reply unfortunately your command did not worked. Below is my requirement&lt;/P&gt;

&lt;P&gt;I have one field called components and under these i have value, root, splunkd_log, metrics and splunkd-access. I have field incident =INC12335 and severity=5 in events.&lt;/P&gt;

&lt;P&gt;I want to find how many Incident  with severity are raised when component=slunkd_log and component=metrics and component=splunkd-access. &lt;/P&gt;

&lt;P&gt;Basically it should show how many Incident with severity is there for when  component=slunkd_log &lt;/P&gt;

&lt;P&gt;Basically it should show how many Incident with severity is there for when component=metrics &lt;/P&gt;

&lt;P&gt;Basically it should show how many Incident with severity is there for when component=splunkd-access. &lt;/P&gt;

&lt;P&gt;Basically it should show how many Incident with severity is there for when component=root&lt;/P&gt;</description>
      <pubDate>Thu, 25 Apr 2019 10:00:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-find-count-for-each-field-value/m-p/431239#M171703</guid>
      <dc:creator>rakesh44</dc:creator>
      <dc:date>2019-04-25T10:00:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to find count for each field value?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-count-for-each-field-value/m-p/431240#M171704</link>
      <description>&lt;P&gt;Okay, if you have a field &lt;CODE&gt;component&lt;/CODE&gt; in your events, you can use a this search command:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;your base search&amp;gt; | stats count by component, severity
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This will give you a overview that will look somehow like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;component    severity    count   
splunkd_log  5           1
splunkd_log  2           4
metrics      5           2
metrics      4           3
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;To format this table in a sort of matrix-like view, you may use the &lt;CODE&gt;xyseries&lt;/CODE&gt; command: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| xyseries component severity count
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;[...]`&lt;/P&gt;</description>
      <pubDate>Thu, 25 Apr 2019 11:34:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-find-count-for-each-field-value/m-p/431240#M171704</guid>
      <dc:creator>DMohn</dc:creator>
      <dc:date>2019-04-25T11:34:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to find count for each field value?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-count-for-each-field-value/m-p/431241#M171705</link>
      <description>&lt;P&gt;index="_internal" component=root OR component=Metrics OR eventtype=splunkd-log OR eventtype=splunkd-access SEVERITY=* INCIDENT=*  | stats count by component, severity&lt;/P&gt;

&lt;P&gt;index="_internal" component=root OR component=Metrics OR eventtype=splunkd-log OR eventtype=splunkd-access SEVERITY=* INCIDENT=*  | xyseries component severity count&lt;/P&gt;</description>
      <pubDate>Thu, 25 Apr 2019 12:27:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-find-count-for-each-field-value/m-p/431241#M171705</guid>
      <dc:creator>rakesh44</dc:creator>
      <dc:date>2019-04-25T12:27:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to find count for each field value?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-count-for-each-field-value/m-p/431242#M171706</link>
      <description>&lt;P&gt;index="_internal" component=root OR component=Metrics OR eventtype=splunkd-log OR eventtype=splunkd-access SEVERITY= INCIDENT= | stats count by component, severity | xyseries component severity count&lt;/P&gt;</description>
      <pubDate>Thu, 25 Apr 2019 12:31:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-find-count-for-each-field-value/m-p/431242#M171706</guid>
      <dc:creator>DMohn</dc:creator>
      <dc:date>2019-04-25T12:31:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to find count for each field value?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-count-for-each-field-value/m-p/431243#M171707</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;My requirement:

component         Incident          Severity               count
root
Metrics
splunkd_log 
splunkd-access
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 25 Apr 2019 12:32:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-find-count-for-each-field-value/m-p/431243#M171707</guid>
      <dc:creator>rakesh44</dc:creator>
      <dc:date>2019-04-25T12:32:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to find count for each field value?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-count-for-each-field-value/m-p/431244#M171708</link>
      <description>&lt;P&gt;Wait, what sould be the result in the incident row? A count? An incident identifier?&lt;/P&gt;</description>
      <pubDate>Thu, 25 Apr 2019 12:36:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-find-count-for-each-field-value/m-p/431244#M171708</guid>
      <dc:creator>DMohn</dc:creator>
      <dc:date>2019-04-25T12:36:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to find count for each field value?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-count-for-each-field-value/m-p/431245#M171709</link>
      <description>&lt;P&gt;Incident and severity  is required ( count is not imp ) &lt;/P&gt;</description>
      <pubDate>Thu, 25 Apr 2019 12:43:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-find-count-for-each-field-value/m-p/431245#M171709</guid>
      <dc:creator>rakesh44</dc:creator>
      <dc:date>2019-04-25T12:43:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to find count for each field value?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-count-for-each-field-value/m-p/431246#M171710</link>
      <description>&lt;P&gt;The &lt;CODE&gt;stats&lt;/CODE&gt; command is multi-value-friendly so you can just do this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="_internal" AND (component IN("root", "Metrics") OR eventtype IN("splunkd-log", "splunkd-access")) AND SEVERITY=* AND INCIDENT=*
| eval component=mvappend(component, eventtype)
| stats count BY component SEVERITY INCIDENT
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 26 Apr 2019 03:51:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-find-count-for-each-field-value/m-p/431246#M171710</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-04-26T03:51:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to find count for each field value?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-count-for-each-field-value/m-p/431247#M171711</link>
      <description>&lt;P&gt;I have removed Incident and severity from command and checked, but its giving all fields of component not specific one.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="_internal" AND (component IN("root", "Metrics") OR eventtype IN("splunkd-log", "splunkd-access"))
| eval component=mvappend(component, eventtype)
| stats count BY component
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 26 Apr 2019 04:03:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-find-count-for-each-field-value/m-p/431247#M171711</guid>
      <dc:creator>rakesh44</dc:creator>
      <dc:date>2019-04-26T04:03:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to find count for each field value?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-count-for-each-field-value/m-p/431248#M171712</link>
      <description>&lt;P&gt;given command did not worked but below command worked with one issue&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=_internal component=Metrics OR component=root OR eventtype=splunkd-log OR eventtype=splunkd-access
| stats count(eval(component="root")) as root_count,count(eval(component="Metrics")) as "metrics_count", count(eval(eventtype="splunkd-log")) as splunkd-log_count, count(eval(eventtype="splunkd-access")) as splunkd-access-count
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Not it should show incident related to &lt;CODE&gt;component=root, eventtype=splunkd-log, eventtype=splunkd-access&lt;/CODE&gt;, but it is showing some extra Incident which is not related to above fields&lt;/P&gt;</description>
      <pubDate>Fri, 26 Apr 2019 04:19:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-find-count-for-each-field-value/m-p/431248#M171712</guid>
      <dc:creator>rakesh44</dc:creator>
      <dc:date>2019-04-26T04:19:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to find count for each field value?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-count-for-each-field-value/m-p/431249#M171713</link>
      <description>&lt;P&gt;It should look exactly like your given example in the comment of one of the other answers.  Show me what it is giving now, then show me what you would like it to show.&lt;/P&gt;</description>
      <pubDate>Fri, 26 Apr 2019 04:35:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-find-count-for-each-field-value/m-p/431249#M171713</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-04-26T04:35:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to find count for each field value?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-count-for-each-field-value/m-p/431250#M171714</link>
      <description>&lt;P&gt;Are we speaking the same language?&lt;/P&gt;</description>
      <pubDate>Fri, 26 Apr 2019 04:38:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-find-count-for-each-field-value/m-p/431250#M171714</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-04-26T04:38:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to find count for each field value?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-count-for-each-field-value/m-p/431251#M171715</link>
      <description>&lt;P&gt;Hi woodcock, I got solution thanks for all your effort&lt;/P&gt;

&lt;P&gt;index="_internal" component=root OR component=Metrics OR eventtype=splunkd-log OR eventtype=splunkd-access  | stats count(eval(component="Metrics")) as Metrics_count, count(eval(component="root")) as Root_count, count(eval(eventtype="splunkd-log")) as Splunkd_log_count, count(eval(eventtype="splunkd-access")) as Splunkd_access_count by INCIDENT,SEVERITY&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 00:15:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-find-count-for-each-field-value/m-p/431251#M171715</guid>
      <dc:creator>rakesh44</dc:creator>
      <dc:date>2020-09-30T00:15:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to find count for each field value?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-count-for-each-field-value/m-p/431252#M171716</link>
      <description>&lt;P&gt;Below is the appropriate command&lt;/P&gt;

&lt;P&gt;index="_internal" component=root OR component=Metrics OR eventtype=splunkd-log OR eventtype=splunkd-access  | stats count(eval(component="Metrics")) as Metrics_count, count(eval(component="root")) as Root_count, count(eval(eventtype="splunkd-log")) as Splunkd_log_count, count(eval(eventtype="splunkd-access")) as Splunkd_access_count by sourcetype, Incident&lt;IMG src="https://community.splunk.com/storage/temp/271158-screen-shot-2019-04-26-at-121952-pm.png" alt="alt text" /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 00:15:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-find-count-for-each-field-value/m-p/431252#M171716</guid>
      <dc:creator>rakesh44</dc:creator>
      <dc:date>2020-09-30T00:15:12Z</dc:date>
    </item>
  </channel>
</rss>

