The logged messages can be dispatched according to their facility, urgency,program name and/or Perl-compatible regular expressions. Log files can be automatically rotated when they exceed a certain size or age. External shell scripts ex: mail) can be launched when specific patterns are found.
De eerste optie met de facility en urgency levels ziet er bijvoorbeeld zo uit:
code:
1
2
3
4
| Kernel messages :
facility = "kern"
logdir = "/var/log/kernel" |
De tweede optie met programma namen ziet er zo uit:
code:
1
2
3
| Smart :
program = "smartd"
logdir = "/var/log/smart" |
En met reguliere expressies:
code:
1
2
3
4
5
6
7
| Password failures :
regex = "(password|login|authentication)\s+(fail|invalid)"
regex = "(failed|invalid)\s+(password|login|authentication)"
regex = "ILLEGAL ROOT LOGIN"
logdir = "/var/log/pwdfail"
# command = "/usr/local/sbin/mail_pwd_failures.sh" |
Je zou dus eerst en /var/log/everything/* kunnen kijken hoe het programma heet en dan ergens naartoe laten loggen, of reguliere expressies erop loslaten om het op te delen. Ik weet zo niet naar welke facility IPtables logt, maar als je dat weet zou je ook daarop kunnen loggen.
Let er wel op dat metalog cached en je dus een "killall -USR1 metalog" moet geven om dat (tijdelijk) uit te schakelen.
En dan "killall -USR2 metalog" om het weer in te schakelen.
Voor de zekerheid zou ik ook als root "/etc/init.d/metalog restart" doen.
edit:
Wat je dus boven "logdir = "/var/log/vuurmuur" moet zetten is iig een naam met dubbele punt (vraag me niet waarvoor metalog die gebruikt?) en "facility = "kern""
edit2:
op de
homepage van metalog heb ik iig kunnen
lezen waarvoor die naam met dubbele punt nodig is:
code:
1
2
| - A title (useless for the software, it's just to make your configuration
file look better) . |
en nog wat voorbeeldjes:
code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
| Here's a list of values that can be independently assigned for each section :
* minimum = <level> : only record a message if its urgency is inferior or
equal to <level> . Level '0' is the most critical one, while level '7' is for
debugging messages. 'minimum = 5' will strip all non-important messages. The
default minimum level is 7 (ie. keep all messages) .
Example : record only critical messages to /var/log/important :
Critical messages :
facility = "*"
minimum = 1
logdir = "/var/log/important"
* facility = <facility> : only record a message if the application that
issued it uses syslog facility <facility> . Facility names are : "auth",
"authpriv", "cron", "daemon", "ftp", "kern", "lpr", "mail", "news",
"security", "syslog", "user", "uucp", "local0", "local1" ... "local7" .
All kernel messages are logged with facility "kern". A section can have
several "facility = ..." lines to match more than one facility.
Example : record all authentication messages to /var/log/auth :
Authentication messages :
facility = "auth"
facility = "authpriv"
logdir = "/var/log/auth" |