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
Ultra Champion

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
Ultra Champion

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
Ultra Champion

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
Get Updates on the Splunk Community!

Security Professional: Sharpen Your Defenses with These .conf25 Sessions

Sooooooooooo, guess what. .conf25 is almost here, and if you're on the Security Learning Path, this is your ...

First Steps with Splunk SOAR

Our first step was to gather a list of the playbooks we wanted and to sort them by priority.  Once this list ...

How To Build a Self-Service Observability Practice with Splunk Observability Cloud

If you’ve read our previous post on self-service observability, you already know what it is and why it ...