<?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: Unable to set stats count value as 0 in case of 0 events for a particular day in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Unable-to-set-stats-count-value-as-0-in-case-of-0-events-for-a/m-p/217458#M63876</link>
    <description>&lt;P&gt;Append this to the end of your search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | append [gentimes start=-8 end=1 | eval _time = starttime | eval Requests = 0 | where _time &amp;gt;= relative_time(now(), if(lower(strftime(now(),"%A"))="monday", "-3d@d", "-1d@d"))]
| stats max(Requests) as Requests by _time
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This will generate a week's worth of "today, requests are zero" events, filter down to the days you need, and the &lt;CODE&gt;max()&lt;/CODE&gt; will display the real request counts if there are any.&lt;/P&gt;</description>
    <pubDate>Sat, 31 Dec 2016 02:49:55 GMT</pubDate>
    <dc:creator>martin_mueller</dc:creator>
    <dc:date>2016-12-31T02:49:55Z</dc:date>
    <item>
      <title>Unable to set stats count value as 0 in case of 0 events for a particular day</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Unable-to-set-stats-count-value-as-0-in-case-of-0-events-for-a/m-p/217457#M63875</link>
      <description>&lt;P&gt;Hello,&lt;BR /&gt;
a&lt;BR /&gt;
In my search query below, I am unable to set the value of stats count as 0 in case there are no events for today or on previous day, i am getting NA as output in&lt;BR /&gt;
splunk, I am trying to plot a single unit output which will show a trend between today and yesterday with % trend.&lt;/P&gt;

&lt;P&gt;Can you guys pls help&lt;/P&gt;

&lt;P&gt;[| gentimes start=-1 &lt;BR /&gt;
  | eval earliest=if(lower(strftime(now(),"%A"))="monday", "-3d@d", "-1d@d") &lt;BR /&gt;
  | eval latest=if(lower(strftime(now(),"%A"))="monday","-3d@s", "-1d@s")&lt;BR /&gt;
  | table earliest, latest | format "" "" "" "" "" ""]  index=yy sourcetype=zz&lt;BR /&gt;
  | search "xx"&lt;BR /&gt;
  | spath output=OpName path=payload.gpmGenerateEventLogs.gpmGenerateEventLog{}.operationName&lt;BR /&gt;
  | spath output=EvType path=payload.gpmGenerateEventLogs.gpmGenerateEventLog{}.eventTypeCode&lt;BR /&gt;
  | spath output=state path=payload.gpmGenerateEventLogs.gpmGenerateEventLog{}.state&lt;BR /&gt;
  | spath output=Line_Count path=payload.gpmGenerateEventLogs.gpmGenerateEventLog{}.recordCount&lt;BR /&gt;
  | spath output=Org_Code path=payload.gpmGenerateEventLogs.gpmGenerateEventLog{}.attribute1&lt;BR /&gt;
  | spath output=TimeZone path=payload.gpmGenerateEventLogs.gpmGenerateEventLog{}.attribute2&lt;BR /&gt;
  | spath output=ccpath=payload.gpmGenerateEventLogs.gpmGenerateEventLog{}.attribute3&lt;BR /&gt;
  | eval combined=mvzip(mvzip(mvzip(mvzip(mvzip(mvzip(OpName,EvType),state),Line_Count),Org_Code),TimeZone),cc)&lt;BR /&gt;
  | mvexpand combined|eval combined=split(combined,",")&lt;BR /&gt;
  | eval  OpName=mvindex(combined,0)&lt;BR /&gt;
  | eval  EvType=mvindex(combined,1)&lt;BR /&gt;
  | eval state=mvindex(combined,2)&lt;BR /&gt;
  | eval Line_Count=mvindex(combined,3)&lt;BR /&gt;
  | eval Org_Code =mvindex(combined,4)&lt;BR /&gt;
  | eval TimeZone =mvindex(combined,5)&lt;BR /&gt;
  | eval cc=mvindex(combined,6)&lt;BR /&gt;
  | where OpName="abc"|append&lt;BR /&gt;
  [search earliest=@d   index=yy sourcetype=zz&lt;BR /&gt;
  | search "xx"&lt;BR /&gt;
  | spath output=OpName path=payload.gpmGenerateEventLogs.gpmGenerateEventLog{}.operationName&lt;BR /&gt;
  | spath output=EvType path=payload.gpmGenerateEventLogs.gpmGenerateEventLog{}.eventTypeCode&lt;BR /&gt;
  | spath output=state path=payload.gpmGenerateEventLogs.gpmGenerateEventLog{}.state&lt;BR /&gt;
  | spath output=Line_Count path=payload.gpmGenerateEventLogs.gpmGenerateEventLog{}.recordCount&lt;BR /&gt;
  | spath output=Org_Code path=payload.gpmGenerateEventLogs.gpmGenerateEventLog{}.attribute1&lt;BR /&gt;
  | spath output=TimeZone path=payload.gpmGenerateEventLogs.gpmGenerateEventLog{}.attribute2&lt;BR /&gt;
  | spath output=CDC_RDC path=payload.gpmGenerateEventLogs.gpmGenerateEventLog{}.attribute3&lt;BR /&gt;
  | eval combined=mvzip(mvzip(mvzip(mvzip(mvzip(mvzip(OpName,EvType),state),Line_Count),Org_Code),TimeZone),CDC_RDC)&lt;BR /&gt;
  | mvexpand combined&lt;BR /&gt;
  | eval combined=split(combined,",")&lt;BR /&gt;
  | eval  OpName=mvindex(combined,0)&lt;BR /&gt;
  | eval  EvType=mvindex(combined,1)&lt;BR /&gt;
  | eval state=mvindex(combined,2)&lt;BR /&gt;
  | eval Line_Count=mvindex(combined,3)&lt;BR /&gt;
  | eval Org_Code =mvindex(combined,4)&lt;BR /&gt;
  | eval TimeZone =mvindex(combined,5)&lt;BR /&gt;
  | eval cc=mvindex(combined,6)&lt;BR /&gt;
  | where OpName="abc"]&lt;BR /&gt;
  | bucket _time span=1d&lt;BR /&gt;
  | stats sum(Line_Count) AS Requests by _time&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 12:17:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Unable-to-set-stats-count-value-as-0-in-case-of-0-events-for-a/m-p/217457#M63875</guid>
      <dc:creator>avaishsplunk</dc:creator>
      <dc:date>2020-09-29T12:17:01Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to set stats count value as 0 in case of 0 events for a particular day</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Unable-to-set-stats-count-value-as-0-in-case-of-0-events-for-a/m-p/217458#M63876</link>
      <description>&lt;P&gt;Append this to the end of your search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | append [gentimes start=-8 end=1 | eval _time = starttime | eval Requests = 0 | where _time &amp;gt;= relative_time(now(), if(lower(strftime(now(),"%A"))="monday", "-3d@d", "-1d@d"))]
| stats max(Requests) as Requests by _time
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This will generate a week's worth of "today, requests are zero" events, filter down to the days you need, and the &lt;CODE&gt;max()&lt;/CODE&gt; will display the real request counts if there are any.&lt;/P&gt;</description>
      <pubDate>Sat, 31 Dec 2016 02:49:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Unable-to-set-stats-count-value-as-0-in-case-of-0-events-for-a/m-p/217458#M63876</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2016-12-31T02:49:55Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to set stats count value as 0 in case of 0 events for a particular day</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Unable-to-set-stats-count-value-as-0-in-case-of-0-events-for-a/m-p/217459#M63877</link>
      <description>&lt;P&gt;Hello Martin,&lt;/P&gt;

&lt;P&gt;Thanks for your reply, sorry i am still not able to figure out the correct SPL for my need, i apologise for the same, but my need is that if i compare today and yesterdays events and if both the days have 0 events then i should get output like &lt;/P&gt;

&lt;P&gt;date                requests&lt;BR /&gt;
29-12-2016  0&lt;BR /&gt;
30-12-2016  0&lt;/P&gt;

&lt;P&gt;Can you pls help me with this&lt;/P&gt;</description>
      <pubDate>Sat, 31 Dec 2016 03:16:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Unable-to-set-stats-count-value-as-0-in-case-of-0-events-for-a/m-p/217459#M63877</guid>
      <dc:creator>avaishsplunk</dc:creator>
      <dc:date>2016-12-31T03:16:50Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to set stats count value as 0 in case of 0 events for a particular day</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Unable-to-set-stats-count-value-as-0-in-case-of-0-events-for-a/m-p/217460#M63878</link>
      <description>&lt;P&gt;To see if we're on the right track, leave off the &lt;CODE&gt;where&lt;/CODE&gt; and see if you get the empty days added correctly.&lt;/P&gt;</description>
      <pubDate>Sat, 31 Dec 2016 12:09:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Unable-to-set-stats-count-value-as-0-in-case-of-0-events-for-a/m-p/217460#M63878</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2016-12-31T12:09:49Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to set stats count value as 0 in case of 0 events for a particular day</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Unable-to-set-stats-count-value-as-0-in-case-of-0-events-for-a/m-p/217461#M63879</link>
      <description>&lt;P&gt;Hello Martin,&lt;/P&gt;

&lt;P&gt;The days are getting added but I am seeing an issue with that also, there are 2 parts in my query, first one gives me event details for yesterday and second one gives me details for today both.&lt;/P&gt;

&lt;P&gt;When the days are added since we are doing gentimes -1, i only get days added till yesterday like when i tried i was getting from 12-22-2016 to 12-29-2016, i was not getting the day from 12-23-2016 to 12-30-2016 which i don't think is going to work&lt;/P&gt;

&lt;P&gt;Regards&lt;/P&gt;</description>
      <pubDate>Sat, 31 Dec 2016 16:22:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Unable-to-set-stats-count-value-as-0-in-case-of-0-events-for-a/m-p/217461#M63879</guid>
      <dc:creator>avaishsplunk</dc:creator>
      <dc:date>2016-12-31T16:22:56Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to set stats count value as 0 in case of 0 events for a particular day</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Unable-to-set-stats-count-value-as-0-in-case-of-0-events-for-a/m-p/217462#M63880</link>
      <description>&lt;P&gt;That's why my answer doesn't use &lt;CODE&gt;start=-1&lt;/CODE&gt;, it generates more days.&lt;/P&gt;</description>
      <pubDate>Sat, 31 Dec 2016 16:25:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Unable-to-set-stats-count-value-as-0-in-case-of-0-events-for-a/m-p/217462#M63880</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2016-12-31T16:25:40Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to set stats count value as 0 in case of 0 events for a particular day</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Unable-to-set-stats-count-value-as-0-in-case-of-0-events-for-a/m-p/217463#M63881</link>
      <description>&lt;P&gt;Hello Martin,&lt;/P&gt;

&lt;P&gt;Yeah even if I do gentimes start = -8 its the same it does not add events for today it always goes a day back.&lt;/P&gt;

&lt;P&gt;Regards,&lt;/P&gt;</description>
      <pubDate>Sat, 31 Dec 2016 16:39:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Unable-to-set-stats-count-value-as-0-in-case-of-0-events-for-a/m-p/217463#M63881</guid>
      <dc:creator>avaishsplunk</dc:creator>
      <dc:date>2016-12-31T16:39:41Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to set stats count value as 0 in case of 0 events for a particular day</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Unable-to-set-stats-count-value-as-0-in-case-of-0-events-for-a/m-p/217464#M63882</link>
      <description>&lt;P&gt;Ah, I see. Just add &lt;CODE&gt;end=1&lt;/CODE&gt; to end a day later than the default zero.&lt;/P&gt;</description>
      <pubDate>Sat, 31 Dec 2016 17:30:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Unable-to-set-stats-count-value-as-0-in-case-of-0-events-for-a/m-p/217464#M63882</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2016-12-31T17:30:08Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to set stats count value as 0 in case of 0 events for a particular day</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Unable-to-set-stats-count-value-as-0-in-case-of-0-events-for-a/m-p/217465#M63883</link>
      <description>&lt;P&gt;Thanks Martin for helping me with this, I am getting close it seems, now i am able to get all the days from gentimes=-8 and end = 1, but how should i handle the comparison now, the moment i add earliest=-1d@d and latest=@d for yesterday in first query the search gives me no results.&lt;/P&gt;

