<?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: SUM of count in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-display-another-item-in-the-dashbaord-which-should-be-the/m-p/628230#M51509</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/253204"&gt;@super_edition&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;in the first search, you have to add the command addcoltotals (&lt;A href="https://docs.splunk.com/Documentation/SplunkCloud/latest/SearchReference/Addcoltotals" target="_blank"&gt;https://docs.splunk.com/Documentation/SplunkCloud/latest/SearchReference/Addcoltotals&lt;/A&gt;) at the end of the search to sum al the values:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;(index=index_1 OR index=index_2) sourcetype=openshift_logs openshift_namespace="my_ns" openshift_cluster="*" 
| spath "message.url" 
| search 
   "message.url"="/dummy/url/v1*" 
   "message.tracers.ke-channel{}"="*"
   "message.jsonObject.payments{}.products{}.type"=GROCERY 
   "message.statusCode"&amp;lt;400 
| rename "message.jsonObject.payments{}.orderStatus.status" AS "ORDER_STATUS"
| top limit=50 "ORDER_STATUS"
| addcoltotals count labelfield="ORDER_STATUS" label="Total Count"&lt;/LI-CODE&gt;&lt;P&gt;then don't use dedup when you have to make a sum of values because using dedup (as&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/129090"&gt;@manjunathmeti&lt;/a&gt;&amp;nbsp;said) you lose some values.&lt;/P&gt;&lt;P&gt;Then, don't put search terms in different search commands because in this way your search is slower: put all search terms in the same search command or (if possible) in the main search.&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
    <pubDate>Wed, 25 Jan 2023 07:27:22 GMT</pubDate>
    <dc:creator>gcusello</dc:creator>
    <dc:date>2023-01-25T07:27:22Z</dc:date>
    <item>
      <title>How to display another item in the dashbaord which should be the sum of the count?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-display-another-item-in-the-dashbaord-which-should-be-the/m-p/628221#M51507</link>
      <description>&lt;P&gt;I have following splunk query&lt;/P&gt;
