Syslog-ng to parse message to mysql in separate column
$10-30 USD
Geschlossen
Veröffentlicht vor fast 4 Jahren
$10-30 USD
Bezahlt bei Lieferung
Please only apply if you have confident about it to accomplish.
I am using syslog-ng on a ubuntu machine.I am getting all the log as a message on mysql db.
This is how i am receiving the message DST_RTR forward: in:<pppoe-user1> out:vlan100-Default-Internet, src-mac 11:22:33:44:55:66, proto TCP (ACK,FIN), [login to view URL]:42670->[login to view URL], NAT ([login to view URL]:42670->9.9.9.9:42670)->[login to view URL], len 52
Now i want to separate this messages in different column like- time,username,src mac,src ip,dst ip, nat ip to save it on mysql. And also i want to save log in a temp folder and parse them to mysql separately with the required column with crontab or maybe a php script? I have seen some xml script regarding parsing data separably to mysql .Maybe this can be achieve with xml. But Not sure.
Hi,
This can be achieved with shell script. You may need a different table to hold the splitted fields. Shell script can handle mysql data easily. By the way i would also like to verify the syslog-ng configuration as it allows to log seperate fields.
Thanks
Hi,
I am confident that I can write a PHP script to extract data to different columns as per your requirements.
Please send me few sample messages i.e 15 messages or so, so that I can test my script.
I am confident because I have done this kind of project very recently which was to extract data from SMTP server's log file and save it in mysql db.
Let me know if you have any question.
Regards
Suresh
I'm system Engineer with more 15 years of experience. In that 15 years I management different kind of S.O Linux, Windows and Unix such as: Debian, Ubuntu, Centos and Red Hat. But I feel good with Linux. Also I have programmed different scripts in Bash, Perl and Python. I read all requirements, I’m ready to start now. Write or hire me to discuss about this project.