<?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: How to whitelist files in directory and not in subdirectories? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-to-whitelist-files-in-directory-and-not-in-subdirectories/m-p/341675#M62964</link>
    <description>&lt;P&gt;this is not working. Adding recursive = false will not pick logs in error and heartbeat directory.&lt;/P&gt;</description>
    <pubDate>Thu, 01 Feb 2018 12:05:15 GMT</pubDate>
    <dc:creator>akchauhan</dc:creator>
    <dc:date>2018-02-01T12:05:15Z</dc:date>
    <item>
      <title>How to whitelist files in directory and not in subdirectories?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-whitelist-files-in-directory-and-not-in-subdirectories/m-p/341671#M62960</link>
      <description>&lt;P&gt;Hi Guys &lt;BR /&gt;
I am trying to pick logs having job-info.*log name in common directory and job-heartbeat.*logs from heartbeat sub directory and job-error .*log from error sub directory. I used the configuration below and it is working fine. The only issue that I am facing is job-info.*log files are also getting picked up when someone places these files in other sub directories (xyz in below case). I don't want these files to pick when they are placed in any sub-directories,  These should be picked only when they are placed in the common directory. Please suggest changes in the whitelist. &lt;/P&gt;

&lt;P&gt;[monitor:///abc/common/]&lt;BR /&gt;
disabled = false&lt;BR /&gt;
index = infra_job&lt;BR /&gt;
whitelist = (job-info.*log|heartbeat/job-heartbeat.*log|error/job-error.*log)&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;directories structure&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;cd /abc/common/
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;STRONG&gt;files/directories under this directory&lt;/STRONG&gt; (example)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;error/
heartbeat/
xyz/job-info.*log ---- don't want these logs to pick
job-info1.log
job-info2.log
job-info3.log
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Thanks in advance&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 17:53:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-whitelist-files-in-directory-and-not-in-subdirectories/m-p/341671#M62960</guid>
      <dc:creator>akchauhan</dc:creator>
      <dc:date>2020-09-29T17:53:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to whitelist files in directory and not in subdirectories?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-whitelist-files-in-directory-and-not-in-subdirectories/m-p/341672#M62961</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;recursive = false
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;might do it.&lt;/P&gt;</description>
      <pubDate>Wed, 31 Jan 2018 19:56:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-whitelist-files-in-directory-and-not-in-subdirectories/m-p/341672#M62961</guid>
      <dc:creator>ddrillic</dc:creator>
      <dc:date>2018-01-31T19:56:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to whitelist files in directory and not in subdirectories?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-whitelist-files-in-directory-and-not-in-subdirectories/m-p/341673#M62962</link>
      <description>&lt;P&gt;Hey akchauhan, &lt;/P&gt;

&lt;P&gt;there is a blacklist setting you could set for the job-info*.log files.&lt;/P&gt;

&lt;P&gt;Just add the following line to your config:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;blacklist=(\/abc\/common\/xyz\/job-info\d*\.log)&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;This will make sure you definitely will not index files under the specified path, cuz blacklist take precedence over whitelists.&lt;BR /&gt;
Stated here: &lt;CODE&gt;If a file matches the regexes in both the blacklist and whitelist settings,&lt;BR /&gt;
  the file is NOT monitored. Blacklists take precedence over whitelists.&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 31 Jan 2018 20:01:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-whitelist-files-in-directory-and-not-in-subdirectories/m-p/341673#M62962</guid>
      <dc:creator>horsefez</dc:creator>
      <dc:date>2018-01-31T20:01:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to whitelist files in directory and not in subdirectories?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-whitelist-files-in-directory-and-not-in-subdirectories/m-p/341674#M62963</link>
      <description>&lt;P&gt;There are chances that dev team can create directory similar to xyz  with other name as well. so what change do I need to add in blacklist you mentioned?&lt;/P&gt;</description>
      <pubDate>Thu, 01 Feb 2018 08:08:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-whitelist-files-in-directory-and-not-in-subdirectories/m-p/341674#M62963</guid>
      <dc:creator>akchauhan</dc:creator>
      <dc:date>2018-02-01T08:08:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to whitelist files in directory and not in subdirectories?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-whitelist-files-in-directory-and-not-in-subdirectories/m-p/341675#M62964</link>
      <description>&lt;P&gt;this is not working. Adding recursive = false will not pick logs in error and heartbeat directory.&lt;/P&gt;</description>
      <pubDate>Thu, 01 Feb 2018 12:05:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-whitelist-files-in-directory-and-not-in-subdirectories/m-p/341675#M62964</guid>
      <dc:creator>akchauhan</dc:creator>
      <dc:date>2018-02-01T12:05:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to whitelist files in directory and not in subdirectories?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-whitelist-files-in-directory-and-not-in-subdirectories/m-p/341676#M62965</link>
      <description>&lt;P&gt;Why not create 3 separate monitor inputs, one for job-info, one for error and one for heartbeat?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[monitor:///abc/common/job-info.*log]
disabled = false
index = infra_job

[monitor:///abc/common/heartbeat/job-heartbeat.*log]
disabled = false
index = infra_job

[monitor:///abc/common/error/job-error.*log]
disabled = false
index = infra_job
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 01 Feb 2018 13:07:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-whitelist-files-in-directory-and-not-in-subdirectories/m-p/341676#M62965</guid>
      <dc:creator>FrankVl</dc:creator>
      <dc:date>2018-02-01T13:07:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to whitelist files in directory and not in subdirectories?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-whitelist-files-in-directory-and-not-in-subdirectories/m-p/341677#M62966</link>
      <description>&lt;P&gt;yes, this was already in mind. Just thinking instead of creating 3 separate model inputs, if it is possible to do using whitelist/blacklist in single input that would be great. &lt;/P&gt;</description>
      <pubDate>Thu, 01 Feb 2018 13:36:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-whitelist-files-in-directory-and-not-in-subdirectories/m-p/341677#M62966</guid>
      <dc:creator>akchauhan</dc:creator>
      <dc:date>2018-02-01T13:36:35Z</dc:date>
    </item>
  </channel>
</rss>

