<?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: Is there a way i can schedule a saved search to run for every 2 weeks? in Reporting</title>
    <link>https://community.splunk.com/t5/Reporting/Is-there-a-way-i-can-schedule-a-saved-search-to-run-for-every-2/m-p/187944#M4055</link>
    <description>&lt;P&gt;I like the error, but it surely is a matter of taste.&lt;/P&gt;</description>
    <pubDate>Fri, 17 Mar 2017 22:36:31 GMT</pubDate>
    <dc:creator>woodcock</dc:creator>
    <dc:date>2017-03-17T22:36:31Z</dc:date>
    <item>
      <title>Is there a way i can schedule a saved search to run for every 2 weeks?</title>
      <link>https://community.splunk.com/t5/Reporting/Is-there-a-way-i-can-schedule-a-saved-search-to-run-for-every-2/m-p/187935#M4046</link>
      <description>&lt;P&gt;I want to schedule a saved search to run on Sunday 1 AM every 2 weeks.&lt;/P&gt;

&lt;P&gt;i.e. I need a search query to run &lt;/P&gt;

&lt;P&gt;July 12,2015 01:00:00   earliest:06/28/2015:00:00:00 latest:07/12/2015:00:00:00&lt;/P&gt;

&lt;P&gt;July 26,2015 01:00:00  earliest:07/12/2015:00:00:00 latest:07/26/2015:00:00:00&lt;/P&gt;

&lt;P&gt;and so on.&lt;/P&gt;

&lt;P&gt;Can anyone help me set up cron and earliest/latest for this scenario.&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 01 Jul 2015 07:30:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/Is-there-a-way-i-can-schedule-a-saved-search-to-run-for-every-2/m-p/187935#M4046</guid>
      <dc:creator>adityapavan18</dc:creator>
      <dc:date>2015-07-01T07:30:55Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way i can schedule a saved search to run for every 2 weeks?</title>
      <link>https://community.splunk.com/t5/Reporting/Is-there-a-way-i-can-schedule-a-saved-search-to-run-for-every-2/m-p/187936#M4047</link>
      <description>&lt;P&gt;This is not possible directly.  You will have to run it every week and then short-circuit the job using &lt;CODE&gt;addinfo&lt;/CODE&gt; and &lt;CODE&gt;map&lt;/CODE&gt; for the weeks that it is not supposed to run like this (extra steps for clarity):&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| noop | stats count AS runThisWeek | addinfo | eval runThisWeek = if(((tonumber(strftime(now(),"%W"))%2)==1),"YES","NO") | eval earliestMaybe=if((runThisWeek=="YES"), info_min_time, now()) | map search="search earliest=$earliestMaybe$ latest=$info_max_time$ YOUR SEARCH HERE"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;For the weeks it is not supposed to run, the search will generate an error.&lt;/P&gt;</description>
      <pubDate>Wed, 01 Jul 2015 13:52:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/Is-there-a-way-i-can-schedule-a-saved-search-to-run-for-every-2/m-p/187936#M4047</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2015-07-01T13:52:35Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way i can schedule a saved search to run for every 2 weeks?</title>
      <link>https://community.splunk.com/t5/Reporting/Is-there-a-way-i-can-schedule-a-saved-search-to-run-for-every-2/m-p/187937#M4048</link>
      <description>&lt;P&gt;are you ok, if the savedSearch Runs every week but with the data-set of last 2 weeks? You just need to ignore the week's which you don't want.&lt;BR /&gt;
It will become very simple in Cron&lt;/P&gt;</description>
      <pubDate>Wed, 01 Jul 2015 14:15:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/Is-there-a-way-i-can-schedule-a-saved-search-to-run-for-every-2/m-p/187937#M4048</guid>
      <dc:creator>koshyk</dc:creator>
      <dc:date>2015-07-01T14:15:20Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way i can schedule a saved search to run for every 2 weeks?</title>
      <link>https://community.splunk.com/t5/Reporting/Is-there-a-way-i-can-schedule-a-saved-search-to-run-for-every-2/m-p/187938#M4049</link>
      <description>&lt;P&gt;You can use a Cron expression, see this examples:&lt;BR /&gt;
&lt;A href="http://docs.splunk.com/Documentation/Splunk/6.2.2/Alert/Definescheduledalerts#Use_cron_notation_for_scheduled_alerts"&gt;http://docs.splunk.com/Documentation/Splunk/6.2.2/Alert/Definescheduledalerts#Use_cron_notation_for_scheduled_alerts&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jul 2015 15:01:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/Is-there-a-way-i-can-schedule-a-saved-search-to-run-for-every-2/m-p/187938#M4049</guid>
      <dc:creator>joao_amorim</dc:creator>
      <dc:date>2015-07-29T15:01:36Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way i can schedule a saved search to run for every 2 weeks?</title>
      <link>https://community.splunk.com/t5/Reporting/Is-there-a-way-i-can-schedule-a-saved-search-to-run-for-every-2/m-p/187939#M4050</link>
      <description>&lt;P&gt;I do not think that there is a way to schedule this natively within the cron notation.  I would agree with this answer and give it a try.  Most *nix admins reference a script in crontab to accomplish this.&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jul 2015 15:35:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/Is-there-a-way-i-can-schedule-a-saved-search-to-run-for-every-2/m-p/187939#M4050</guid>
      <dc:creator>jodros</dc:creator>
      <dc:date>2015-07-29T15:35:38Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way i can schedule a saved search to run for every 2 weeks?</title>
      <link>https://community.splunk.com/t5/Reporting/Is-there-a-way-i-can-schedule-a-saved-search-to-run-for-every-2/m-p/187940#M4051</link>
      <description>&lt;P&gt;So did this work for you? If so, make sure you "Accept" an answer to close the question.&lt;/P&gt;</description>
      <pubDate>Thu, 06 Aug 2015 16:54:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/Is-there-a-way-i-can-schedule-a-saved-search-to-run-for-every-2/m-p/187940#M4051</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2015-08-06T16:54:09Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way i can schedule a saved search to run for every 2 weeks?</title>
      <link>https://community.splunk.com/t5/Reporting/Is-there-a-way-i-can-schedule-a-saved-search-to-run-for-every-2/m-p/187941#M4052</link>
      <description>&lt;P&gt;Hi @adityapavan18&lt;/P&gt;

&lt;P&gt;Can you confirm if @woodcock's answer below solved your issue? If yes, be sure to click "Accept" directly below his answer to resolve the post. If not, can you please comment on the answer and provide more details?&lt;/P&gt;</description>
      <pubDate>Fri, 25 Sep 2015 20:29:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/Is-there-a-way-i-can-schedule-a-saved-search-to-run-for-every-2/m-p/187941#M4052</guid>
      <dc:creator>ppablo</dc:creator>
      <dc:date>2015-09-25T20:29:07Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way i can schedule a saved search to run for every 2 weeks?</title>
      <link>https://community.splunk.com/t5/Reporting/Is-there-a-way-i-can-schedule-a-saved-search-to-run-for-every-2/m-p/187942#M4053</link>
      <description>&lt;P&gt;Cron does not have the concept of multiples of weeks.  The best you could manage with cron would be to schedule for every Sunday or fixed days of the month.&lt;/P&gt;</description>
      <pubDate>Fri, 25 Sep 2015 21:15:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/Is-there-a-way-i-can-schedule-a-saved-search-to-run-for-every-2/m-p/187942#M4053</guid>
      <dc:creator>grijhwani</dc:creator>
      <dc:date>2015-09-25T21:15:11Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way i can schedule a saved search to run for every 2 weeks?</title>
      <link>https://community.splunk.com/t5/Reporting/Is-there-a-way-i-can-schedule-a-saved-search-to-run-for-every-2/m-p/187943#M4054</link>
      <description>&lt;P&gt;Refactoring your method in order to not generate an error, just an empty search, it looks like this if the alert is to run whenever there are results...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;YOUR SEARCH HERE 
 [ | noop | stats count AS search 
   | eval search=if(((tonumber(strftime(now(),"%W"))%2)==1),"SomeLongStringHereWhichWillNeverBeFoundInBloomFilters","")] 
| YOUR PROCESSING HERE
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Of course, when the alert is to fire if there are NO records, then you'd have to have another clause afterward to create them...&lt;/P&gt;</description>
      <pubDate>Fri, 17 Mar 2017 19:59:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/Is-there-a-way-i-can-schedule-a-saved-search-to-run-for-every-2/m-p/187943#M4054</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2017-03-17T19:59:55Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way i can schedule a saved search to run for every 2 weeks?</title>
      <link>https://community.splunk.com/t5/Reporting/Is-there-a-way-i-can-schedule-a-saved-search-to-run-for-every-2/m-p/187944#M4055</link>
      <description>&lt;P&gt;I like the error, but it surely is a matter of taste.&lt;/P&gt;</description>
      <pubDate>Fri, 17 Mar 2017 22:36:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/Is-there-a-way-i-can-schedule-a-saved-search-to-run-for-every-2/m-p/187944#M4055</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-03-17T22:36:31Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way i can schedule a saved search to run for every 2 weeks?</title>
      <link>https://community.splunk.com/t5/Reporting/Is-there-a-way-i-can-schedule-a-saved-search-to-run-for-every-2/m-p/187945#M4056</link>
      <description>&lt;P&gt;Surely.  otherwise known as YMMV.&lt;/P&gt;</description>
      <pubDate>Sat, 18 Mar 2017 02:57:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/Is-there-a-way-i-can-schedule-a-saved-search-to-run-for-every-2/m-p/187945#M4056</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2017-03-18T02:57:16Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way i can schedule a saved search to run for every 2 weeks?</title>
      <link>https://community.splunk.com/t5/Reporting/Is-there-a-way-i-can-schedule-a-saved-search-to-run-for-every-2/m-p/187946#M4057</link>
      <description>&lt;P&gt;I sure do wish somebody would click &lt;CODE&gt;Accept&lt;/CODE&gt; already!&lt;/P&gt;</description>
      <pubDate>Sat, 18 Mar 2017 03:37:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/Is-there-a-way-i-can-schedule-a-saved-search-to-run-for-every-2/m-p/187946#M4057</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-03-18T03:37:20Z</dc:date>
    </item>
  </channel>
</rss>

