<?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: Need to display 0 if the count is 0 in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Need-to-display-0-if-the-count-is-0/m-p/196963#M187372</link>
    <description>&lt;P&gt;Use "|join type=left commonField"  instead on appendcols. Please post some sample query for full answer.&lt;/P&gt;</description>
    <pubDate>Thu, 06 Nov 2014 15:11:15 GMT</pubDate>
    <dc:creator>somesoni2</dc:creator>
    <dc:date>2014-11-06T15:11:15Z</dc:date>
    <item>
      <title>Need to display 0 if the count is 0</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-to-display-0-if-the-count-is-0/m-p/196962#M187371</link>
      <description>&lt;P&gt;i have 5 columns in my report. i am using appendcols to append columns (to get data of different time range). My report have 7 rows (static) and if the count is 0 for the second row, third row result is added into second row(so seventh row shows no data,as the count are showing in the second row even it is zero). &lt;BR /&gt;
Please help me, as i tried wilth fillnull also..&lt;/P&gt;</description>
      <pubDate>Thu, 06 Nov 2014 15:08:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-to-display-0-if-the-count-is-0/m-p/196962#M187371</guid>
      <dc:creator>harish_ka</dc:creator>
      <dc:date>2014-11-06T15:08:40Z</dc:date>
    </item>
    <item>
      <title>Re: Need to display 0 if the count is 0</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-to-display-0-if-the-count-is-0/m-p/196963#M187372</link>
      <description>&lt;P&gt;Use "|join type=left commonField"  instead on appendcols. Please post some sample query for full answer.&lt;/P&gt;</description>
      <pubDate>Thu, 06 Nov 2014 15:11:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-to-display-0-if-the-count-is-0/m-p/196963#M187372</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2014-11-06T15:11:15Z</dc:date>
    </item>
    <item>
      <title>Re: Need to display 0 if the count is 0</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-to-display-0-if-the-count-is-0/m-p/196964#M187373</link>
      <description>&lt;P&gt;index=yyy sourcetype="xxx" "org.apache.axis2.AxisFault: Read timed out" OR "188~-230~no contained exception~Exception during"  earliest=-9d@d latest=now|  rex "Major       org.apache.axis2.AxisFault: (?.&lt;EM&gt;)" | rex "188~-230~no contained exception~Exception during (?.&lt;/EM&gt;)  Error from sabre:"| |eval TimeStamp=tostring(strftime(_time,"%m/%d/%y - %H:%M:%S %p"))| stats first(TimeStamp) as "Last_Alert_Time" by Alert_Type &lt;/P&gt;

&lt;P&gt;|appendcols [search index=yyy sourcetype="xxx" "org.apache.axis2.AxisFault: Read timed out" OR "188~-230~no contained exception~Exception during"  earliest=-0d@d latest=now|  rex "Major       org.apache.axis2.AxisFault: (?.&lt;EM&gt;)" | rex "188~-230~no contained exception~Exception during (?.&lt;/EM&gt;)  Error from sabre:"|  stats count(Alert_Type) as "# of times occurred today" by Alert_Type ]&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 18:06:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-to-display-0-if-the-count-is-0/m-p/196964#M187373</guid>
      <dc:creator>harish_ka</dc:creator>
      <dc:date>2020-09-28T18:06:32Z</dc:date>
    </item>
    <item>
      <title>Re: Need to display 0 if the count is 0</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-to-display-0-if-the-count-is-0/m-p/196965#M187374</link>
      <description>&lt;P&gt;This is how my query looks...&lt;BR /&gt;
i can write a common query or for seperate appendcols result&lt;/P&gt;</description>
      <pubDate>Thu, 06 Nov 2014 15:29:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-to-display-0-if-the-count-is-0/m-p/196965#M187374</guid>
      <dc:creator>harish_ka</dc:creator>
      <dc:date>2014-11-06T15:29:48Z</dc:date>
    </item>
    <item>
      <title>Re: Need to display 0 if the count is 0</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-to-display-0-if-the-count-is-0/m-p/196966#M187375</link>
      <description>&lt;P&gt;This is how it can be done. Assuming your static Alert_Type values are Alert1, Alert2,...Alert7, then try like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| gentimes start=-1 | eval Alert_Type="Alert1, Alert2, Alert3, Alert4, Alert5, Alert6, Alert7" | table Alert_Type | makemv Alert_Type delim="," | mvexpand Alert_Type 
| join type=left Alert_Type [search index=yyy sourcetype="xxx" "org.apache.axis2.AxisFault: Read timed out" OR "188~-230~no contained exception~Exception during" earliest=-9d@d latest=now| rex "Major org.apache.axis2.AxisFault: (?.)" | rex "188~-230~no contained exception~Exception during (?.) Error from sabre:"| |eval TimeStamp=tostring(strftime(_time,"%m/%d/%y - %H:%M:%S %p"))| stats first(TimeStamp) as "Last_Alert_Time" by Alert_Type ] 
| join type=left Alert_Type [search index=yyy sourcetype="xxx" "org.apache.axis2.AxisFault: Read timed out" OR "188~-230~no contained exception~Exception during" earliest=-0d@d latest=now| rex "Major org.apache.axis2.AxisFault: (?.)" | rex "188~-230~no contained exception~Exception during (?.) Error from sabre:"| stats count(Alert_Type) as "# of times occurred today" by Alert_Type ] | join type=left Alert_Type [search index=yyy sourcetype="xxx" "org.apache.axis2.AxisFault: Read timed out" OR "188~-230~no contained exception~Exception during" earliest=-5d@d latest=now| rex "Major org.apache.axis2.AxisFault: (?.)" | rex "188~-230~no contained exception~Exception during (?.) Error from sabre:"| stats count(Alert_Type) as "# of times occurred Last 5 DAys" by Alert_Type ]
| join type=left Alert_Type [search index=yyy sourcetype="xxx" "org.apache.axis2.AxisFault: Read timed out" OR "188~-230~no contained exception~Exception during" earliest=-7d@d latest=now| rex "Major org.apache.axis2.AxisFault: (?.)" | rex "188~-230~no contained exception~Exception during (?.) Error from sabre:"| stats count(Alert_Type) as "# of times occurred Last 7 DAys" by Alert_Type ] | fillnull value=0
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 06 Nov 2014 16:24:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-to-display-0-if-the-count-is-0/m-p/196966#M187375</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2014-11-06T16:24:45Z</dc:date>
    </item>
    <item>
      <title>Re: Need to display 0 if the count is 0</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-to-display-0-if-the-count-is-0/m-p/196967#M187376</link>
      <description>&lt;P&gt;Its Working &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; Thank You So much...&lt;BR /&gt;
I replaced "appendcols" with "join type=left Alert_Type". And added " | fillnull value=0" in the end of my query to display zero.&lt;/P&gt;</description>
      <pubDate>Thu, 06 Nov 2014 19:00:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-to-display-0-if-the-count-is-0/m-p/196967#M187376</guid>
      <dc:creator>harish_ka</dc:creator>
      <dc:date>2014-11-06T19:00:57Z</dc:date>
    </item>
  </channel>
</rss>

