Pigri <pappdav@gmail.com> writes:
I have problem for Centos 6.Rebuild syslog-ng package for epel repo, because not have SQL support.
There is SQL support, it's just your config that's not entirely correct.
Error:
The number of columns and values do not match; len_columns='10', len_values='11'
This tells exactly what the problem is: you have 10 columns specified in the config (1-10), but 11 values. Add a 11th column, and all will be fine.
destination d_apache_mysql { sql(type(mysql) host("localhost") username("root") password("xxxxx") database("data") table("accesslog") columns("1", "2", "3", "4", "5", "6", "7", "8","9","10")
10 columns...
values("$APACHE.CLIENT_IP","$APACHE.IDENT_NAME","$APACHE.USER_NAME","$APACHE.TIMESTAMP","$APACHE.REQUEST_URL","$APACHE.REQUEST_STATUS","$APACHE.CONTENT_LENGTH","$APACHE.REFERER","$APACHE.USER_AGENT","$APACHE.VIRTUAL_HOST","$APACHE.SERVER_NAME")
11 values. The number of items in the columns() and values() options MUST be the same, otherwise syslog-ng can't construct a valid SQL insert statement.
indexes("1", "2", "3", "4", "5", "6", "7", "8","9","10"));
If you index every column, that will be slow as a snail. -- |8]