<?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: how to count values from a filed and show count as column in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/how-to-count-values-from-a-filed-and-show-count-as-column/m-p/504711#M140955</link>
    <description>&lt;P&gt;Try this&lt;STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="css"&gt;search query 
| eval ver=substr(av,1,4)
| chart count by date_mday ver
| addtotals fieldname="Total Count"
| addcoltotals labelfield=date_mday label="All Days"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 17 Jun 2020 05:09:40 GMT</pubDate>
    <dc:creator>DalJeanis</dc:creator>
    <dc:date>2020-06-17T05:09:40Z</dc:date>
    <item>
      <title>how to count values from a filed and show count as column</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-count-values-from-a-filed-and-show-count-as-column/m-p/504710#M140954</link>
      <description>&lt;P&gt;i am running below query to get total count by date_mday.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;STRONG&gt;search query | eval ver=substr(av,1,4) | stats count(ver) by date_mday&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;and getting results for total count by month day.&amp;nbsp;&lt;/P&gt;&lt;TABLE border="1" width="44.36026936026936%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;date_mday&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;count&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;1&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;23&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;2&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;25&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="25px"&gt;3&lt;/TD&gt;&lt;TD height="25px"&gt;35&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="25px"&gt;4&lt;/TD&gt;&lt;TD height="25px"&gt;21&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, i want the results as ver count and total count - something like&lt;/P&gt;&lt;TABLE border="1" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="16.666666666666668%"&gt;date_mday&lt;/TD&gt;&lt;TD width="16.666666666666668%"&gt;ver1234&lt;/TD&gt;&lt;TD width="16.666666666666668%"&gt;ver2345&lt;/TD&gt;&lt;TD width="16.666666666666668%"&gt;ver3456&lt;/TD&gt;&lt;TD width="16.666666666666668%"&gt;ver4567&lt;/TD&gt;&lt;TD width="16.666666666666668%"&gt;total Count&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="16.666666666666668%"&gt;1&lt;/TD&gt;&lt;TD width="16.666666666666668%"&gt;10&lt;/TD&gt;&lt;TD width="16.666666666666668%"&gt;2&lt;/TD&gt;&lt;TD width="16.666666666666668%"&gt;0&lt;/TD&gt;&lt;TD width="16.666666666666668%"&gt;11&lt;/TD&gt;&lt;TD width="16.666666666666668%"&gt;23&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="16.666666666666668%"&gt;2&lt;/TD&gt;&lt;TD width="16.666666666666668%"&gt;9&lt;/TD&gt;&lt;TD width="16.666666666666668%"&gt;5&lt;/TD&gt;&lt;TD width="16.666666666666668%"&gt;2&lt;/TD&gt;&lt;TD width="16.666666666666668%"&gt;9&lt;/TD&gt;&lt;TD width="16.666666666666668%"&gt;25&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="16.666666666666668%"&gt;3&lt;/TD&gt;&lt;TD width="16.666666666666668%"&gt;11&lt;/TD&gt;&lt;TD width="16.666666666666668%"&gt;7&lt;/TD&gt;&lt;TD width="16.666666666666668%"&gt;4&lt;/TD&gt;&lt;TD width="16.666666666666668%"&gt;13&lt;/TD&gt;&lt;TD width="16.666666666666668%"&gt;35&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;TD&gt;8&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;11&lt;/TD&gt;&lt;TD&gt;21&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Since eval (&lt;STRONG&gt;eval ver=substr(av,1,4))&lt;/STRONG&gt; is dynamically populating the values to ver - I can't use | stats count(eval()) function. Please help me out.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jun 2020 01:25:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-count-values-from-a-filed-and-show-count-as-column/m-p/504710#M140954</guid>
      <dc:creator>siddhardhans</dc:creator>
      <dc:date>2020-06-17T01:25:10Z</dc:date>
    </item>
    <item>
      <title>Re: how to count values from a filed and show count as column</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-count-values-from-a-filed-and-show-count-as-column/m-p/504711#M140955</link>
      <description>&lt;P&gt;Try this&lt;STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="css"&gt;search query 
| eval ver=substr(av,1,4)
| chart count by date_mday ver
| addtotals fieldname="Total Count"
| addcoltotals labelfield=date_mday label="All Days"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jun 2020 05:09:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-count-values-from-a-filed-and-show-count-as-column/m-p/504711#M140955</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2020-06-17T05:09:40Z</dc:date>
    </item>
    <item>
      <title>Re: how to count values from a filed and show count as column</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-count-values-from-a-filed-and-show-count-as-column/m-p/504713#M140956</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/203121"&gt;@DalJeanis&lt;/a&gt;&amp;nbsp; this is great - any suggestion to get total count on these dynamic columns?&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jun 2020 01:42:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-count-values-from-a-filed-and-show-count-as-column/m-p/504713#M140956</guid>
      <dc:creator>siddhardhans</dc:creator>
      <dc:date>2020-06-17T01:42:19Z</dc:date>
    </item>
    <item>
      <title>Re: how to count values from a filed and show count as column</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-count-values-from-a-filed-and-show-count-as-column/m-p/504728#M140962</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="css"&gt;| addtotals fieldname="Total Count"
| addcoltotals labelfield=date_mday label="All Days"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The &lt;STRONG&gt;addtotals&lt;/STRONG&gt; command will add up the totals horizontally, the &lt;STRONG&gt;addcoltotals&lt;/STRONG&gt; will add them vertically.&lt;/P&gt;&lt;P&gt;I've updated the code above to include these.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jun 2020 05:10:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-count-values-from-a-filed-and-show-count-as-column/m-p/504728#M140962</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2020-06-17T05:10:14Z</dc:date>
    </item>
    <item>
      <title>Re: how to count values from a filed and show count as column</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-count-values-from-a-filed-and-show-count-as-column/m-p/504820#M140990</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/203121"&gt;@DalJeanis&lt;/a&gt;&amp;nbsp;- thank you so much - i am able to see the table the way i needed.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jun 2020 15:45:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-count-values-from-a-filed-and-show-count-as-column/m-p/504820#M140990</guid>
      <dc:creator>siddhardhans</dc:creator>
      <dc:date>2020-06-17T15:45:09Z</dc:date>
    </item>
  </channel>
</rss>

