<?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 My search does not work if it is scheduled to run for generating lookup table in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/My-search-does-not-work-if-it-is-scheduled-to-run-for-generating/m-p/76967#M19476</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I have following lookup cron job defined in savedsearches.conf (the search condition is simplified for this discussion):&lt;/P&gt;

&lt;P&gt;[AD Password Change by Domain]&lt;/P&gt;

&lt;P&gt;cron_schedule = */15 * * * *&lt;/P&gt;

&lt;P&gt;enableSched = 1&lt;/P&gt;

&lt;P&gt;dispatch.earliest_time = -3d&lt;/P&gt;

&lt;P&gt;dispatch.latest_time = now&lt;/P&gt;

&lt;P&gt;run_on_startup = true&lt;/P&gt;

&lt;P&gt;dispatch.lookups = 0&lt;/P&gt;

&lt;P&gt;description = Create AD password change statistics lookup file.&lt;/P&gt;

&lt;P&gt;search = EventCode=4724 | eval time=strftime(_time, "%c") | stats dc(time) as password_changes by domain | outputlookup stat_ad_password_changes_by_domain&lt;/P&gt;

&lt;P&gt;It is expected to run every 15 minutes and refresh the stat_ad_password_changes_by_domain.csv file.  But every time it runs, stat_ad_password_changes_by_domain.csv file is set to size 0(there is no content in such file).&lt;/P&gt;

&lt;P&gt;The search itself works.  If I copy the search (EventCode=4724 | eval time=strftime(_time, "%c") | stats dc(time) as password_changes by domain | outputlookup stat_ad_password_changes_by_domain) and run it from Splunk console, it works and displays following result:&lt;/P&gt;

&lt;P&gt;domain          password_changes&lt;BR /&gt;&lt;BR /&gt;
MYDOMAIN.COM    1 &lt;/P&gt;

&lt;P&gt;In the mean time, stat_ad_password_changes_by_domain.csv file contains the right content.  But after 15 minutes, the csv file size is changed to 0 since cron job run such search and refresh the csv file.&lt;/P&gt;

&lt;P&gt;I do have multiple other good lookup tables.  If I switch this search with a good lookup table, it breaks such good lookup table.  So, this search really has problem when it is run from cron for generating lookup table although it works fine when running from Splunk console.  &lt;/P&gt;

&lt;P&gt;Anybody has any idea why this search has problem?  Also in general, what is the way to debug such problem?  Since running such search from Splunk console is working, it has to be related to cron job for generating lookup table.  But i have no idea how to debug this.&lt;/P&gt;

&lt;P&gt;Thanks in advance!&lt;/P&gt;

&lt;P&gt;John&lt;/P&gt;</description>
    <pubDate>Mon, 28 Sep 2020 11:57:07 GMT</pubDate>
    <dc:creator>tonopahtaos</dc:creator>
    <dc:date>2020-09-28T11:57:07Z</dc:date>
    <item>
      <title>My search does not work if it is scheduled to run for generating lookup table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/My-search-does-not-work-if-it-is-scheduled-to-run-for-generating/m-p/76967#M19476</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I have following lookup cron job defined in savedsearches.conf (the search condition is simplified for this discussion):&lt;/P&gt;

&lt;P&gt;[AD Password Change by Domain]&lt;/P&gt;

&lt;P&gt;cron_schedule = */15 * * * *&lt;/P&gt;

&lt;P&gt;enableSched = 1&lt;/P&gt;

&lt;P&gt;dispatch.earliest_time = -3d&lt;/P&gt;

&lt;P&gt;dispatch.latest_time = now&lt;/P&gt;

&lt;P&gt;run_on_startup = true&lt;/P&gt;

&lt;P&gt;dispatch.lookups = 0&lt;/P&gt;

&lt;P&gt;description = Create AD password change statistics lookup file.&lt;/P&gt;

&lt;P&gt;search = EventCode=4724 | eval time=strftime(_time, "%c") | stats dc(time) as password_changes by domain | outputlookup stat_ad_password_changes_by_domain&lt;/P&gt;

&lt;P&gt;It is expected to run every 15 minutes and refresh the stat_ad_password_changes_by_domain.csv file.  But every time it runs, stat_ad_password_changes_by_domain.csv file is set to size 0(there is no content in such file).&lt;/P&gt;

&lt;P&gt;The search itself works.  If I copy the search (EventCode=4724 | eval time=strftime(_time, "%c") | stats dc(time) as password_changes by domain | outputlookup stat_ad_password_changes_by_domain) and run it from Splunk console, it works and displays following result:&lt;/P&gt;

&lt;P&gt;domain          password_changes&lt;BR /&gt;&lt;BR /&gt;
MYDOMAIN.COM    1 &lt;/P&gt;

&lt;P&gt;In the mean time, stat_ad_password_changes_by_domain.csv file contains the right content.  But after 15 minutes, the csv file size is changed to 0 since cron job run such search and refresh the csv file.&lt;/P&gt;

&lt;P&gt;I do have multiple other good lookup tables.  If I switch this search with a good lookup table, it breaks such good lookup table.  So, this search really has problem when it is run from cron for generating lookup table although it works fine when running from Splunk console.  &lt;/P&gt;

&lt;P&gt;Anybody has any idea why this search has problem?  Also in general, what is the way to debug such problem?  Since running such search from Splunk console is working, it has to be related to cron job for generating lookup table.  But i have no idea how to debug this.&lt;/P&gt;

&lt;P&gt;Thanks in advance!&lt;/P&gt;

&lt;P&gt;John&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 11:57:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/My-search-does-not-work-if-it-is-scheduled-to-run-for-generating/m-p/76967#M19476</guid>
      <dc:creator>tonopahtaos</dc:creator>
      <dc:date>2020-09-28T11:57:07Z</dc:date>
    </item>
    <item>
      <title>Re: My search does not work if it is scheduled to run for generating lookup table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/My-search-does-not-work-if-it-is-scheduled-to-run-for-generating/m-p/76968#M19477</link>
      <description>&lt;P&gt;If the search running in splunk console is fine, did you check earliest time and latest time? If both time is same as you did in splunk web console, you will need to case open to splunk support.&lt;/P&gt;</description>
      <pubDate>Mon, 18 Jun 2012 11:15:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/My-search-does-not-work-if-it-is-scheduled-to-run-for-generating/m-p/76968#M19477</guid>
      <dc:creator>Takajian</dc:creator>
      <dc:date>2012-06-18T11:15:17Z</dc:date>
    </item>
  </channel>
</rss>

