<?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: Run a monthly Performance report excluding maintenance hours on specific days in Reporting</title>
    <link>https://community.splunk.com/t5/Reporting/Run-a-monthly-Performance-report-excluding-maintenance-hours-on/m-p/257382#M5026</link>
    <description>&lt;P&gt;Ran the report again with the new updated query (NOT) condition . It worked perfectly, validated the results. &lt;/P&gt;

&lt;P&gt;Thank you so much Somesoni2. &lt;/P&gt;</description>
    <pubDate>Mon, 22 Feb 2016 19:30:45 GMT</pubDate>
    <dc:creator>nmohammed</dc:creator>
    <dc:date>2016-02-22T19:30:45Z</dc:date>
    <item>
      <title>Run a monthly Performance report excluding maintenance hours on specific days</title>
      <link>https://community.splunk.com/t5/Reporting/Run-a-monthly-Performance-report-excluding-maintenance-hours-on/m-p/257375#M5019</link>
      <description>&lt;P&gt;We have month performance reports on Calls and errors metrics, with a few calculations to do generate a application performance report.  The report again has data broken into hourly buckets per day. &lt;BR /&gt;
But since we have regular maintenance windows and code freeze end of month, we need to generate the reports accordingly. &lt;/P&gt;

&lt;P&gt;I need help in excluding metrics for these maintenance hours. &lt;/P&gt;

&lt;P&gt;Tuesday - starts 10:00 PM PT and ends at 02:00 AM PT  Wednesday&lt;BR /&gt;
Thursday - starts 10:00 PM PT and ends at 02:00 AM PT  Friday&lt;/P&gt;

&lt;P&gt;i have tried the following, but it doesn't work out ...&lt;/P&gt;

&lt;P&gt;search |  (wday=Tuesday OR wday=Thursday) AND ((date_hour&amp;gt;=22 AND date_minute&amp;gt;=00) AND (date_hour&amp;lt;=1 AND date_minute&amp;lt;=59)  &lt;/P&gt;

&lt;P&gt;also above mentioned maintenance hours are not in effect last 10 days of month, so it should be regular report. &lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 08:36:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/Run-a-monthly-Performance-report-excluding-maintenance-hours-on/m-p/257375#M5019</guid>
      <dc:creator>nmohammed</dc:creator>
      <dc:date>2020-09-29T08:36:41Z</dc:date>
    </item>
    <item>
      <title>Re: Run a monthly Performance report excluding maintenance hours on specific days</title>
      <link>https://community.splunk.com/t5/Reporting/Run-a-monthly-Performance-report-excluding-maintenance-hours-on/m-p/257376#M5020</link>
      <description>&lt;P&gt;Try something like this (assuming date_* fields are available in your logs)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your base search | search NOT (_time&amp;lt;relative_time(_time,"@mon+1mon-10d") AND (date_wday="Tuesday" OR date_wday="Thursday") AND date_hour&amp;gt;=22) OR (date_wday="Wednesday" OR date_wday="Friday") AND date_hour&amp;lt;2) 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;EM&gt;**Updated (fixed syntax on filter)#2 *&lt;/EM&gt;*&lt;BR /&gt;
replace &lt;CODE&gt;| search&lt;/CODE&gt;  with &lt;CODE&gt;| where&lt;/CODE&gt;  and change case of date_wday&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; (sourcetype=error OR sourcetype=info client=*) | where NOT (_time&amp;lt;relative_time(_time,"@mon+1mon-10d") AND (((date_wday="tuesday" OR date_wday="thursday") AND date_hour&amp;gt;=22) OR ((date_wday="wednesday" OR date_wday="friday") AND date_hour&amp;lt;2))) |bucket _time span=1h | stats count as Total count(eval(sourcetype=="info")) as Calls count(eval(sourcetype=="error")) as Errors count(eval(exec_time_ms &amp;gt; 3000)) as Heavy by _time, client | eval QoS = round(((Total-Errors)/Total)*100, 3) | eval Perf = round((1-(Heavy/Calls))*100, 3)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 28 Jan 2016 20:05:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/Run-a-monthly-Performance-report-excluding-maintenance-hours-on/m-p/257376#M5020</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-01-28T20:05:07Z</dc:date>
    </item>
    <item>
      <title>Re: Run a monthly Performance report excluding maintenance hours on specific days</title>
      <link>https://community.splunk.com/t5/Reporting/Run-a-monthly-Performance-report-excluding-maintenance-hours-on/m-p/257377#M5021</link>
      <description>&lt;P&gt;Thanks Somesoni2&lt;/P&gt;

&lt;P&gt;I have tried the above expression you mentioned in the answer, but it gives an error for unbalanced parentheses. &lt;/P&gt;

&lt;P&gt;Then I modified it to the following:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your base search | search NOT (_time=22) OR ((date_wday="Wednesday" OR date_wday="Friday") AND date_hour&amp;lt;=2))
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;But this one still includes results from those hours. &lt;/P&gt;

&lt;P&gt;I also removed the relative time condition, to eliminate the freeze (last 10days) and just try with the following (this one worked):&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your base search| search NOT ((date_wday="Tuesday" OR date_wday="Thursday") AND date_hour&amp;gt;=22) OR ((date_wday="Wednesday" OR date_wday="Friday") AND date_hour&amp;lt;=2)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Can you suggest where I am going wrong in order to achieve my overall goal to eliminate events from freeze with maintenance windows? &lt;/P&gt;

&lt;P&gt;This is the exact search, I am using:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(sourcetype=error OR sourcetype=info client=*) | search NOT (_time=22) OR ((date_wday="Wednesday" OR date_wday="Friday") AND date_hour&amp;lt;=2)) |bucket _time span=1h | stats count as Total count(eval(sourcetype=="info")) as Calls count(eval(sourcetype=="error")) as Errors count(eval(exec_time_ms &amp;gt; 3000)) as Heavy by _time, client | eval QoS = round(((Total-Errors)/Total)*100, 3) | eval Perf = round((1-(Heavy/Calls))*100, 3)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Thanks again, appreciate your help. &lt;/P&gt;</description>
      <pubDate>Mon, 01 Feb 2016 19:46:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/Run-a-monthly-Performance-report-excluding-maintenance-hours-on/m-p/257377#M5021</guid>
      <dc:creator>nmohammed</dc:creator>
      <dc:date>2016-02-01T19:46:47Z</dc:date>
    </item>
    <item>
      <title>Re: Run a monthly Performance report excluding maintenance hours on specific days</title>
      <link>https://community.splunk.com/t5/Reporting/Run-a-monthly-Performance-report-excluding-maintenance-hours-on/m-p/257378#M5022</link>
      <description>&lt;P&gt;I believe the updated query should take care of both freeze period and maintenance period.&lt;/P&gt;</description>
      <pubDate>Mon, 01 Feb 2016 21:15:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/Run-a-monthly-Performance-report-excluding-maintenance-hours-on/m-p/257378#M5022</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-02-01T21:15:57Z</dc:date>
    </item>
    <item>
      <title>Re: Run a monthly Performance report excluding maintenance hours on specific days</title>
      <link>https://community.splunk.com/t5/Reporting/Run-a-monthly-Performance-report-excluding-maintenance-hours-on/m-p/257379#M5023</link>
      <description>&lt;P&gt;I tried the updated query, but it does not eliminate the maintenance hours : &lt;/P&gt;

&lt;P&gt;(date_wday="Tuesday" OR date_wday="Thursday") AND date_hour&amp;gt;=22) OR ((date_wday="Wednesday" OR date_wday="Friday") AND date_hour&amp;lt;2)&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;I verified this by running the report for Jan. Example, Jan 5th, 2016 is Tuesday, if above condition is met , then the hours from 22:00 and  23:00 should be excluded in the report, but I am still seeing numbers for those hours. &lt;/LI&gt;
&lt;/UL&gt;</description>
      <pubDate>Tue, 29 Sep 2020 08:38:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/Run-a-monthly-Performance-report-excluding-maintenance-hours-on/m-p/257379#M5023</guid>
      <dc:creator>nmohammed</dc:creator>
      <dc:date>2020-09-29T08:38:25Z</dc:date>
    </item>
    <item>
      <title>Re: Run a monthly Performance report excluding maintenance hours on specific days</title>
      <link>https://community.splunk.com/t5/Reporting/Run-a-monthly-Performance-report-excluding-maintenance-hours-on/m-p/257380#M5024</link>
      <description>&lt;P&gt;Somesoni2, &lt;/P&gt;

