<?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: Count and sum fourth column if second and third column are certain value and group by first column in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-count-and-sum-fourth-column-if-second-and-third-column/m-p/512800#M143844</link>
    <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/129407"&gt;@thambisetty&lt;/a&gt;&amp;nbsp; &amp;nbsp;&lt;SPAN&gt;So my data structure has four columns: "Month", "Status", "Accepted", "Value". The two things I'm trying to graph are: 1) the total values per month no matter what Status/Accepted, 2) the total values per month where "Status=Done and Accepted = Done".&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 06 Aug 2020 16:07:24 GMT</pubDate>
    <dc:creator>Username1</dc:creator>
    <dc:date>2020-08-06T16:07:24Z</dc:date>
    <item>
      <title>How to count and sum fourth column if second and third column are certain value and group by first column?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-count-and-sum-fourth-column-if-second-and-third-column/m-p/512787#M143837</link>
      <description>&lt;P&gt;So my data structure has four columns: "Month", "Status", "Accepted", "Value". As the title suggest I'm trying to determine two things: 1) the total values per month, 2) the total values per month where "Status=Done and Accepted = Done". I have the query working for the first one but I'm having difficulty with the second. Does anyone have any ideas how to do this? Thanks!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;index=index
|table Month, Status, Accepted, Value
| eval _time=strptime(scan_date,"%Y-%m-%d")
| stats sum(Value) as total_value_per_month by Month&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Aug 2020 23:35:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-count-and-sum-fourth-column-if-second-and-third-column/m-p/512787#M143837</guid>
      <dc:creator>Username1</dc:creator>
      <dc:date>2020-08-06T23:35:51Z</dc:date>
    </item>
    <item>
      <title>Re: Count and sum fourth column if second and third column are certain value and group by first column</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-count-and-sum-fourth-column-if-second-and-third-column/m-p/512791#M143839</link>
      <description>&lt;P&gt;index=index Status=Done Accepted=Done&lt;/P&gt;&lt;P&gt;| stats sum(Value) by Month&lt;/P&gt;</description>
      <pubDate>Thu, 06 Aug 2020 15:49:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-count-and-sum-fourth-column-if-second-and-third-column/m-p/512791#M143839</guid>
      <dc:creator>thambisetty</dc:creator>
      <dc:date>2020-08-06T15:49:11Z</dc:date>
    </item>
    <item>
      <title>Re: Count and sum fourth column if second and third column are certain value and group by first column</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-count-and-sum-fourth-column-if-second-and-third-column/m-p/512792#M143840</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/129407"&gt;@thambisetty&lt;/a&gt;&amp;nbsp; Thanks for responding! If i do that how will I count where Status = 'Not Done" by Month?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Aug 2020 15:52:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-count-and-sum-fourth-column-if-second-and-third-column/m-p/512792#M143840</guid>
      <dc:creator>Username1</dc:creator>
      <dc:date>2020-08-06T15:52:51Z</dc:date>
    </item>
    <item>
      <title>Re: Count and sum fourth column if second and third column are certain value and group by first column</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-count-and-sum-fourth-column-if-second-and-third-column/m-p/512794#M143841</link>
      <description>&lt;P&gt;I believe you are looking for different query?&lt;/P&gt;&lt;P&gt;If yes,&lt;/P&gt;&lt;P&gt;index=index Status=“not done”&amp;nbsp;&lt;/P&gt;&lt;P&gt;| stats sum(Value) by Month.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;up vote if it solves your problem.&lt;/P&gt;</description>
      <pubDate>Thu, 06 Aug 2020 15:57:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-count-and-sum-fourth-column-if-second-and-third-column/m-p/512794#M143841</guid>
      <dc:creator>thambisetty</dc:creator>
      <dc:date>2020-08-06T15:57:06Z</dc:date>
    </item>
    <item>
      <title>Re: Count and sum fourth column if second and third column are certain value and group by first column</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-count-and-sum-fourth-column-if-second-and-third-column/m-p/512796#M143842</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/129407"&gt;@thambisetty&lt;/a&gt;&amp;nbsp;Is there no way I can have one query? The end goal is to have a visual&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Aug 2020 15:58:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-count-and-sum-fourth-column-if-second-and-third-column/m-p/512796#M143842</guid>
      <dc:creator>Username1</dc:creator>
      <dc:date>2020-08-06T15:58:20Z</dc:date>
    </item>
    <item>
      <title>Re: Count and sum fourth column if second and third column are certain value and group by first column</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-count-and-sum-fourth-column-if-second-and-third-column/m-p/512797#M143843</link>
      <description>&lt;P&gt;Write down all your cases to combine. We need to use Case statement.&lt;/P&gt;&lt;P&gt;for example:&amp;nbsp;&lt;/P&gt;&lt;P&gt;if Status=Done Accepted=Done -&amp;gt; Done&lt;/P&gt;&lt;P&gt;if status =“Not Done” -&amp;gt; “Not Done”&lt;/P&gt;&lt;P&gt;and expected output in table format.&lt;/P&gt;</description>
      <pubDate>Thu, 06 Aug 2020 16:02:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-count-and-sum-fourth-column-if-second-and-third-column/m-p/512797#M143843</guid>
      <dc:creator>thambisetty</dc:creator>
      <dc:date>2020-08-06T16:02:45Z</dc:date>
    </item>
    <item>
      <title>Re: Count and sum fourth column if second and third column are certain value and group by first column</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-count-and-sum-fourth-column-if-second-and-third-column/m-p/512800#M143844</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/129407"&gt;@thambisetty&lt;/a&gt;&amp;nbsp; &amp;nbsp;&lt;SPAN&gt;So my data structure has four columns: "Month", "Status", "Accepted", "Value". The two things I'm trying to graph are: 1) the total values per month no matter what Status/Accepted, 2) the total values per month where "Status=Done and Accepted = Done".&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Aug 2020 16:07:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-count-and-sum-fourth-column-if-second-and-third-column/m-p/512800#M143844</guid>
      <dc:creator>Username1</dc:creator>
      <dc:date>2020-08-06T16:07:24Z</dc:date>
    </item>
    <item>
      <title>Re: Count and sum fourth column if second and third column are certain value and group by first column</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-count-and-sum-fourth-column-if-second-and-third-column/m-p/512802#M143845</link>
      <description>&lt;P&gt;index=index&lt;/P&gt;&lt;P&gt;| eval done=if(Status=“Done” AND Accepted=“Done”,”1”,”0”)&lt;/P&gt;&lt;P&gt;| stats sum(Value) as all , sum(done) as done by Month&lt;/P&gt;</description>
      <pubDate>Thu, 06 Aug 2020 16:13:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-count-and-sum-fourth-column-if-second-and-third-column/m-p/512802#M143845</guid>
      <dc:creator>thambisetty</dc:creator>
      <dc:date>2020-08-06T16:13:31Z</dc:date>
    </item>
    <item>
      <title>Re: Count and sum fourth column if second and third column are certain value and group by first column</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-count-and-sum-fourth-column-if-second-and-third-column/m-p/512812#M143847</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/129407"&gt;@thambisetty&lt;/a&gt;&amp;nbsp; I tried running that and it returned "&lt;SPAN&gt;Error in 'eval' command: The expression is malformed. An unexpected character is reached at '”1”,”0”)'."&lt;BR /&gt;&lt;BR /&gt;If I do that how would the `done`&amp;nbsp; eval be able to sum all of the Values, as Values range from .25 - 10&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Aug 2020 16:48:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-count-and-sum-fourth-column-if-second-and-third-column/m-p/512812#M143847</guid>
      <dc:creator>Username1</dc:creator>
      <dc:date>2020-08-06T16:48:18Z</dc:date>
    </item>
    <item>
      <title>Re: Count and sum fourth column if second and third column are certain value and group by first column</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-count-and-sum-fourth-column-if-second-and-third-column/m-p/512815#M143848</link>
      <description>&lt;P&gt;index=index&lt;/P&gt;&lt;P&gt;| eval done=if(Status=“Done” AND Accepted=“Done”,”1”,”0”)&lt;/P&gt;&lt;P&gt;| stats sum(Value) as all , sum(done) as done by Month&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;replace double quotes with double quotes from your key board.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;your query is not clear.&lt;/P&gt;</description>
      <pubDate>Thu, 06 Aug 2020 16:56:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-count-and-sum-fourth-column-if-second-and-third-column/m-p/512815#M143848</guid>
      <dc:creator>thambisetty</dc:creator>
      <dc:date>2020-08-06T16:56:31Z</dc:date>
    </item>
    <item>
      <title>Re: Count and sum fourth column if second and third column are certain value and group by first column</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-count-and-sum-fourth-column-if-second-and-third-column/m-p/512872#M143866</link>
      <description>&lt;P&gt;Check this and upvote if it solves your problem.&lt;/P&gt;</description>
      <pubDate>Thu, 06 Aug 2020 19:50:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-count-and-sum-fourth-column-if-second-and-third-column/m-p/512872#M143866</guid>
      <dc:creator>thambisetty</dc:creator>
      <dc:date>2020-08-06T19:50:31Z</dc:date>
    </item>
    <item>
      <title>Re: Count and sum fourth column if second and third column are certain value and group by first column</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-count-and-sum-fourth-column-if-second-and-third-column/m-p/512879#M143869</link>
      <description>&lt;LI-CODE lang="markup"&gt;index=YOURINDEX sourcetype=YOURSOURCETYPE
| stats sum(Value) as TotalValue by Month 
| append 
[ searchindex=YOURINDEX sourcetype=YOURSOURCETYPE Status="Done" Accepted="Done" 
| stats sum(Value) as TotalVal_Done by Month] 
| stats values(TotalValue) as TotalValue values(TotalVal_Done) as TotalVal_Done by Month&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 06 Aug 2020 20:11:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-count-and-sum-fourth-column-if-second-and-third-column/m-p/512879#M143869</guid>
      <dc:creator>kmorris_splunk</dc:creator>
      <dc:date>2020-08-06T20:11:06Z</dc:date>
    </item>
  </channel>
</rss>

