Getting Data In

remove specific folder from input

Nawab
Communicator

I have configured syslog-ng to listen on multiple ports, save them in a folder with IP name and hf to send logs to indexers, 

In one case i have 127.0.0.1 sending as loopback to syslog-ng server, now i want to remove this IP from my input configs.

let suppose I have below folder

/opt/syslog/Fortigate

under fortigate I have mutiple fortigates sending logs and i dont know in future we can add a new fortigate here 1 hot is 127.0.0.1, i want to remove this from my inputs, what should I do.

Labels (1)
0 Karma
1 Solution

livehybrid
SplunkTrust
SplunkTrust

Hi @Nawab 

Modify the inputs.conf file on your Splunk forwarder to add a blacklist entry for the specific directory you want to exclude.

Locate the stanza for your directory input, e.g. [monitor:///opt/syslog/Fortigate], and add the blacklist line.

[monitor:///opt/syslog/Fortigate]
disabled = false
# ... other settings like index, sourcetype ...
blacklist = /opt/syslog/Fortigate/127\.0\.0\.1/.*

This configuration tells Splunk to monitor the /opt/syslog/Fortigate directory but ignore any files or subdirectories within the /opt/syslog/Fortigate/127.0.0.1 path. The \. escapes the dots in the IP address, and /.* ensures that everything within that specific directory is excluded.

After saving the changes to inputs.conf, you must restart the Splunk forwarder for the changes to take effect.

Check out the following inputs.conf docs on blacklist of files: https://docs.splunk.com/Documentation/Splunk/latest/Admin/Inputsconf#:~:text=way.%0A*%20No%20default...

🌟 Did this answer help you? If so, please consider:

  • Adding karma to show it was useful
  • Marking it as the solution if it resolved your issue
  • Commenting if you need any clarification

Your feedback encourages the volunteers in this community to continue contributing

View solution in original post

0 Karma

Nawab
Communicator

I just pasted blacklist 127.0.0.1, and when I ran list monitor all 127.0.0.1 is remove, is it correct or should i used your method

0 Karma

livehybrid
SplunkTrust
SplunkTrust

Hi @Nawab 

That should work too, its using a regex to match so 127.0.0.1 I guess will also match 🙂

🌟 Did this answer help you? If so, please consider:

  • Adding karma to show it was useful
  • Marking it as the solution if it resolved your issue
  • Commenting if you need any clarification

Your feedback encourages the volunteers in this community to continue contributing

0 Karma

livehybrid
SplunkTrust
SplunkTrust

Hi @Nawab 

Modify the inputs.conf file on your Splunk forwarder to add a blacklist entry for the specific directory you want to exclude.

Locate the stanza for your directory input, e.g. [monitor:///opt/syslog/Fortigate], and add the blacklist line.

[monitor:///opt/syslog/Fortigate]
disabled = false
# ... other settings like index, sourcetype ...
blacklist = /opt/syslog/Fortigate/127\.0\.0\.1/.*

This configuration tells Splunk to monitor the /opt/syslog/Fortigate directory but ignore any files or subdirectories within the /opt/syslog/Fortigate/127.0.0.1 path. The \. escapes the dots in the IP address, and /.* ensures that everything within that specific directory is excluded.

After saving the changes to inputs.conf, you must restart the Splunk forwarder for the changes to take effect.

Check out the following inputs.conf docs on blacklist of files: https://docs.splunk.com/Documentation/Splunk/latest/Admin/Inputsconf#:~:text=way.%0A*%20No%20default...

🌟 Did this answer help you? If so, please consider:

  • Adding karma to show it was useful
  • Marking it as the solution if it resolved your issue
  • Commenting if you need any clarification

Your feedback encourages the volunteers in this community to continue contributing

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Can’t Make It to Boston? Stream .conf25 and Learn with Haya Husain

Boston may be buzzing this September with Splunk University and .conf25, but you don’t have to pack a bag to ...

Splunk Lantern’s Guide to The Most Popular .conf25 Sessions

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Unlock What’s Next: The Splunk Cloud Platform at .conf25

In just a few days, Boston will be buzzing as the Splunk team and thousands of community members come together ...