You need to convert the ip address to an integer. This is done to increase performance so instead of searching for a string field, you are searching for an integer. To do this you will need to use the inet_aton() internal MySQL function. If you have an insert to load data in the database.. you can use something like the following:
INSERT INTO logs (host, facility, priority, level, tag, timestamp, program, msg) VALUES ( INET_ATON('$HOST'), '$FACILITY', '$PRIORITY', '$LEVEL', '$TAG', '$YEAR-$MONTH-$DAY $HOUR:$MIN:$SEC', '$PROGRAM', '$MSG')
More information about this:
http://dev.mysql.com/doc/refman/5.0/en/miscellaneous-functions.html
Cheers,
Jeff