syslog.cong
syslog.cong
hi,
ich habe ein problem mit dem syslogd und iptables.
ich nutze zuhause einen linux-sevrer, der auch gut mit firewall tut.
einzigstes problem: wenn ich was loggen will, bekomme ich das alles in die messages-datei geschrieben.
ich hätte aber gern alles nach z.B. /var/log/iptables_log.
meine eigentliche Frage:
was genau muss ich in der syslog angeben, dass er mir alle einträge, die z.B. mit "iptableslog" beginnen in ne andere datei filtert?
ist das dann was in der richtung von:
kern.ip_tables /var/log/iptables_log
oder liege ich da ganz falsch?
danke für antwort im vorraus :-)
~pseudo
PS: ich glaub, ich steh da irgendwie total auf'm schlauch :-/
ich habe ein problem mit dem syslogd und iptables.
ich nutze zuhause einen linux-sevrer, der auch gut mit firewall tut.
einzigstes problem: wenn ich was loggen will, bekomme ich das alles in die messages-datei geschrieben.
ich hätte aber gern alles nach z.B. /var/log/iptables_log.
meine eigentliche Frage:
was genau muss ich in der syslog angeben, dass er mir alle einträge, die z.B. mit "iptableslog" beginnen in ne andere datei filtert?
ist das dann was in der richtung von:
kern.ip_tables /var/log/iptables_log
oder liege ich da ganz falsch?
danke für antwort im vorraus :-)
~pseudo
PS: ich glaub, ich steh da irgendwie total auf'm schlauch :-/
-
captaincrunch
- Userprojekt

- Posts: 7066
- Joined: 2002-10-09 14:30
- Location: Dorsten
- Contact:
Re: syslog.cong
DebianHowTo
echo "[q]sa[ln0=aln256%Pln256/snlbx]sb729901041524823122snlbxq"|dc
echo "[q]sa[ln0=aln256%Pln256/snlbx]sb729901041524823122snlbxq"|dc
Re: syslog.cong
In other words, setting kern.=info /var/log/iptables in your syslog.conf file and then letting all your LOG messages in iptables use log level info, would make all messages appear in the /var/log/iptables file. Note that there may be other messages here as well from other parts of the kernel that uses the info priority. For more information on logging I recommend you to read the syslog and syslog.conf man-pages as well as other HOWTOs etc.
soweit war ich schonmal.
vor 10 minz.
das iss ja das problem.
kann man in der syslog.conf nicht nach regulären ausdrücken filtern oder so ähnlich?
soweit war ich schonmal.
vor 10 minz.
das iss ja das problem.
kann man in der syslog.conf nicht nach regulären ausdrücken filtern oder so ähnlich?
Re: syslog.cong
achso, hab ich fast vergessen :-D
ist denn der info-log-level nicht die regel?
ich bin noch nich so 100%ig firm, mit der log-geschichte.
man möge mir verzeihen :-)
ist denn der info-log-level nicht die regel?
ich bin noch nich so 100%ig firm, mit der log-geschichte.
man möge mir verzeihen :-)
-
captaincrunch
- Userprojekt

- Posts: 7066
- Joined: 2002-10-09 14:30
- Location: Dorsten
- Contact:
Re: syslog.cong
Nö, iirc nicht mit dem "normalen" syslogd. metalog und (AFAIK) syslog-ng können sowas.
Alternativ nimm halt eine andere Log-Facilty.
Alternativ nimm halt eine andere Log-Facilty.
DebianHowTo
echo "[q]sa[ln0=aln256%Pln256/snlbx]sb729901041524823122snlbxq"|dc
echo "[q]sa[ln0=aln256%Pln256/snlbx]sb729901041524823122snlbxq"|dc
Re: syslog.cong
halt mich bitte nich für dumm weil ich so viel frage...
aber welche facilitie soll ich denn nehmen?
die, die in der syslogd-man-page angegeben sind,
haben mit iptables nämlich nicht so viel zu tun :-/
(so sieht es mal für mich aus...)
aber welche facilitie soll ich denn nehmen?
die, die in der syslogd-man-page angegeben sind,
haben mit iptables nämlich nicht so viel zu tun :-/
(so sieht es mal für mich aus...)
Re: syslog.cong
Ich hab es ma noch grad rausgesucht:
The facility is one of the following keywords:
auth, authpriv, cron, daem
on, kern, lpr, mail, mark, news, security (same as auth),
sysÂlog, user, uucp and local0 through local7.
The facility is one of the following keywords:
auth, authpriv, cron, daem
on, kern, lpr, mail, mark, news, security (same as auth),
sysÂlog, user, uucp and local0 through local7.
-
captaincrunch
- Userprojekt