&lt;P&gt;Regards&lt;/P&gt;</description>
      <pubDate>Sat, 31 Dec 2016 18:01:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Unable-to-set-stats-count-value-as-0-in-case-of-0-events-for-a/m-p/217465#M63883</guid>
      <dc:creator>avaishsplunk</dc:creator>
      <dc:date>2016-12-31T18:01:01Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to set stats count value as 0 in case of 0 events for a particular day</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Unable-to-set-stats-count-value-as-0-in-case-of-0-events-for-a/m-p/217466#M63884</link>
      <description>&lt;P&gt;This what i exactly did &lt;/P&gt;

&lt;P&gt;|where status= "hvop_error" OR status="validation_error"]&lt;BR /&gt;
| bucket _time span=1d&lt;BR /&gt;&lt;BR /&gt;
| stats sum(Line_Count) AS Requests by _time|append [gentimes start=-8  end=1 |eval _time = starttime | eval Requests = 0]&lt;/P&gt;

&lt;P&gt;Now how should i pass my earliest and latest values here, the way i need to do is if you see my original query I need this appended data for yesterday and today so for that I beleive i need to pass the earliest and latest but the moment i pass them it does not give any output&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 12:14:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Unable-to-set-stats-count-value-as-0-in-case-of-0-events-for-a/m-p/217466#M63884</guid>
      <dc:creator>avaishsplunk</dc:creator>
      <dc:date>2020-09-29T12:14:25Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to set stats count value as 0 in case of 0 events for a particular day</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Unable-to-set-stats-count-value-as-0-in-case-of-0-events-for-a/m-p/217467#M63885</link>
      <description>&lt;P&gt;Guys can someone pls help on this issue, I am kind of stuck and all my searches need this kind of feature&lt;/P&gt;</description>
      <pubDate>Sat, 31 Dec 2016 21:29:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Unable-to-set-stats-count-value-as-0-in-case-of-0-events-for-a/m-p/217467#M63885</guid>
      <dc:creator>avaishsplunk</dc:creator>
      <dc:date>2016-12-31T21:29:04Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to set stats count value as 0 in case of 0 events for a particular day</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Unable-to-set-stats-count-value-as-0-in-case-of-0-events-for-a/m-p/217468#M63886</link>
      <description>&lt;P&gt;Using your calculation for earliest, try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | append [gentimes ... | where _time &amp;gt;= relative_time(now(), if(lower(strftime(now(),"%A"))="monday", "-3d@d", "-1d@d"))]
| stats max(Requests) as Requests by _time
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 01 Jan 2017 01:59:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Unable-to-set-stats-count-value-as-0-in-case-of-0-events-for-a/m-p/217468#M63886</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2017-01-01T01:59:27Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to set stats count value as 0 in case of 0 events for a particular day</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Unable-to-set-stats-count-value-as-0-in-case-of-0-events-for-a/m-p/217469#M63887</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;Hello Martin,

Tried below:

|where status= "hvop_error" OR status="validation_error"]
| bucket _time span=1d  |stats sum(Line_Count) as Requests by _time|
append [gentimes start=-8 end=1 | where _time &amp;gt;= relative_time(now(), if(lower(strftime(now(),"%A"))="monday", "-3d@d", "-1d@d"))]
 | stats max(Requests) as Requests by _time
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 01 Jan 2017 02:14:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Unable-to-set-stats-count-value-as-0-in-case-of-0-events-for-a/m-p/217469#M63887</guid>
      <dc:creator>avaishsplunk</dc:creator>
      <dc:date>2017-01-01T02:14:29Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to set stats count value as 0 in case of 0 events for a particular day</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Unable-to-set-stats-count-value-as-0-in-case-of-0-events-for-a/m-p/217470#M63888</link>
      <description>&lt;P&gt;it did not returned any rows me , output "No results found"&lt;/P&gt;</description>
      <pubDate>Sun, 01 Jan 2017 02:14:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Unable-to-set-stats-count-value-as-0-in-case-of-0-events-for-a/m-p/217470#M63888</guid>
      <dc:creator>avaishsplunk</dc:creator>
      <dc:date>2017-01-01T02:14:56Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to set stats count value as 0 in case of 0 events for a particular day</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Unable-to-set-stats-count-value-as-0-in-case-of-0-events-for-a/m-p/217471#M63889</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;It seems things are getting confused:

In my search query, I have 2 searches

1. This gives stats for today

2. This gives stats for the period entered as parameters to the panel (which is a) Last week same day/time b) Last month same day time c) Yesterday same day/time

The issue i am facing is if we have no events for 1 and 2, I need to show 0 as stats for both the mentioned criteria's along with dates

e.g.

Date Requests
12/31/2016 0
12/30/2016 0

same as

12/31/2016 --&amp;gt; 0
12/24/2016 ---&amp;gt; 0

I need the above so that i can put a single value field with trend charts

[| gentimes start=-1 
| eval earliest=if(lower(strftime(now(),"%A"))="monday", "-3d@d", "-1d@d") 
| eval latest=if(lower(strftime(now(),"%A"))="monday","-3d@s", "-1d@s")
| table earliest, latest | format "" "" "" "" "" ""] index=yy sourcetype=zz
| search "xx"
| spath output=OpName path=payload.gpmGenerateEventLogs.gpmGenerateEventLog{}.operationName
| spath output=EvType path=payload.gpmGenerateEventLogs.gpmGenerateEventLog{}.eventTypeCode
| spath output=state path=payload.gpmGenerateEventLogs.gpmGenerateEventLog{}.state
| spath output=Line_Count path=payload.gpmGenerateEventLogs.gpmGenerateEventLog{}.recordCount
| spath output=Org_Code path=payload.gpmGenerateEventLogs.gpmGenerateEventLog{}.attribute1
| spath output=TimeZone path=payload.gpmGenerateEventLogs.gpmGenerateEventLog{}.attribute2
| spath output=ccpath=payload.gpmGenerateEventLogs.gpmGenerateEventLog{}.attribute3
| eval combined=mvzip(mvzip(mvzip(mvzip(mvzip(mvzip(OpName,EvType),state),Line_Count),Org_Code),TimeZone),cc)
| mvexpand combined|eval combined=split(combined,",")
| eval OpName=mvindex(combined,0)
| eval EvType=mvindex(combined,1)
| eval state=mvindex(combined,2)
| eval Line_Count=mvindex(combined,3)
| eval Org_Code =mvindex(combined,4)
| eval TimeZone =mvindex(combined,5)
| eval cc=mvindex(combined,6)
| where OpName="abc"|append
[search earliest=@d index=yy sourcetype=zz
| search "xx"
| spath output=OpName path=payload.gpmGenerateEventLogs.gpmGenerateEventLog{}.operationName
| spath output=EvType path=payload.gpmGenerateEventLogs.gpmGenerateEventLog{}.eventTypeCode
| spath output=state path=payload.gpmGenerateEventLogs.gpmGenerateEventLog{}.state
| spath output=Line_Count path=payload.gpmGenerateEventLogs.gpmGenerateEventLog{}.recordCount
| spath output=Org_Code path=payload.gpmGenerateEventLogs.gpmGenerateEventLog{}.attribute1
| spath output=TimeZone path=payload.gpmGenerateEventLogs.gpmGenerateEventLog{}.attribute2
| spath output=CDC_RDC path=payload.gpmGenerateEventLogs.gpmGenerateEventLog{}.attribute3
| eval combined=mvzip(mvzip(mvzip(mvzip(mvzip(mvzip(OpName,EvType),state),Line_Count),Org_Code),TimeZone),CDC_RDC)
| mvexpand combined
| eval combined=split(combined,",")
| eval OpName=mvindex(combined,0)
| eval EvType=mvindex(combined,1)
| eval state=mvindex(combined,2)
| eval Line_Count=mvindex(combined,3)
| eval Org_Code =mvindex(combined,4)
| eval TimeZone =mvindex(combined,5)
| eval cc=mvindex(combined,6)
| where OpName="abc"]
| bucket _time span=1d
| stats sum(Line_Count) AS Requests by _time
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 01 Jan 2017 02:40:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Unable-to-set-stats-count-value-as-0-in-case-of-0-events-for-a/m-p/217471#M63889</guid>
      <dc:creator>avaishsplunk</dc:creator>
      <dc:date>2017-01-01T02:40:47Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to set stats count value as 0 in case of 0 events for a particular day</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Unable-to-set-stats-count-value-as-0-in-case-of-0-events-for-a/m-p/217472#M63890</link>
      <description>&lt;P&gt;You forgot the two &lt;CODE&gt;eval&lt;/CODE&gt;s.&lt;/P&gt;</description>
      <pubDate>Sun, 01 Jan 2017 03:01:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Unable-to-set-stats-count-value-as-0-in-case-of-0-events-for-a/m-p/217472#M63890</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2017-01-01T03:01:20Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to set stats count value as 0 in case of 0 events for a particular day</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Unable-to-set-stats-count-value-as-0-in-case-of-0-events-for-a/m-p/217473#M63891</link>
      <description>&lt;P&gt;Hello Martin,&lt;/P&gt;

&lt;P&gt;Sorry for the trouble, can you pls explain me little bit more details, I reposted my main query and how  i need to show the data.&lt;/P&gt;

&lt;P&gt;Can you pls help with this.&lt;/P&gt;

&lt;P&gt;Regards&lt;/P&gt;</description>
      <pubDate>Sun, 01 Jan 2017 03:12:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Unable-to-set-stats-count-value-as-0-in-case-of-0-events-for-a/m-p/217473#M63891</guid>
      <dc:creator>avaishsplunk</dc:creator>
      <dc:date>2017-01-01T03:12:11Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to set stats count value as 0 in case of 0 events for a particular day</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Unable-to-set-stats-count-value-as-0-in-case-of-0-events-for-a/m-p/217474#M63892</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;I hardcoded the values for earliest and latest , still no results

|where status= "hvop_error" OR status="validation_error"]
| bucket _time span=1d  |stats sum(Line_Count) as Requests by _time|
append [gentimes start=-8 end=1 | where _time &amp;gt;= relative_time(now(), if(lower(strftime(now(),"%A"))="monday", "-3d@d", "-1d@d")) |search earliest=-1d@d latest=-1d@s]| stats max(Requests) as Requests by _time
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 01 Jan 2017 03:26:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Unable-to-set-stats-count-value-as-0-in-case-of-0-events-for-a/m-p/217474#M63892</guid>
      <dc:creator>avaishsplunk</dc:creator>
      <dc:date>2017-01-01T03:26:48Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to set stats count value as 0 in case of 0 events for a particular day</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Unable-to-set-stats-count-value-as-0-in-case-of-0-events-for-a/m-p/217475#M63893</link>
      <description>&lt;P&gt;I've edited the original answer to include the full SPL you need to append to the end of your search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | append [gentimes start=-8 end=1 | eval _time = starttime | eval Requests = 0 | where _time &amp;gt;= relative_time(now(), if(lower(strftime(now(),"%A"))="monday", "-3d@d", "-1d@d"))]
| stats max(Requests) as Requests by _time
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 01 Jan 2017 15:10:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Unable-to-set-stats-count-value-as-0-in-case-of-0-events-for-a/m-p/217475#M63893</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2017-01-01T15:10:46Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to set stats count value as 0 in case of 0 events for a particular day</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Unable-to-set-stats-count-value-as-0-in-case-of-0-events-for-a/m-p/217476#M63894</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;Thanks a lot Martin, this is working for comparison for today and yesterday scenario, how shall i do it for comparing

1. Todays with last week 

2, Todays with last month 

Can you pls guide on this, and wishing you and all family members a very Happy new Year :)

Regards
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 01 Jan 2017 15:24:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Unable-to-set-stats-count-value-as-0-in-case-of-0-events-for-a/m-p/217476#M63894</guid>
      <dc:creator>avaishsplunk</dc:creator>
      <dc:date>2017-01-01T15:24:26Z</dc:date>
    </item>
  </channel>
</rss>