&lt;P&gt;(index=index_1 OR index=index_2) sourcetype=openshift_logs openshift_namespace="my_ns" openshift_cluster="*" | spath "message.url" | search "message.url"="/dummy/url/v1*" | search "message.tracers.ke-channel{}"="*" |search "message.jsonObject.payments{}.products{}.type"=GROCERY | dedup message.tracers.ke-correlation-id{} | search "message.statusCode"&amp;lt;400 |rename "message.jsonObject.payments{}.orderStatus.status" AS "ORDER_STATUS"| top limit=50 "ORDER_STATUS"&lt;/P&gt;
&lt;P&gt;which gives the below output&lt;/P&gt;
&lt;P&gt;ORDER_STATUS count percent&lt;BR /&gt;-----------------------------------&lt;BR /&gt;PAYMENT_ACCEPTED &lt;STRONG&gt;500&lt;/STRONG&gt; 70&lt;BR /&gt;PAYMENT_PENDING &lt;STRONG&gt;100&lt;/STRONG&gt; 20&lt;BR /&gt;PAYMENT_UNDER_REVIEW &lt;STRONG&gt;90&lt;/STRONG&gt; 2&lt;BR /&gt;PAYMENT_REDIRECTION &lt;STRONG&gt;40&lt;/STRONG&gt; 1.32&lt;BR /&gt;PAYMENT_NOT_ATTEMPTED10 3.11&lt;/P&gt;
&lt;P&gt;I want to display another item in the dashbaord which should be the sum of the count of following order status:&amp;nbsp;PAYMENT_ACCEPTED+PAYMENT_PENDING+PAYMENT_UNDER_REVIEW+PAYMENT_REDIRECTION i.e&lt;/P&gt;
&lt;P&gt;500 + 100+90+40=&lt;STRONG&gt;730&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Below is my query:&lt;/P&gt;
&lt;P&gt;(index=index_1 OR index=federated:index_2) sourcetype=openshift_logs openshift_namespace="my_ns" openshift_cluster="*" | spath "message.url" | search "message.url"="/dummy/url/v1*" | search "message.tracers.ke-channel{}"="*" |search "message.jsonObject.payments{}.products{}.type"=GROCERY | search "message.statusCode"&amp;lt;400 | dedup message.jsonObject.id |search ("message.jsonObject.payments{}.orderStatus.status"="PAYMENT_ACCEPTED" OR "message.jsonObject.payments{}.orderStatus.status"="PAYMENT_PENDING" OR "message.jsonObject.payments{}.orderStatus.status"="PAYMENT_UNDER_REVIEW" OR "message.jsonObject.payments{}.orderStatus.status"="PAYMENT_REDIRECTION") | stats count(message.jsonObject.id)&lt;/P&gt;
&lt;P&gt;But the sum of the count using the above query is always more than the actual total count.&lt;/P&gt;
&lt;P&gt;Appreciate if someone can let me know where am i going wrong.&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jan 2023 16:22:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-display-another-item-in-the-dashbaord-which-should-be-the/m-p/628221#M51507</guid>
      <dc:creator>super_edition</dc:creator>
      <dc:date>2023-01-25T16:22:28Z</dc:date>
    </item>
    <item>
      <title>Re: SUM of count</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-display-another-item-in-the-dashbaord-which-should-be-the/m-p/628228#M51508</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/253204"&gt;@super_edition&lt;/a&gt;,&lt;BR /&gt;&lt;BR /&gt;Check &lt;STRONG&gt;dedup&lt;/STRONG&gt; fields in both queries, both are different:&amp;nbsp;&lt;SPAN&gt;message.tracers.ke-correlation-id{}&amp;nbsp; and&amp;nbsp;message.jsonObject.id.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jan 2023 06:34:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-display-another-item-in-the-dashbaord-which-should-be-the/m-p/628228#M51508</guid>
      <dc:creator>manjunathmeti</dc:creator>
      <dc:date>2023-01-25T06:34:01Z</dc:date>
    </item>
    <item>
      <title>Re: SUM of count</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-display-another-item-in-the-dashbaord-which-should-be-the/m-p/628230#M51509</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/253204"&gt;@super_edition&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;in the first search, you have to add the command addcoltotals (&lt;A href="https://docs.splunk.com/Documentation/SplunkCloud/latest/SearchReference/Addcoltotals" target="_blank"&gt;https://docs.splunk.com/Documentation/SplunkCloud/latest/SearchReference/Addcoltotals&lt;/A&gt;) at the end of the search to sum al the values:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;(index=index_1 OR index=index_2) sourcetype=openshift_logs openshift_namespace="my_ns" openshift_cluster="*" 
| spath "message.url" 
| search 
   "message.url"="/dummy/url/v1*" 
   "message.tracers.ke-channel{}"="*"
   "message.jsonObject.payments{}.products{}.type"=GROCERY 
   "message.statusCode"&amp;lt;400 
| rename "message.jsonObject.payments{}.orderStatus.status" AS "ORDER_STATUS"
| top limit=50 "ORDER_STATUS"
| addcoltotals count labelfield="ORDER_STATUS" label="Total Count"&lt;/LI-CODE&gt;&lt;P&gt;then don't use dedup when you have to make a sum of values because using dedup (as&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/129090"&gt;@manjunathmeti&lt;/a&gt;&amp;nbsp;said) you lose some values.&lt;/P&gt;&lt;P&gt;Then, don't put search terms in different search commands because in this way your search is slower: put all search terms in the same search command or (if possible) in the main search.&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jan 2023 07:27:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-display-another-item-in-the-dashbaord-which-should-be-the/m-p/628230#M51509</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2023-01-25T07:27:22Z</dc:date>
    </item>
  </channel>
</rss>

