View previous topic :: View next topic |
Author |
Message |
Sephirot Tux's lil' helper
Joined: 09 Jun 2004 Posts: 124 Location: Milano
|
Posted: Mon Aug 21, 2006 5:47 pm Post subject: [Risolto]Problema con sintassi di syslog-bg.conf |
|
|
Salve,
stavo smanettando con il file di configurazione di syslog in modo da avere i messaggi relativi a sshd in un file a parte chiamato ssh.log.
Quindi ho aggiunto una filtro:
Code: | # Syslog-ng default configuration file for Gentoo Linux
# contributed by Michael Sterrett
#options
chain_hostnames(off);
sync(0);
# The default action of syslog-ng 1.6.0 is to log a STATS line
# to the file every 10 minutes. That's pretty ugly after a while.
# Change it to every 12 hours so you get a nice daily update of
# how many messages syslog-ng missed (0).
stats(43200);
};
#sorgenti
source src { unix-stream("/dev/log"); internal(); pipe("/proc/kmsg"); };
#destinazioni
destination messages { file("/var/log/messages"); };
destination console_all { file("/dev/tty12"); };
destination sshlog { file("/var/log/ssh.log"); };
#filtri
filter f_ssh { match("sshd"); };
#log = filtri + destinazioni
log { source(src); destination(messages); };
log { source(src); destination(console_all); };
log { source(src); filter(f_ssh); (destination(ssh); };
|
Adesso quando vado a riavviare syslog-ng mi dice:
Code: | arcadia sephi # /etc/init.d/syslog-ng start
syntax error at 7
Parse error reading configuration file, exiting. (line 7)
* Configuration error. Please fix your configfile (/etc/syslog-ng/syslog-ng.conf) |
Ma la riga 7 non l'ho toccata e non capisco dove sia l'errore. _________________ "Gentoo is more educational than mainstream distros. It encourages you to look under the hood and effectively turns a lot of n00bs into l33ts."
resistence is futile
(if < 1 ohm)
Last edited by Sephirot on Tue Aug 22, 2006 12:17 am; edited 1 time in total |
|
Back to top |
|
|
.:chrome:. Advocate
Joined: 19 Feb 2005 Posts: 4588 Location: Brescia, Italy
|
Posted: Mon Aug 21, 2006 6:14 pm Post subject: Re: Problema con sintassi di syslog-bg.conf |
|
|
esperimento: prova a commentare sync(0); |
|
Back to top |
|
|
Sephirot Tux's lil' helper
Joined: 09 Jun 2004 Posts: 124 Location: Milano
|
Posted: Mon Aug 21, 2006 6:35 pm Post subject: |
|
|
niente, solito problema alla riga 7.
Thanks cmq. _________________ "Gentoo is more educational than mainstream distros. It encourages you to look under the hood and effectively turns a lot of n00bs into l33ts."
resistence is futile
(if < 1 ohm) |
|
Back to top |
|
|
.:chrome:. Advocate
Joined: 19 Feb 2005 Posts: 4588 Location: Brescia, Italy
|
Posted: Mon Aug 21, 2006 6:51 pm Post subject: |
|
|
la questione è che la riga 7 è vuota
probabilmente ignora le righe con i commenti, quindi la riga 7 è in realtà la settima riga nn commentata |
|
Back to top |
|
|
klaimath Apprentice
Joined: 18 Jun 2006 Posts: 213
|
Posted: Mon Aug 21, 2006 6:57 pm Post subject: Re: Problema con sintassi di syslog-bg.conf |
|
|
Code: |
options {
chain_hostnames(off);
sync(0);
# The default action of syslog-ng 1.6.0 is to log a STATS line
# to the file every 10 minutes. That's pretty ugly after a while.
# Change it to every 12 hours so you get a nice daily update of
# how many messages syslog-ng missed (0).
stats(43200);
};
|
Saluti
Klaimath |
|
Back to top |
|
|
Sephirot Tux's lil' helper
Joined: 09 Jun 2004 Posts: 124 Location: Milano
|
Posted: Tue Aug 22, 2006 12:14 am Post subject: |
|
|
Si e' vero! Grazie mille!
Ora funziona perfettamente, in realta' c'erano anche un altro paio di correzioni da apportare, per chi fosse interessato posto qui il file di conf di syslog-sn. Per ora "screma" i log di sshd in un file che ho chiamato ssh.log. Ma si puo' facilmente aggiungere qualsiasi altro tipo di filtro
Code: | # Syslog-ng default configuration file for Gentoo Linux
# contributed by Michael Sterrett
options {
chain_hostnames(off);
sync(0);
# The default action of syslog-ng 1.6.0 is to log a STATS line
# to the file every 10 minutes. That's pretty ugly after a while.
# Change it to every 12 hours so you get a nice daily update of
# how many messages syslog-ng missed (0).
stats(43200);
};
#sorgenti
source src { unix-stream("/dev/log"); internal(); pipe("/proc/kmsg"); };
#destinazioni
destination messages { file("/var/log/messages"); };
destination console_all { file("/dev/tty12"); };
destination ssh { file("/var/log/ssh.log"); };
#filtri
filter f_ssh { match("sshd"); };
#log = filtri + destinazioni
log { source(src); destination(messages); };
log { source(src); destination(console_all); };
log { source(src); filter(f_ssh); destination(ssh); };
|
_________________ "Gentoo is more educational than mainstream distros. It encourages you to look under the hood and effectively turns a lot of n00bs into l33ts."
resistence is futile
(if < 1 ohm) |
|
Back to top |
|
|
|