+ Logging, Syslog and Log Anaylsys Forums » Forums » Syslog & syslogd » syslog-ng
|-+ 

syslog-ng on AIX

Username:
Password:
News:

Pages: [1]
0 Members and 1 Guest are viewing this topic. Topic Tools  
Read October 01, 2008, 02:21:59 pm #0
jdenver47

syslog-ng on AIX

I have a server running AIX 5.3 and I have installed syslog-ng and Mysql on it. I want to send syslog-ng messages to mysql database. But Its not working. Here is my syslog-ng.conf file

#
# sample configuration file for syslog-ng on AIX
# users should customize to fit their needs
#

# log syslog-ng's own messages to /var/log/syslog-ng.log

source s_internal {
        internal();
};

destination d_syslognglog {
        file("/var/log/syslog-ng.log" owner("root") group("adm") perm(0640));
};

log {
        source(s_internal);
        destination(d_syslognglog);
};

# log everything to /var/log/messages

source s_local {
        unix-dgram("/dev/log");
};

destination d_messages {
        file("/var/log/messages" owner("root") group("adm") perm(0640));
};

log {
        source(s_local);
        destination(d_messages);
};

# Configure syslog-ng to log to mysql database using fifo template

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(s_local); destination(d_mysql); };


#source src { unix-stream("/dev/log"); internal(); };
#source net { udp(); };
#
#


After making the necessary modifications I have restarted syslog-ng and here is the script I am running to pipe the messages

#!/usr/bin/ksh

if [ -e /tmp/mysql.pipe ]; then
while [ -e /tmp/mysql.pipe ]
do
/usr/local/mysql/bin/mysql -u root  --password=start123  syslog < /tmp/mysql.pipe
done
else
mkfifo /tmp/mysql.pipe
fi

I AM NOT ABLE TO FIGURE OUT THE ISSUE....


Offline  
Pages: [1]
Jump to:  


Information Security News | Jerry Bell's blog | Enterprise IT | Tropical Fish Information | Tropical Fish Forums