parser p_apache {
csv-parser(
columns(
"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")
flags(escape-none,escape-backslash,escape-double-char,escape-double-char,strip-whitespace)
delimiters(" ")
quote-pairs('""[]')
);
};
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")
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")
indexes("1", "2", "3", "4", "5", "6", "7", "8","9","10"));
};
destination d_apache_me { file("/var/log/test.me.log"); };
filter f_apache_edata { facility(local6) and program(
test.me); };
log { source(s_sys); parser(p_apache); filter(f_apache_edata); destination(d_apache_mysql); };