Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I have an iptables firewall in Linux bridge (RHEL5). I want to extract information like IP address, port number, port type, date and time, etc. from log messages using a Bash script, and then want to upload it to a MySQL database to generate the reports.

How can I do this? Is there any way to accomplish the same thing?

share|improve this question
2  
I suspect you'll get a better response from Stack Overflow. –  Tshepang Dec 8 '10 at 11:28
add comment

1 Answer

If you're using syslog-ng, there is a great guide here. He sets up a queue: syslog-ng writes to it, and he has a consumer that reads from it and performs an SQL insert.

If you are using rsyslogd, it has native support for mysql, but I'd still recommend the message-passing method of the first article; especially if you have high traffic spikes since the database insert takes a substantial amount of time (comparatively).

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.