What ver of syslog-ng are u running? The dbName, dbPassword, and dbUsername are stored in the script and that script then takes the input from the mysql.pipe, or from the command line mysql -u root --password=passwd syslog < /tmp/mysql.pipe Look the scripts,, http://www.vermeer.org/syslog/scripts michael
cat_roger22@hotmail.com 09/24/02 08:13AM >>> Hi *, I didn't understood the posts on the mailing list about the entryes inserted into syslog-db, I've some questions:
destination d_mysql { pipe("/var/chroot/syslog-ng/tmp/mysql.pipe" template("INSERT INTO logs (host, facility, priority, level, tag, date, time, program, msg) VALUES ( '$HOST', '$FACILITY', '$PRIORITY', '$LEVEL', '$TAG', '$YEAR-$MONTH-$DAY', '$HOUR:$MIN:$SEC', '$PROGRAM', '$MSG' );\n") template_escape(yes)); }; I verified the conf file with "-s" option and it didn't returned any error. The Db works fine and I noticed that other people have the same problem...What is the solution ? ...And... Where is set the DB name variable ?...in a conf file I suppose....but where is that ? I Activated the debug option but the output was : gc_mark: Marking object of class 'UNKNOWN' (1) I see the same output even if I don't use mysql option.... Ciao _______________________________________________ syslog-ng maillist - syslog-ng@lists.balabit.hu https://lists.balabit.hu/mailman/listinfo/syslog-ng Frequently asked questions at http://www.campin.net/syslog-ng/faq.html
Thanks for support. This is a new point of view: #!/usr/bin/perl #----------------------------------------------------------------------- --------- $|=1; use DBI; use strict; $ENV{'DBI_DSN'}='syslog'; $ENV{'DBI_USER'}='root'; $ENV{'DBI_PASS'}='mysqladmin'; $ENV{'DBI_TABLE_SYSLOG'}='logs'; $ENV{'DBI_PIPE_SYSLOG'}='/var/chroot/syslog-ng/tmp/mysql.pipe'; my $DB_SB='mysql'; my $test_dsn = $ENV{'DBI_DSN'} || die "DSN not set\n"; my $test_user = $ENV{'DBI_USER'} || die "User not set\n"; my $test_password = $ENV{'DBI_PASS'} || die "Password not set\n"; my $table = $ENV{'DBI_TABLE_SYSLOG'} || die "Table not set\n"; my $pipe = $ENV{'DBI_PIPE_SYSLOG'} || die "Pipe file not set\n"; my $DATA_SOURCE='dbi:mysql:'.$test_dsn; my $dbh; my $riga; $dbh = DBI->connect($DATA_SOURCE, $test_user, $test_password, {RaiseError => 1,PrintError => 2}) or die "Can\'t connect: $DBI::errstr\n"; #print STDOUT "Connect to $DATA_SOURCE... done\n"; open(FF,"$pipe") || die "Error on read pipe $pipe\n"; while($riga=<FF>) { #print STDOUT "$riga\n"; $dbh->do($riga) or warn "WARN; Errore nel do\n"; #$dbh->commit; #$sth = $dbh->prepare($q)); #$sth->execute(); } close(FF); $dbh->disconnect() or die "ERROR on close: $DBI::errstr\n"; #print STDOUT "Disconnect to $DATA_SOURCE... done\n"; #----------------------------------------------------------------------- ------------ #End #----------------------------------------------------------------------- ------------ -----Original Message----- From: syslog-ng-admin@lists.balabit.hu [mailto:syslog-ng-admin@lists.balabit.hu] On Behalf Of Michael Earls Sent: Tuesday, September 24, 2002 3:18 PM To: syslog-ng@lists.balabit.hu Subject: Re: [syslog-ng]MYSQL problem What ver of syslog-ng are u running? The dbName, dbPassword, and dbUsername are stored in the script and that script then takes the input from the mysql.pipe, or from the command line mysql -u root --password=passwd syslog < /tmp/mysql.pipe Look the scripts,, http://www.vermeer.org/syslog/scripts michael
cat_roger22@hotmail.com 09/24/02 08:13AM >>> Hi *, I didn't understood the posts on the mailing list about the entryes inserted into syslog-db, I've some questions:
destination d_mysql { pipe("/var/chroot/syslog-ng/tmp/mysql.pipe" template("INSERT INTO logs (host, facility, priority, level, tag, date, time, program, msg) VALUES ( '$HOST', '$FACILITY', '$PRIORITY', '$LEVEL', '$TAG', '$YEAR-$MONTH-$DAY', '$HOUR:$MIN:$SEC', '$PROGRAM', '$MSG' );\n") template_escape(yes)); }; I verified the conf file with "-s" option and it didn't returned any error. The Db works fine and I noticed that other people have the same problem...What is the solution ? ...And... Where is set the DB name variable ?...in a conf file I suppose....but where is that ? I Activated the debug option but the output was : gc_mark: Marking object of class 'UNKNOWN' (1) I see the same output even if I don't use mysql option.... Ciao _______________________________________________ syslog-ng maillist - syslog-ng@lists.balabit.hu https://lists.balabit.hu/mailman/listinfo/syslog-ng Frequently asked questions at http://www.campin.net/syslog-ng/faq.html
participants (2)
-
_/CaT\_
-
Michael Earls