<?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: display cumulative total and specific group summations on chart in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/display-cumulative-total-and-specific-group-summations-on-chart/m-p/310516#M93120</link>
    <description>&lt;P&gt;I use &lt;CODE&gt;true()&lt;/CODE&gt; instead of &lt;CODE&gt;1==1&lt;/CODE&gt; because it is more clear.&lt;/P&gt;</description>
    <pubDate>Fri, 01 Dec 2017 21:29:53 GMT</pubDate>
    <dc:creator>woodcock</dc:creator>
    <dc:date>2017-12-01T21:29:53Z</dc:date>
    <item>
      <title>display cumulative total and specific group summations on chart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/display-cumulative-total-and-specific-group-summations-on-chart/m-p/310513#M93117</link>
      <description>&lt;P&gt;I have anti-virus data and I want to plot the the types of alerts on a chart over time.  I want to plot the data such that I can graphically see all virus related alerts compared to all AV alerts (to include the virus count).&lt;/P&gt;

&lt;P&gt;Using my current query, I am getting two lines on my chart, &lt;STRONG&gt;Virus&lt;/STRONG&gt; and &lt;STRONG&gt;NULL&lt;/STRONG&gt;.&lt;/P&gt;

&lt;P&gt;Does the 1=1 condition count all cases as true?  Or only all that didn't meet the previous cases?  I need a count of all alerts to include the Virus.&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;current query&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=av alert=*
| eval alert_type = case(alert="virus-adware","Virus", alert="pup-virus","Virus", alert="banking-malware","Virus", 1=1,All)
| timechart count by alert_type span=1d
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;STRONG&gt;final working query&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=av alert=*
| eval Virus= if(alert="virus-adware" OR alert="pup-virus" OR alert="banking-malware", 1,0) 
| timechart span=1d sum(Virus) as Virus count as All
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 01 Dec 2017 21:07:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/display-cumulative-total-and-specific-group-summations-on-chart/m-p/310513#M93117</guid>
      <dc:creator>DEAD_BEEF</dc:creator>
      <dc:date>2017-12-01T21:07:12Z</dc:date>
    </item>
    <item>
      <title>Re: display cumulative total and specific group summations on chart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/display-cumulative-total-and-specific-group-summations-on-chart/m-p/310514#M93118</link>
      <description>&lt;P&gt;You need to include default case value &lt;CODE&gt;All&lt;/CODE&gt; in double quotes. Without it, it's trying to assign value of field &lt;CODE&gt;All&lt;/CODE&gt; which probably doesn't exist in your data (hence NULL).&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=av alert=*
 | eval alert_type = case(alert="virus-adware","Virus", alert="pup-virus","Virus", alert="banking-malware","Virus", 1=1,"All")
 | timechart count by alert_type span=1d
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 01 Dec 2017 21:14:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/display-cumulative-total-and-specific-group-summations-on-chart/m-p/310514#M93118</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-12-01T21:14:44Z</dc:date>
    </item>
    <item>
      <title>Re: display cumulative total and specific group summations on chart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/display-cumulative-total-and-specific-group-summations-on-chart/m-p/310515#M93119</link>
      <description>&lt;P&gt;Doh!  I totally missed the quotes.  That fixed it.  Do you know if the 1=1 case is an aggregate of all or only all which do not meet previous &lt;CODE&gt;case=&lt;/CODE&gt; statements?  Reason is that I want to plot virus vs all (to include the virus count). e.g.: if it were 20 out of 100 total alerts rather than 20 and 80 other alerts.&lt;/P&gt;</description>
      <pubDate>Fri, 01 Dec 2017 21:22:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/display-cumulative-total-and-specific-group-summations-on-chart/m-p/310515#M93119</guid>
      <dc:creator>DEAD_BEEF</dc:creator>
      <dc:date>2017-12-01T21:22:15Z</dc:date>
    </item>
    <item>
      <title>Re: display cumulative total and specific group summations on chart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/display-cumulative-total-and-specific-group-summations-on-chart/m-p/310516#M93120</link>
      <description>&lt;P&gt;I use &lt;CODE&gt;true()&lt;/CODE&gt; instead of &lt;CODE&gt;1==1&lt;/CODE&gt; because it is more clear.&lt;/P&gt;</description>
      <pubDate>Fri, 01 Dec 2017 21:29:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/display-cumulative-total-and-specific-group-summations-on-chart/m-p/310516#M93120</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-12-01T21:29:53Z</dc:date>
    </item>
    <item>
      <title>Re: display cumulative total and specific group summations on chart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/display-cumulative-total-and-specific-group-summations-on-chart/m-p/310517#M93121</link>
      <description>&lt;P&gt;It'll be for all non-matching events. If you want cumulative, try this variation.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=av alert=*
  | eval Virus= if(alert="virus-adware" OR alert="pup-virus" OR alert="banking-malware", 1,0) 
  | timechart span=1d sum(Virus) as Virus count as All
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 01 Dec 2017 21:30:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/display-cumulative-total-and-specific-group-summations-on-chart/m-p/310517#M93121</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-12-01T21:30:59Z</dc:date>
    </item>
    <item>
      <title>Re: display cumulative total and specific group summations on chart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/display-cumulative-total-and-specific-group-summations-on-chart/m-p/310518#M93122</link>
      <description>&lt;P&gt;This works, thank you!&lt;/P&gt;</description>
      <pubDate>Fri, 01 Dec 2017 21:52:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/display-cumulative-total-and-specific-group-summations-on-chart/m-p/310518#M93122</guid>
      <dc:creator>DEAD_BEEF</dc:creator>
      <dc:date>2017-12-01T21:52:55Z</dc:date>
    </item>
  </channel>
</rss>