- Posts: 7066
- Joined: 2002-10-09 14:30
- Location: Dorsten
- Contact:
Re: syslog.cong
In dem Fall bieten sich die locals doch geradezu an, oder? ;)
DebianHowTo
echo "[q]sa[ln0=aln256%Pln256/snlbx]sb729901041524823122snlbxq"|dc
echo "[q]sa[ln0=aln256%Pln256/snlbx]sb729901041524823122snlbxq"|dc
Re: syslog.cong
bittebittebitte schreib n beispiel, ich raff es nich *g
Re: syslog.cong
Man kann keine iptables-Lognachrichten auf andere Facilities umleiten. Alle Logmeldungen laufen über den Kernel und damit zwangsläufig in die Facility kern.
Eine Möglichkeit ist es dagegen, statt LOG das ULOG (Userspace LOG) Target zu nutzen. Dazu ist zusätzlich der ulogd notwendig, der dann AFAIK von einem Socket liest. Howtos dazu kenne ich allerdings nicht.
Eine Möglichkeit ist es dagegen, statt LOG das ULOG (Userspace LOG) Target zu nutzen. Dazu ist zusätzlich der ulogd notwendig, der dann AFAIK von einem Socket liest. Howtos dazu kenne ich allerdings nicht.
-
captaincrunch
- Userprojekt

- Posts: 7066
- Joined: 2002-10-09 14:30
- Location: Dorsten
- Contact:
Re: syslog.cong
Warum sagt mir dann das o.g. Howto etwas anderes? ;)Man kann keine iptables-Lognachrichten auf andere Facilities umleiten. Alle Logmeldungen laufen über den Kernel und damit zwangsläufig in die Facility kern.
DebianHowTo
echo "[q]sa[ln0=aln256%Pln256/snlbx]sb729901041524823122snlbxq"|dc
echo "[q]sa[ln0=aln256%Pln256/snlbx]sb729901041524823122snlbxq"|dc
Re: syslog.cong
Wie genau willst du denn das Ganze mit dem LOG Target in die Facility local0 leiten? Es geht nicht. netfilter ist ein Teil des Kernels, insofern gehen alle Meldungen durch den Kernel und kommen im syslog in der kern-Facility 'raus.
-
captaincrunch
- Userprojekt

- Posts: 7066
- Joined: 2002-10-09 14:30
- Location: Dorsten
- Contact:
Re: syslog.cong
Oh mann, manchmal sollte ich Sachen wirklich besser erstmal ausprobieren, bevor ich sie hier groß anpreise. Du hast natürlich absolut Recht, kern-Meldung bleibt kern-Meldung. :oops:
DebianHowTo
echo "[q]sa[ln0=aln256%Pln256/snlbx]sb729901041524823122snlbxq"|dc
echo "[q]sa[ln0=aln256%Pln256/snlbx]sb729901041524823122snlbxq"|dc
Re: syslog.cong
Syslog-ng:
Code: Select all
...
destination iptables { file("/var/log/iptables.log"); };
filter f_iptables { match("IN="); };
log { source(src); filter(f_iptables); destination(iptables); };
...
PayPal.Me/JoeUser ● FreeBSD Remote Installation
Wings for Life ● Wings for Life World Run
„If there’s more than one possible outcome of a job or task, and one
of those outcomes will result in disaster or an undesirable consequence,
then somebody will do it that way.“ -- Edward Aloysius Murphy Jr.
Wings for Life ● Wings for Life World Run
„If there’s more than one possible outcome of a job or task, and one
of those outcomes will result in disaster or an undesirable consequence,
then somebody will do it that way.“ -- Edward Aloysius Murphy Jr.
Re: syslog.cong
also mit dem syslog-ng bah ich noch nichts zu tun gehabt, aber hab den gestern mal installiert.
ich teste das ganze mal und tipp euch n nette feedback, wenn ich was haben sollte oder hänge :o)
ich teste das ganze mal und tipp euch n nette feedback, wenn ich was haben sollte oder hänge :o)
Re: syslog.cong
also das tut.
bleibt nur die frage, wie ich es nun erreiche,
dass in messages nix mehr von iptables drinnsteht...
(was ja das eigentliche prob war...)
bleibt nur die frage, wie ich es nun erreiche,
dass in messages nix mehr von iptables drinnsteht...
(was ja das eigentliche prob war...)
Re: syslog.cong
also so tut es :o) *freu*:
/etc/syslog-ng/syslog-ng.conf - folgendes kam dazu
#zum schreiben von ip-tables in eigene log-datei
destination iptables { file("/var/log/iptables.log"); };
filter f_iptables { match("IN="); };
log { source(src); filter(f_iptables); destination(iptables); };
#damit in messages nichts mit iptables reingeschrieben wird
#das hier
destination messages { file("/var/log/messages"); };
log { source(src); filter(f_messages); destination(messages); };
#nach dem hier ändern:
destination messages { file("/var/log/messages"); };
filter f_messages {match("!IN="); };
log { source(src); filter(f_messages); destination(messages); };
danke nochmal an alle :-)
/etc/syslog-ng/syslog-ng.conf - folgendes kam dazu
#zum schreiben von ip-tables in eigene log-datei
destination iptables { file("/var/log/iptables.log"); };
filter f_iptables { match("IN="); };
log { source(src); filter(f_iptables); destination(iptables); };
#damit in messages nichts mit iptables reingeschrieben wird
#das hier
destination messages { file("/var/log/messages"); };
log { source(src); filter(f_messages); destination(messages); };
#nach dem hier ändern:
destination messages { file("/var/log/messages"); };
filter f_messages {match("!IN="); };
log { source(src); filter(f_messages); destination(messages); };
danke nochmal an alle :-)
