Comments (2)
You don't need to change BlockCountries to write a new logfile. But you do need to change $LOG for the analysis to work if you change the file name or location.
The actual log entry is created by the kernel (netfilter).
To get output sent to another logfile, you need to configure the syslog daemon on your system.
There are a couple of them, depending on your distribution (and your choices). The most basic is syslogd
; another popular one is rsyslogd
.
rsyslogd
will give you more choices, you can filter on the log prefix [Blocked CC]:
I recommend it.
Edit /etc/syslog.conf
, /etc/rsyslogd.conf
, or /etc/rsyslog.d/iptables.conf
-- see man syslog.conf
or rsyslog.conf
You'll also need to update logrotate
- or whatever you use to manage your log files.
Finally, you do need to update $LOG
in BlockCountries so that it can read it when you ask for analysis. The '*' at the end of the filename is important. It allows BlockCountries to look at log files that have been rotated.
There's a pretty good general description of how to do this (not BlockCountries -specific) at https://blog.shadypixel.com/log-iptables-messages-to-a-separate-file-with-rsyslog/
Google will turn up other tutorials and other syslogd alternatives.
The latest release of BlockCountries allows you to set $LOGLEVEL
to a non-default priority level, which may help with syslog filtering. However, because the kernel generates so many different message types and every priority is used by someone, you're better off using rsyslogd to filter.
The values for $LOGLEVEL
are defined by syslog
; usually 0-6 (or as names, EMERGENCY, ALERT, CRITICAL,ERROR,WARNING,NOTICE,INFORMATIONAL, and DEBUG)
As a practical matter, only NOTICE or INFORMATIONAL are useful.
from blockcountries.
Since I haven't heard from you in a week, I assume you are satisfied. I'm closing this issue.
In the future, please indicate whether issues that you raised are addressed satisfactorily and close your issues when they are.
Thanks.
from blockcountries.
Related Issues (19)
- A MASSIVE THANKYOU HOT 1
- centos 5.11 only issue HOT 31
- Question/feature: Whitelist option HOT 1
- Update your script not only the IP database HOT 2
- Problem starting on Ubuntu Server HOT 4
- Rules update failed HOT 3
- just a question HOT 1
- iptables-restore: line 42189 failed
- Still maintaining? Error on fetching IP zone data
- script needs an update!! HOT 1
- failed service start
- IP's from Ukraine not working HOT 3
- Some countries are not being blocked HOT 6
- Recent releases were not visible on github
- Startup issues HOT 3
- little help just to be sure HOT 39
- Log file issue HOT 15
- dns question HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from blockcountries.