Hi, I'm maintainer of fluent-plugin-grok-parser.
I've checked your configuration in my environment.
But I'm not familiar with Java.
Main.java:
import java.util.HashMap;
import java.util.Map;
import org.fluentd.logger.FluentLogger;
public class Main {
private static FluentLogger LOG = FluentLogger.getLogger("demo");
/**
* @param args
*/
public static void main(String[] args) {
Map<String, Object> data = new HashMap<String, Object>();
String message =
"ERROR org.apache.tomcat.jdbc.pool.ConnectionPool - Unable to create initial connections of pool.\n"
+ "org.postgresql.util.PSQLException: The connection attempt failed.\n"
+ " at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:249)\n"
+ " at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:66)\n"
+ " at org.postgresql.jdbc2.AbstractJdbc2Connection.<init>(AbstractJdbc2Connection.java:127)";
data.put("log", message);
LOG.log("logger", data);
}
}
Fluentd output:
2016-05-13 14:51:39 +0900 demo.logger: {"log":"ERROR org.apache.tomcat.jdbc.pool.ConnectionPool - Unable to create initial connections of pool.\norg.postgresql.util.PSQLException: The connection attempt failed.\n at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:249)\n at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:66)\n at org.postgresql.jdbc2.AbstractJdbc2Connection.<init>(AbstractJdbc2Connection.java:127)","log_level":"ERROR","logger":"org.apache.tomcat.jdbc.pool.ConnectionPool","message":"Unable to create initial connections of pool.\norg.postgresql.util.PSQLException: The connection attempt failed.\n at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:249)\n at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:66)\n at org.postgresql.jdbc2.AbstractJdbc2Connection.<init>(AbstractJdbc2Connection.java:127)"}
BTW, you can use fluent-plugin-concat If you want to concatenate multiple lines messages separated in multiple events.
Thanks.
2016年5月12日木曜日 22時04分54秒 UTC+9 Marco Pas: