We help IT Professionals succeed at work.
Get Started

Exporting Linux Log File to MYSQL

BlakeGriffin
BlakeGriffin asked
on
749 Views
Last Modified: 2012-05-09
I have a DHCP server that is logging DHCP to a separate log file in the format at the end of this post.  Currently, I use the built in functionality of rsyslog to write to a mysql database and view with the phpLogCon front end.  This is not my ideal implementation and am looking for suggestions to accomplish the following:

1.  The phpLogCon lumps the whole description into one field in the database.  I want to have a database in which the type, ipaddress, MAC, AID, CID, and event logged into seperate fields.  
2. phpLogCon and rsyslog templates/schema would need to be modified to do this, but am unsure on how to do this.
3.  I want to remove the standard ack, request, release, expired vents from the mysql database.  How can I do this?
4.  Is the rysyslog and phpLogCon route the best option or should I look for another route.  If so, what should this be?

DHCP log format:


Jun 14 14:56:02 ltcdhcp-desktop dhcpd: ==> STB Lease 172.16.112.51 from MAC 1:0:3:e6:b:3e:ad assigned to AID: CO TEST CID: --- has committed
Jun 14 14:56:02 ltcdhcp-desktop dhcpd: DHCPREQUEST for 172.16.112.51 from 00:03:e6:0b:3e:ad via eth1
Jun 14 14:56:02 ltcdhcp-desktop dhcpd: DHCPACK on 172.16.112.51 to 00:03:e6:0b:3e:ad via eth1
Jun 14 14:56:04 ltcdhcp-desktop dhcpd: ==> DATA Lease 206.10.75.28 from MAC 1:0:1b:38:7a:57:e9 assigned to AID: CO TEST CID: --- has committed
Jun 14 14:56:04 ltcdhcp-desktop dhcpd: DHCPREQUEST for 206.10.75.28 from 00:1b:38:7a:57:e9 (SHOOTER07) via eth1
Jun 14 14:56:04 ltcdhcp-desktop dhcpd: DHCPACK on 206.10.75.28 to 00:1b:38:7a:57:e9 (SHOOTER07) via eth1
Comment
Watch Question
This problem has been solved!
Unlock 1 Answer and 4 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE