<?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 do  append after a |stats sum(fields) in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/how-to-do-append-after-a-stats-sum-fields/m-p/569505#M198499</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Below is my search ,&lt;/P&gt;&lt;P&gt;&amp;nbsp;index=aa sourcetype=bb|stats sum(CountOf_True) as True sum(CountOf_false) as false|table True&amp;nbsp; False |eval comp="Test1"&lt;/P&gt;&lt;P&gt;|append [|search index=cc sourcetype=dd|eval comp="Test2"]&lt;/P&gt;&lt;P&gt;|eventstats count as total_count by comp&lt;BR /&gt;|stats count(eval(Status=="True")) as True count(eval(Status=="False")) as False count(eval(Status=="Error")) as "Error" count(eval(Status=="Excluded")) as "Excluded" max(total_count) as total by comp&lt;BR /&gt;|eval "True %"=round((('True'+'Excluded')/total*100),2)&lt;BR /&gt;|eval "False %"=round((('False'+'Error')/total*100),2)&lt;/P&gt;&lt;P&gt;| sort sort_field |fields - sort_field&lt;BR /&gt;|table Comp "True %" "False %"&lt;/P&gt;&lt;P&gt;The result which is get is ,&lt;/P&gt;&lt;P&gt;Comp&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; True %&amp;nbsp; &amp;nbsp; &amp;nbsp; False %&lt;/P&gt;&lt;P&gt;Test1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0&lt;/P&gt;&lt;P&gt;Test2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;93.00&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 7.00&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have to get the actual % for Test1 too .&amp;nbsp; Iam getting "0 " .Not sure my append is wrong with stats Sum() .&lt;/P&gt;&lt;P&gt;Please can any one give me right way to get the values for the above search .&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 04 Oct 2021 06:26:03 GMT</pubDate>
    <dc:creator>dtccsundar</dc:creator>
    <dc:date>2021-10-04T06:26:03Z</dc:date>
    <item>
      <title>how to do  append after a |stats sum(fields)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-do-append-after-a-stats-sum-fields/m-p/569505#M198499</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Below is my search ,&lt;/P&gt;&lt;P&gt;&amp;nbsp;index=aa sourcetype=bb|stats sum(CountOf_True) as True sum(CountOf_false) as false|table True&amp;nbsp; False |eval comp="Test1"&lt;/P&gt;&lt;P&gt;|append [|search index=cc sourcetype=dd|eval comp="Test2"]&lt;/P&gt;&lt;P&gt;|eventstats count as total_count by comp&lt;BR /&gt;|stats count(eval(Status=="True")) as True count(eval(Status=="False")) as False count(eval(Status=="Error")) as "Error" count(eval(Status=="Excluded")) as "Excluded" max(total_count) as total by comp&lt;BR /&gt;|eval "True %"=round((('True'+'Excluded')/total*100),2)&lt;BR /&gt;|eval "False %"=round((('False'+'Error')/total*100),2)&lt;/P&gt;&lt;P&gt;| sort sort_field |fields - sort_field&lt;BR /&gt;|table Comp "True %" "False %"&lt;/P&gt;&lt;P&gt;The result which is get is ,&lt;/P&gt;&lt;P&gt;Comp&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; True %&amp;nbsp; &amp;nbsp; &amp;nbsp; False %&lt;/P&gt;&lt;P&gt;Test1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0&lt;/P&gt;&lt;P&gt;Test2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;93.00&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 7.00&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have to get the actual % for Test1 too .&amp;nbsp; Iam getting "0 " .Not sure my append is wrong with stats Sum() .&lt;/P&gt;&lt;P&gt;Please can any one give me right way to get the values for the above search .&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Oct 2021 06:26:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-do-append-after-a-stats-sum-fields/m-p/569505#M198499</guid>
      <dc:creator>dtccsundar</dc:creator>
      <dc:date>2021-10-04T06:26:03Z</dc:date>
    </item>
    <item>
      <title>Re: how to do  append after a |stats sum(fields)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-do-append-after-a-stats-sum-fields/m-p/569513#M198504</link>
      <description>&lt;P&gt;This line:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;index=aa sourcetype=bb|stats sum(CountOf_True) as True sum(CountOf_false) as false|table True&amp;nbsp; False |eval comp="Test1"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;will give you True False and comp fields&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;This line&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;|stats count(eval(Status=="True")) as True count(eval(Status=="False")) as False count(eval(Status=="Error")) as "Error" count(eval(Status=="Excluded")) as "Excluded" max(total_count) as total by comp&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;is based on the value of Status - this no longer exists for comp="Test1" which is why you are getting zeroes&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Oct 2021 07:11:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-do-append-after-a-stats-sum-fields/m-p/569513#M198504</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-10-04T07:11:09Z</dc:date>
    </item>
    <item>
      <title>Re: how to do  append after a |stats sum(fields)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-do-append-after-a-stats-sum-fields/m-p/569522#M198506</link>
      <description>&lt;P&gt;Thank you&amp;nbsp;&lt;SPAN&gt;ITWhisperer&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Is there a way to achieve this ? Whether i can create a new field Status and bring the values into that field ?&lt;/P&gt;&lt;P&gt;Please tell me if there a way available to do this too.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Oct 2021 09:21:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-do-append-after-a-stats-sum-fields/m-p/569522#M198506</guid>
      <dc:creator>dtccsundar</dc:creator>
      <dc:date>2021-10-04T09:21:58Z</dc:date>
    </item>
    <item>
      <title>Re: how to do  append after a |stats sum(fields)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-do-append-after-a-stats-sum-fields/m-p/569523#M198507</link>
      <description>&lt;P&gt;Try something like this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt; index=aa sourcetype=bb|stats sum(CountOf_True) as True sum(CountOf_false) as false|table True  False |eval comp="Test1"

|append [|search index=cc sourcetype=dd
|stats count(eval(Status=="True" OR Status=="Excluded")) as True count(eval(Status=="False" OR Status=="Error")) as False 
|eval comp="Test2"]

|eval total_count=True+False

|eval "True %"=round(100*True/total_count,2)
|eval "False %"=round(100*False/total_count,2)

|table comp "True %" "False %"&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 04 Oct 2021 09:34:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-do-append-after-a-stats-sum-fields/m-p/569523#M198507</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-10-04T09:34:10Z</dc:date>
    </item>
    <item>
      <title>Re: how to do  append after a |stats sum(fields)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-do-append-after-a-stats-sum-fields/m-p/569644#M198543</link>
      <description>&lt;P&gt;Thank you .This works great !!&lt;/P&gt;</description>
      <pubDate>Tue, 05 Oct 2021 07:22:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-do-append-after-a-stats-sum-fields/m-p/569644#M198543</guid>
      <dc:creator>dtccsundar</dc:creator>
      <dc:date>2021-10-05T07:22:58Z</dc:date>
    </item>
    <item>
      <title>Re: how to do  append after a |stats sum(fields)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-do-append-after-a-stats-sum-fields/m-p/569666#M198549</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Following this , i am in need of a column which should show barchart&amp;nbsp; for (False %&amp;nbsp; and True%) each comp values .&lt;/P&gt;&lt;P&gt;Ex :&lt;/P&gt;&lt;P&gt;Comp&amp;nbsp; &amp;nbsp;True%&amp;nbsp; &amp;nbsp;False%&amp;nbsp; &amp;nbsp;Barchart&lt;/P&gt;&lt;P&gt;&amp;nbsp;Test1&amp;nbsp; &amp;nbsp; &amp;nbsp;55&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 45&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;corresponding % bar chart&lt;/P&gt;&lt;P&gt;Test2&amp;nbsp; &amp;nbsp; &amp;nbsp;66&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 34&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;corresponding % bar chart&lt;/P&gt;&lt;P&gt;This is the requirement from client, Can you help me please .&lt;/P&gt;</description>
      <pubDate>Tue, 05 Oct 2021 10:53:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-do-append-after-a-stats-sum-fields/m-p/569666#M198549</guid>
      <dc:creator>dtccsundar</dc:creator>
      <dc:date>2021-10-05T10:53:26Z</dc:date>
    </item>
  </channel>
</rss>

