<?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: Aggregate function ignore null values in Splunk Enterprise Security</title>
    <link>https://community.splunk.com/t5/Splunk-Enterprise-Security/Aggregate-function-ignore-null-values/m-p/415937#M5015</link>
    <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/130512"&gt;@Ropermark&lt;/a&gt;, before suggesting a solution to your issue, first you should move the where clause as search filter in your main query i.e. instead of adding &lt;CODE&gt;| where like(Name, "%Unsupported%")&lt;/CODE&gt; you should use &lt;CODE&gt;Name="*Unsupported*"&lt;/CODE&gt; wildcard filter in your base query.&lt;/P&gt;

&lt;P&gt;Coming to your question if you want to bring in the series which have 0 count you can use &lt;CODE&gt;append&lt;/CODE&gt; to add dummy rows for each Risk type with count as 0. Then use a &lt;CODE&gt;dedup&lt;/CODE&gt; by Risk names to retain only one row per risk which will keep rows with count &amp;gt; 0 and missing rows with count as 0.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="iniatva_linux" Risk=Critical OR Risk=High OR Risk=Medium OR Risk=Low Name="*Unsupported*"
| chart count by Risk
| append 
    [| makeresults
    | fields - _time
    | eval data="Risk=Critical,count=0;Risk=High,count=0;Risk=Medium,count=0;Risk=Low,count=0;"
    | makemv data delim=";"
    | mvexpand data
    | rename data as _raw
    | KV
    | table Risk count]
| dedup Risk
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Following is a run anywhere search example based on Splunk's _internal index which use log_level INFO, WARN, ERROR and FATAL, similar to your request for Risk. Please try out and confirm!&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=_internal sourcetype=splunkd log_level!=INFO 
| chart count by log_level 
| append 
    [| makeresults
    | fields - _time
    | eval data="log_level=INFO,count=0;log_level=ERROR,count=0;log_level=WARN,count=0;log_level=FATAL,count=0;"
    | makemv data delim=";"
    | mvexpand data
    | rename data as _raw
    | KV
    | table log_level count]
| dedup log_level
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 29 Sep 2020 21:00:16 GMT</pubDate>
    <dc:creator>niketn</dc:creator>
    <dc:date>2020-09-29T21:00:16Z</dc:date>
    <item>
      <title>Aggregate function ignore null values</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise-Security/Aggregate-function-ignore-null-values/m-p/415936#M5014</link>
      <description>&lt;P&gt;Hello all, &lt;/P&gt;

&lt;P&gt;I am new to splunk, &lt;/P&gt;

&lt;P&gt;By following string i get a graph of risk:&lt;/P&gt;

&lt;P&gt;index="iniatva_linux" Risk=Critical OR Risk=High OR Risk=Medium OR Risk=Low |  where like(Name, "%Unsupported%") | chart count by Risk&lt;/P&gt;

&lt;P&gt;But the problem is for Risk (high, medium and low) the value is zero that why i see even see the field in graph.&lt;BR /&gt;
How i can see the field with zero value also in graph..&lt;/P&gt;

&lt;P&gt;Thanks in advance&lt;/P&gt;</description>
      <pubDate>Mon, 20 Aug 2018 14:49:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise-Security/Aggregate-function-ignore-null-values/m-p/415936#M5014</guid>
      <dc:creator>Ropermark</dc:creator>
      <dc:date>2018-08-20T14:49:06Z</dc:date>
    </item>
    <item>
      <title>Re: Aggregate function ignore null values</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise-Security/Aggregate-function-ignore-null-values/m-p/415937#M5015</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/130512"&gt;@Ropermark&lt;/a&gt;, before suggesting a solution to your issue, first you should move the where clause as search filter in your main query i.e. instead of adding &lt;CODE&gt;| where like(Name, "%Unsupported%")&lt;/CODE&gt; you should use &lt;CODE&gt;Name="*Unsupported*"&lt;/CODE&gt; wildcard filter in your base query.&lt;/P&gt;

&lt;P&gt;Coming to your question if you want to bring in the series which have 0 count you can use &lt;CODE&gt;append&lt;/CODE&gt; to add dummy rows for each Risk type with count as 0. Then use a &lt;CODE&gt;dedup&lt;/CODE&gt; by Risk names to retain only one row per risk which will keep rows with count &amp;gt; 0 and missing rows with count as 0.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="iniatva_linux" Risk=Critical OR Risk=High OR Risk=Medium OR Risk=Low Name="*Unsupported*"
| chart count by Risk
| append 
    [| makeresults
    | fields - _time
    | eval data="Risk=Critical,count=0;Risk=High,count=0;Risk=Medium,count=0;Risk=Low,count=0;"
    | makemv data delim=";"
    | mvexpand data
    | rename data as _raw
    | KV
    | table Risk count]
| dedup Risk
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Following is a run anywhere search example based on Splunk's _internal index which use log_level INFO, WARN, ERROR and FATAL, similar to your request for Risk. Please try out and confirm!&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=_internal sourcetype=splunkd log_level!=INFO 
| chart count by log_level 
| append 
    [| makeresults
    | fields - _time
    | eval data="log_level=INFO,count=0;log_level=ERROR,count=0;log_level=WARN,count=0;log_level=FATAL,count=0;"
    | makemv data delim=";"
    | mvexpand data
    | rename data as _raw
    | KV
    | table log_level count]
| dedup log_level
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 29 Sep 2020 21:00:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise-Security/Aggregate-function-ignore-null-values/m-p/415937#M5015</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2020-09-29T21:00:16Z</dc:date>
    </item>
  </channel>
</rss>