&lt;P&gt;could you help me address this ? I have tried it again.. basically when we filter it out using (_time&lt;/P&gt;</description>
      <pubDate>Thu, 18 Feb 2016 19:21:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/Run-a-monthly-Performance-report-excluding-maintenance-hours-on/m-p/257380#M5024</guid>
      <dc:creator>nmohammed</dc:creator>
      <dc:date>2016-02-18T19:21:41Z</dc:date>
    </item>
    <item>
      <title>Re: Run a monthly Performance report excluding maintenance hours on specific days</title>
      <link>https://community.splunk.com/t5/Reporting/Run-a-monthly-Performance-report-excluding-maintenance-hours-on/m-p/257381#M5025</link>
      <description>&lt;P&gt;I guess the comparison based on date_wday wasn't working. Try the updated answer.&lt;/P&gt;</description>
      <pubDate>Thu, 18 Feb 2016 21:39:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/Run-a-monthly-Performance-report-excluding-maintenance-hours-on/m-p/257381#M5025</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-02-18T21:39:43Z</dc:date>
    </item>
    <item>
      <title>Re: Run a monthly Performance report excluding maintenance hours on specific days</title>
      <link>https://community.splunk.com/t5/Reporting/Run-a-monthly-Performance-report-excluding-maintenance-hours-on/m-p/257382#M5026</link>
      <description>&lt;P&gt;Ran the report again with the new updated query (NOT) condition . It worked perfectly, validated the results. &lt;/P&gt;

&lt;P&gt;Thank you so much Somesoni2. &lt;/P&gt;</description>
      <pubDate>Mon, 22 Feb 2016 19:30:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/Run-a-monthly-Performance-report-excluding-maintenance-hours-on/m-p/257382#M5026</guid>
      <dc:creator>nmohammed</dc:creator>
      <dc:date>2016-02-22T19:30:45Z</dc:date>
    </item>
    <item>
      <title>Re: Run a monthly Performance report excluding maintenance hours on specific days</title>
      <link>https://community.splunk.com/t5/Reporting/Run-a-monthly-Performance-report-excluding-maintenance-hours-on/m-p/257383#M5027</link>
      <description>&lt;P&gt;SomeSoni2,&lt;/P&gt;

&lt;P&gt;I tried to work this out with tstats and data models . But it again doesn't exclude filters. I am able to see all the hours. &lt;/P&gt;

&lt;P&gt;|tstats avg(ABC.exec_time) as exec_time FROM datamodel=ABC where sourcetype=abc groupby ABC.transaction,  ABC.client, _time span=1h | eval date_hour=tonumber(strftime(_time,"%H")) | eval date_wday = strftime(_time,"%A") | where NOT (_time=22) OR ((date_wday="wednesday" OR date_wday="friday") AND date_hour&amp;lt;2) OR ((date_wday="saturday") AND date_hour&amp;gt;=16) OR ((date_wday="sunday") AND date_hour&amp;lt;4))) | bucket _time span=1h |stats avg(exec_time) as "Response Time" by _time, ABC.transaction, ABC.client&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 09:00:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/Run-a-monthly-Performance-report-excluding-maintenance-hours-on/m-p/257383#M5027</guid>
      <dc:creator>nmohammed</dc:creator>
      <dc:date>2020-09-29T09:00:00Z</dc:date>
    </item>
    <item>
      <title>Re: Run a monthly Performance report excluding maintenance hours on specific days</title>
      <link>https://community.splunk.com/t5/Reporting/Run-a-monthly-Performance-report-excluding-maintenance-hours-on/m-p/257384#M5028</link>
      <description>&lt;P&gt;If you're using the same set of filters, ensure that where clause is this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| where NOT (_time&amp;lt;relative_time(_time,"@mon+1mon-10d") AND (((date_wday="tuesday" OR date_wday="thursday") AND date_hour&amp;gt;=22) OR ((date_wday="wednesday" OR date_wday="friday") AND date_hour&amp;lt;2)))
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 07 Mar 2016 22:40:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/Run-a-monthly-Performance-report-excluding-maintenance-hours-on/m-p/257384#M5028</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-03-07T22:40:57Z</dc:date>
    </item>
    <item>
      <title>Re: Run a monthly Performance report excluding maintenance hours on specific days</title>
      <link>https://community.splunk.com/t5/Reporting/Run-a-monthly-Performance-report-excluding-maintenance-hours-on/m-p/257385#M5029</link>
      <description>&lt;P&gt;Actually, I pasted it wrong in the reply.., I was using the filer correctly, but had to change  eval date_wday = (strftime(_time,"%A"))  to eval date_wday = lower(strftime(_time,"%A"))  and it worked. &lt;/P&gt;

&lt;P&gt;|tstats avg(ABC.exec_time) as exec_time FROM datamodel=ABC where sourcetype=abc groupby ABC.transaction, ABC.client, _time span=1h | eval date_hour=tonumber(strftime(_time,"%H")) | eval date_wday = lower(strftime(_time,"%A")) | where NOT NOT (_time=22) OR ((date_wday="wednesday" OR date_wday="friday") AND date_hour&amp;lt;2) OR ((date_wday="saturday") AND date_hour&amp;gt;=16) OR ((date_wday="sunday") AND date_hour&amp;lt;4))) | bucket _time span=1h |stats avg(exec_time) as "Response Time" by _time, ABC.transaction, ABC.client&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 09:00:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/Run-a-monthly-Performance-report-excluding-maintenance-hours-on/m-p/257385#M5029</guid>
      <dc:creator>nmohammed</dc:creator>
      <dc:date>2020-09-29T09:00:06Z</dc:date>
    </item>
  </channel>
</rss>

