LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 04-07-2009, 06:03 PM   #1
sezam2
LQ Newbie
 
Registered: Feb 2009
Posts: 22

Rep: Reputation: 15
Unhappy syslog-ng does not nwrite in the database


i use syslog-ng 2.0

Hi
in my syslog-ng server i can write log comming from the client to a file


Code:
source mysrc{ tcp(ip(0.0.0.0) port(514) keep-alive(yes));
    #udp();
     };

    destination std {


     file("/var/log/syslog-ng1/$HOST/messages" owner("root") group("root") perm(0640) dir_perm(0750) create_dirs(yes));

    };


    log {source(mysrc); destination(std);};

    destination std1 {
    udp("192.168.1.66" port(514));

    };
    #filter my_filter {match("Apache"); };


    #log {
      #    source(mysrc);
    #        filter(my_filter);
     #     destination(std);
    #};


    log {
            source(mysrc);

            destination(std1);
    };
but when i use a pipe

Code:
    destination d_mysql {
     pipe("/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));
    };
    log { source(mysrc); destination(d_mysql);
the wired thing is that when i :
1 runed the script that binds the pipe to the database

./mysql.bash&
# !/bin/bash
if [ -e /tmp/mysql.pipe ]; then
while [ -e /tmp/mysql.pipe ]
do
mysql -u root -D syslog< /tmp/mysql.pipe
done
else
mkfifo /tmp/mysql.pipe
fi

2 created a test sql script
request.sql
INSERT INTO logs (host, facility, priority, level, tag, date, time, program, msg) VALUES ( 'testhost1', 'testfacility1', 'testpriority1', '0','TestTag1', '2009-04-07', '19:00:00', 'Apache', 'Test Message' );


3 injected it into the pipe
cat request.sql > /tmp/mysql.pipe

4 tetsted a select * from tags;
i found the values on request.sql

strange isn't it?

so what can i do
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
syslog-ng -> syslog-ng logging, how to troubleshoot sir-lancealot Linux - Server 1 01-24-2009 06:07 AM
LXer: OpenLDAP Quick Tips: Using syslog or syslog-ng with slapd for OpenLDAP logging LXer Syndicated Linux News 0 11-14-2008 08:41 PM
I need help getting syslog to log remotely, this is just the regular syslog. abefroman Linux - Software 2 06-05-2008 11:36 AM
syslog client to log to syslog-ng and itself noir911 Linux - Server 1 02-08-2008 09:51 AM
LXer: Centralized Syslog Server Using syslog-NG LXer Syndicated Linux News 0 04-28-2006 06:21 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 06:47 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration