<?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 with count of specific string value of all the row and all the fields in table in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Help-with-count-of-specific-string-value-of-all-the-row-and-all/m-p/232991#M69142</link>
    <description>&lt;P&gt;Please check this one - &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;base search |eval count=if(Factor1="Yes ",1,0) |eval count=count+if(Factor2="Yes ",1,0)
|eval count=count+if(Factor3="Yes ",1,0) |eval count=count+if(Factor4="Yes ",1,0) 
|eval count=count+if(Factor5="Yes ",1,0) |eval count=count+if(Factor6="Yes ",1,0) 
|table Host IP field1 Factor1 Factor2 Factor3 Factor4 Factor5 Factor6 count
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Best Regards,&lt;BR /&gt;
Sekar&lt;/P&gt;</description>
    <pubDate>Thu, 06 Oct 2016 09:47:50 GMT</pubDate>
    <dc:creator>inventsekar</dc:creator>
    <dc:date>2016-10-06T09:47:50Z</dc:date>
    <item>
      <title>Help with count of specific string value of all the row and all the fields in table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-count-of-specific-string-value-of-all-the-row-and-all/m-p/232990#M69141</link>
      <description>&lt;P&gt;Hi Team,&lt;/P&gt;

&lt;P&gt;I&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/1974i1139170EC3A52FC7/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;With reference to the screenshot, the part of the table which is highlighted in yellow is what I have and the part which is highlighted in red is what I need to add to the table.&lt;/P&gt;

&lt;P&gt;Basically, I want the count of "Yes" for each row in the Splunk table. Some fields may not contain Yes or No. So I would only be interested in all the fields which have Yes and count of it.&lt;/P&gt;

&lt;P&gt;Can anyone please guide me on how I should proceed with this?&lt;/P&gt;

&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Thu, 06 Oct 2016 09:38:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-count-of-specific-string-value-of-all-the-row-and-all/m-p/232990#M69141</guid>
      <dc:creator>ashish9433</dc:creator>
      <dc:date>2016-10-06T09:38:40Z</dc:date>
    </item>
    <item>
      <title>Re: Help with count of specific string value of all the row and all the fields in table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-count-of-specific-string-value-of-all-the-row-and-all/m-p/232991#M69142</link>
      <description>&lt;P&gt;Please check this one - &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;base search |eval count=if(Factor1="Yes ",1,0) |eval count=count+if(Factor2="Yes ",1,0)
|eval count=count+if(Factor3="Yes ",1,0) |eval count=count+if(Factor4="Yes ",1,0) 
|eval count=count+if(Factor5="Yes ",1,0) |eval count=count+if(Factor6="Yes ",1,0) 
|table Host IP field1 Factor1 Factor2 Factor3 Factor4 Factor5 Factor6 count
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Best Regards,&lt;BR /&gt;
Sekar&lt;/P&gt;</description>
      <pubDate>Thu, 06 Oct 2016 09:47:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-count-of-specific-string-value-of-all-the-row-and-all/m-p/232991#M69142</guid>
      <dc:creator>inventsekar</dc:creator>
      <dc:date>2016-10-06T09:47:50Z</dc:date>
    </item>
    <item>
      <title>Re: Help with count of specific string value of all the row and all the fields in table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-count-of-specific-string-value-of-all-the-row-and-all/m-p/232992#M69143</link>
      <description>&lt;P&gt;Try like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;base search | eval count=0 | foreach factor* [eval count=count + if(&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;="Yes", 1, 0) ] |  table factor* count | rename count AS "Count of Yes"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 06 Oct 2016 11:14:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-count-of-specific-string-value-of-all-the-row-and-all/m-p/232992#M69143</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2016-10-06T11:14:40Z</dc:date>
    </item>
    <item>
      <title>Re: Help with count of specific string value of all the row and all the fields in table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-count-of-specific-string-value-of-all-the-row-and-all/m-p/232993#M69144</link>
      <description>&lt;P&gt;Thanks, This works as required. Only there is a typo -  after base search | eval count*&lt;EM&gt;Yes&lt;/EM&gt;*, whereas it should be only count.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 11:17:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-count-of-specific-string-value-of-all-the-row-and-all/m-p/232993#M69144</guid>
      <dc:creator>ashish9433</dc:creator>
      <dc:date>2020-09-29T11:17:38Z</dc:date>
    </item>
    <item>
      <title>Re: Help with count of specific string value of all the row and all the fields in table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-count-of-specific-string-value-of-all-the-row-and-all/m-p/232994#M69145</link>
      <description>&lt;P&gt;Cool, thanks for providing this alternative. Even this works for me.&lt;/P&gt;</description>
      <pubDate>Thu, 06 Oct 2016 11:24:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-count-of-specific-string-value-of-all-the-row-and-all/m-p/232994#M69145</guid>
      <dc:creator>ashish9433</dc:creator>
      <dc:date>2016-10-06T11:24:25Z</dc:date>
    </item>
    <item>
      <title>Re: Help with count of specific string value of all the row and all the fields in table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-count-of-specific-string-value-of-all-the-row-and-all/m-p/232995#M69146</link>
      <description>&lt;P&gt;Thanks Ashish.. edited it.. &lt;/P&gt;</description>
      <pubDate>Thu, 06 Oct 2016 11:57:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-count-of-specific-string-value-of-all-the-row-and-all/m-p/232995#M69146</guid>
      <dc:creator>inventsekar</dc:creator>
      <dc:date>2016-10-06T11:57:48Z</dc:date>
    </item>
    <item>
      <title>Re: Help with count of specific string value of all the row and all the fields in table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-count-of-specific-string-value-of-all-the-row-and-all/m-p/232996#M69147</link>
      <description>&lt;P&gt;Hey Sekar, &lt;BR /&gt;
