<?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 Count number of field value per source and show as table in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Count-number-of-field-value-per-source-and-show-as-table/m-p/353418#M104619</link>
    <description>&lt;P&gt;I have a field named "router" that has multiple values and have three sources. I would like to count the router values for each source and put them in a table.&lt;/P&gt;

&lt;P&gt;So the three "source" values are syslogs, enviro and triggers and "router" have multiple values (e.g, ABCD, EFGH, KLMN). I would like to put in a table the total count of distinct "router" value for each source as shown below:&lt;/P&gt;

&lt;P&gt;router syslog enviro triggers&lt;BR /&gt;
ABCD  3  4  8&lt;BR /&gt;
EFGH   2 5 9&lt;BR /&gt;
KLMN   3 7 8&lt;/P&gt;

&lt;P&gt;thank you in advance!&lt;/P&gt;</description>
    <pubDate>Wed, 14 Mar 2018 18:30:32 GMT</pubDate>
    <dc:creator>christopheryu</dc:creator>
    <dc:date>2018-03-14T18:30:32Z</dc:date>
    <item>
      <title>Count number of field value per source and show as table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Count-number-of-field-value-per-source-and-show-as-table/m-p/353418#M104619</link>
      <description>&lt;P&gt;I have a field named "router" that has multiple values and have three sources. I would like to count the router values for each source and put them in a table.&lt;/P&gt;

&lt;P&gt;So the three "source" values are syslogs, enviro and triggers and "router" have multiple values (e.g, ABCD, EFGH, KLMN). I would like to put in a table the total count of distinct "router" value for each source as shown below:&lt;/P&gt;

&lt;P&gt;router syslog enviro triggers&lt;BR /&gt;
ABCD  3  4  8&lt;BR /&gt;
EFGH   2 5 9&lt;BR /&gt;
KLMN   3 7 8&lt;/P&gt;

&lt;P&gt;thank you in advance!&lt;/P&gt;</description>
      <pubDate>Wed, 14 Mar 2018 18:30:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Count-number-of-field-value-per-source-and-show-as-table/m-p/353418#M104619</guid>
      <dc:creator>christopheryu</dc:creator>
      <dc:date>2018-03-14T18:30:32Z</dc:date>
    </item>
    <item>
      <title>Re: Count number of field value per source and show as table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Count-number-of-field-value-per-source-and-show-as-table/m-p/353419#M104620</link>
      <description>&lt;P&gt;try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;...|stats values(router) as router values(*)as * by source
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 14 Mar 2018 18:35:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Count-number-of-field-value-per-source-and-show-as-table/m-p/353419#M104620</guid>
      <dc:creator>493669</dc:creator>
      <dc:date>2018-03-14T18:35:24Z</dc:date>
    </item>
    <item>
      <title>Re: Count number of field value per source and show as table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Count-number-of-field-value-per-source-and-show-as-table/m-p/353420#M104621</link>
      <description>&lt;P&gt;thank you for response but your suggestion showed all the fields and their values by source router.&lt;/P&gt;</description>
      <pubDate>Wed, 14 Mar 2018 19:36:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Count-number-of-field-value-per-source-and-show-as-table/m-p/353420#M104621</guid>
      <dc:creator>christopheryu</dc:creator>
      <dc:date>2018-03-14T19:36:46Z</dc:date>
    </item>
    <item>
      <title>Re: Count number of field value per source and show as table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Count-number-of-field-value-per-source-and-show-as-table/m-p/353421#M104622</link>
      <description>&lt;P&gt;this solved it:&lt;/P&gt;

&lt;P&gt;| stats count by router source | xyseries router source count&lt;/P&gt;

&lt;P&gt;but I would like to add another column that would show the total count, any suggestions?&lt;/P&gt;</description>
      <pubDate>Wed, 14 Mar 2018 19:55:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Count-number-of-field-value-per-source-and-show-as-table/m-p/353421#M104622</guid>
      <dc:creator>christopheryu</dc:creator>
      <dc:date>2018-03-14T19:55:48Z</dc:date>
    </item>
    <item>
      <title>Re: Count number of field value per source and show as table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Count-number-of-field-value-per-source-and-show-as-table/m-p/353422#M104623</link>
      <description>&lt;P&gt;@christopheryu try the following addtotals command will give you both row total and column total. You can turn off whichever you dont need by setting either &lt;CODE&gt;row=f&lt;/CODE&gt; or &lt;CODE&gt;col=f&lt;/CODE&gt; respectively. The &lt;CODE&gt;labelfield&lt;/CODE&gt; and &lt;CODE&gt;label&lt;/CODE&gt; arguments are used for column total.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;YourBaseSearch&amp;gt;
| stats count by router source
| xyseries router source count
| fillnull value=0
| addtotals row=t col=t labelfield=router label=Total
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 14 Mar 2018 20:33:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Count-number-of-field-value-per-source-and-show-as-table/m-p/353422#M104623</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2018-03-14T20:33:48Z</dc:date>
    </item>
    <item>
      <title>Re: Count number of field value per source and show as table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Count-number-of-field-value-per-source-and-show-as-table/m-p/353423#M104624</link>
      <description>&lt;P&gt;| appendcols  [search | stats count as TOTAL by router] worked by I like yours better as it is faster &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; Thank you!&lt;/P&gt;</description>
      <pubDate>Wed, 14 Mar 2018 20:53:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Count-number-of-field-value-per-source-and-show-as-table/m-p/353423#M104624</guid>
      <dc:creator>christopheryu</dc:creator>
      <dc:date>2018-03-14T20:53:57Z</dc:date>
    </item>
  </channel>
</rss>

