<?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 How to use blacklist in inputs.conf? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-to-use-blacklist-in-inputs-conf/m-p/429045#M75178</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;How do you edit inputs.conf to blacklist some hosts from indexing and index those hosts to different index?&lt;/P&gt;

&lt;P&gt;list of the servers:&lt;/P&gt;

&lt;P&gt;/opt/logs/&lt;BR /&gt;
server1&lt;BR /&gt;
server2&lt;BR /&gt;
server3&lt;BR /&gt;
server4&lt;BR /&gt;
server5&lt;BR /&gt;
server6&lt;/P&gt;

&lt;P&gt;inputs.conf&lt;/P&gt;

&lt;P&gt;[monitor:///opt/logs/*/*log]&lt;BR /&gt;
disabled = 0&lt;BR /&gt;
host_segment = 4&lt;BR /&gt;
index = abc&lt;BR /&gt;
blacklist=(server4|server5)&lt;BR /&gt;
sourcetype = abc&lt;BR /&gt;
blacklist = .gz$&lt;/P&gt;

&lt;P&gt;[monitor:///opt/logs/*/*log]&lt;BR /&gt;
disabled = 0&lt;BR /&gt;
host_segment = 4&lt;BR /&gt;
index = xyz&lt;BR /&gt;
whitelsit=(server4|server5)&lt;BR /&gt;
sourcetype = abc&lt;BR /&gt;
blacklist = .gz$&lt;/P&gt;</description>
    <pubDate>Tue, 29 Sep 2020 21:02:49 GMT</pubDate>
    <dc:creator>knalla</dc:creator>
    <dc:date>2020-09-29T21:02:49Z</dc:date>
    <item>
      <title>How to use blacklist in inputs.conf?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-use-blacklist-in-inputs-conf/m-p/429045#M75178</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;How do you edit inputs.conf to blacklist some hosts from indexing and index those hosts to different index?&lt;/P&gt;

&lt;P&gt;list of the servers:&lt;/P&gt;

&lt;P&gt;/opt/logs/&lt;BR /&gt;
server1&lt;BR /&gt;
server2&lt;BR /&gt;
server3&lt;BR /&gt;
server4&lt;BR /&gt;
server5&lt;BR /&gt;
server6&lt;/P&gt;

&lt;P&gt;inputs.conf&lt;/P&gt;

&lt;P&gt;[monitor:///opt/logs/*/*log]&lt;BR /&gt;
disabled = 0&lt;BR /&gt;
host_segment = 4&lt;BR /&gt;
index = abc&lt;BR /&gt;
blacklist=(server4|server5)&lt;BR /&gt;
sourcetype = abc&lt;BR /&gt;
blacklist = .gz$&lt;/P&gt;

&lt;P&gt;[monitor:///opt/logs/*/*log]&lt;BR /&gt;
disabled = 0&lt;BR /&gt;
host_segment = 4&lt;BR /&gt;
index = xyz&lt;BR /&gt;
whitelsit=(server4|server5)&lt;BR /&gt;
sourcetype = abc&lt;BR /&gt;
blacklist = .gz$&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 21:02:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-use-blacklist-in-inputs-conf/m-p/429045#M75178</guid>
      <dc:creator>knalla</dc:creator>
      <dc:date>2020-09-29T21:02:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to use blacklist in inputs.conf?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-use-blacklist-in-inputs-conf/m-p/429046#M75179</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;
You can do this, please find the docs below.&lt;BR /&gt;
&lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/Forwarding/Routeandfilterdatad#Filter_data_by_target_index"&gt;https://docs.splunk.com/Documentation/Splunk/latest/Forwarding/Routeandfilterdatad#Filter_data_by_target_index&lt;/A&gt;&lt;BR /&gt;
you will have to blacklist them and assign to a different group name and mention that in outputs.conf&lt;/P&gt;</description>
      <pubDate>Tue, 28 Aug 2018 21:14:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-use-blacklist-in-inputs-conf/m-p/429046#M75179</guid>
      <dc:creator>pruthvikrishnap</dc:creator>
      <dc:date>2018-08-28T21:14:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to use blacklist in inputs.conf?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-use-blacklist-in-inputs-conf/m-p/429047#M75180</link>
      <description>&lt;P&gt;@knalla,&lt;/P&gt;

&lt;P&gt;Please refer to previous answers. Let me know if it helps you or not.&lt;/P&gt;

&lt;P&gt;&lt;A href="https://answers.splunk.com/answers/141957/blacklist-file-form-inputs-conf.html"&gt;https://answers.splunk.com/answers/141957/blacklist-file-form-inputs-conf.html&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;&lt;A href="https://answers.splunk.com/answers/134091/inputs-conf-whitelist-blacklist-question.html"&gt;https://answers.splunk.com/answers/134091/inputs-conf-whitelist-blacklist-question.html&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;&lt;A href="https://answers.splunk.com/answers/542588/how-to-edit-inputsconf-to-blacklist-an-eventcode.html"&gt;https://answers.splunk.com/answers/542588/how-to-edit-inputsconf-to-blacklist-an-eventcode.html&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/SplunkCloud/latest/Data/Whitelistorblacklistspecificincomingdata"&gt;http://docs.splunk.com/Documentation/SplunkCloud/latest/Data/Whitelistorblacklistspecificincomingdata&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Aug 2018 11:40:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-use-blacklist-in-inputs-conf/m-p/429047#M75180</guid>
      <dc:creator>Shan</dc:creator>
      <dc:date>2018-08-29T11:40:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to use blacklist in inputs.conf?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-use-blacklist-in-inputs-conf/m-p/429048#M75181</link>
      <description>&lt;P&gt;If a file matches the regexes in both the blacklist and whitelist settings, the file is NOT monitored. Blacklists take precedence over whitelists.&lt;/P&gt;

&lt;P&gt;Try this combination in inputs.conf and see of it works,&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[monitor:///opt/logs/*/*log]
disabled = 0
host_segment = 4
index = abc
whitelist=(server1|server2|server3|server6)
sourcetype = abc
blacklist = .gz$

[monitor:///opt/logs/*/*log]
disabled = 0
host_segment = 4
index = xyz
whitelsit=(server4|server5)
sourcetype = abc
blacklist = .gz$
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Also, based on your monitor statement, I don't think &lt;CODE&gt;host_segment=4&lt;/CODE&gt; will pick up directory name as hostname. Try host_segment=3.&lt;/P&gt;

&lt;P&gt;For example, if you set &lt;CODE&gt;host_segment=3&lt;/CODE&gt; and the monitor path is &lt;CODE&gt;/opt/logs/host01/some.log&lt;/CODE&gt;, Splunk software sets the host as "host01" because that is the third segment.&lt;/P&gt;</description>
      <pubDate>Wed, 29 Aug 2018 13:39:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-use-blacklist-in-inputs-conf/m-p/429048#M75181</guid>
      <dc:creator>sudosplunk</dc:creator>
      <dc:date>2018-08-29T13:39:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to use blacklist in inputs.conf?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-use-blacklist-in-inputs-conf/m-p/429049#M75182</link>
      <description>&lt;P&gt;Thanks for the response, I have multiple hosts to white list around 200 and black list around 10.&lt;/P&gt;

&lt;P&gt;can I use 2 blacklists in a stanza, one for the hosts and one for  .gz$?&lt;/P&gt;</description>
      <pubDate>Thu, 30 Aug 2018 16:03:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-use-blacklist-in-inputs-conf/m-p/429049#M75182</guid>
      <dc:creator>knalla</dc:creator>
      <dc:date>2018-08-30T16:03:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to use blacklist in inputs.conf?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-use-blacklist-in-inputs-conf/m-p/429050#M75183</link>
      <description>&lt;P&gt;Since blacklist supports regex, you can define regex to capture all 200 OR 10 hosts. Let me know how your hostname(s) looks like and I will try to provide a regex.&lt;/P&gt;

&lt;P&gt;To my knowledge, you should be able to use 2 blacklists but be sure to number them, blacklist1, blacklist2, blacklist3 so on. More details &lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/Admin/Inputsconf#Windows_Event_Log_Monitor"&gt;here&lt;/A&gt;. &lt;/P&gt;

&lt;P&gt;Alternatively, this should also work, &lt;CODE&gt;blacklist = server1|\.gz$&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Aug 2018 17:56:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-use-blacklist-in-inputs-conf/m-p/429050#M75183</guid>
      <dc:creator>sudosplunk</dc:creator>
      <dc:date>2018-08-30T17:56:07Z</dc:date>
    </item>
  </channel>
</rss>