I am working on the similar use case and I am impressed with your answer. But my table has Dynamic column names  i.e Month names and I only need to use previous 3 months names like lets say we are in august then I have to show data for may, june, july. So how can I use your search to show up the month names. and also i wanted to use chart command instead of table. Below is my query I've tried and I am failing with that. I am not able to include my dashboard screenshot here. Below is how my table looks like and eventually i wanted to add those months values and show up total count in Total Column.&lt;/P&gt;

&lt;P&gt;Server_name    JUNE                   JULY              AUGUST              Total&lt;BR /&gt;
Host1                 Patched             Patched       Patched                  3&lt;BR /&gt;
host2                  NotPatched      Patched       NotPatched            1&lt;BR /&gt;
host3                 NotPatched       NotPatched NotPatched            0&lt;/P&gt;

&lt;P&gt;index="win" sourcetype="windowsupdatelog" | search "&lt;EM&gt;Deployment&lt;/EM&gt;" AND "&lt;EM&gt;AGENT_INSTALLING_SUCCEEDED&lt;/EM&gt;" &lt;BR /&gt;
| rex field=_raw "^(?:[^:\n]&lt;EM&gt;:){9}\s+(?P.+)" &lt;BR /&gt;
| eval servers = Upper(mvindex(split(host,"."),-0))&lt;BR /&gt;
| eval start=strptime(Time, "%Y-%m-%d %H:%M:%S.%N") &lt;BR /&gt;
| eval day = strftime(start, "%a") &lt;BR /&gt;
| eval month = Upper(date_month) &lt;BR /&gt;
| replace "*KB&lt;/EM&gt;" WITH "Patched" IN ApplicablePatch&lt;BR /&gt;
|eval count=if(JANUARY="Patched ",1,0) &lt;BR /&gt;
|eval count=count+if(FEBRUARY="Patched ",1,0)&lt;BR /&gt;
|eval count=count+if(MARCH="Patched ",1,0) &lt;BR /&gt;
|eval count=count+if(APRIL="Patched ",1,0)&lt;BR /&gt;
|eval count=count+if(MAY="Patched ",1,0)&lt;BR /&gt;
|eval count=count+if(JUNE="Patched ",1,0)&lt;BR /&gt;
|eval count=count+if(JULY="Patched ",1,0)&lt;BR /&gt;
|eval count=count+if(AUGUST="Patched ",1,0)&lt;BR /&gt;
|eval count=count+if(SEPTEMBER="Patched ",1,0)&lt;BR /&gt;
|eval count=count+if(OCTOBER="Patched ",1,0)&lt;BR /&gt;
|eval count=count+if(NOVEMBER="Patched ",1,0)&lt;BR /&gt;
|eval count=count+if(DECEMBER="Patched ",1,0) &lt;BR /&gt;
| stats values(ApplicablePatch) as ApplicablePatch  sum(count) as Total by servers month | mvexpand servers&lt;BR /&gt;
| chart values(ApplicablePatch) as InstalledPatch values(Total) as Totals by servers month | fillnull value="Not Patched"&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 01:41:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-count-of-specific-string-value-of-all-the-row-and-all/m-p/232996#M69147</guid>
      <dc:creator>vinaykataaig</dc:creator>
      <dc:date>2020-09-30T01:41:49Z</dc:date>
    </item>
  </channel>
</rss>

