fluent / fluentd

Fluentd: Unified Logging Layer (project under CNCF)
https://www.fluentd.org
Apache License 2.0
12.88k stars 1.34k forks source link

Docker fluentd multiline #2071

Closed info-samir closed 6 years ago

info-samir commented 6 years ago

Hello, I want just use fluend multiline with log coming from docker I use fluentd 0.12

Configuration :

<source>
  @type forward
  port 24224
  bind 0.0.0.0

</source>
<filter **>
  @type parser
  format multiline
  format_firstline /^\d{4}-\d{1,2}-\d{1,2}/
  format1 /^(?<time>\d{4}-\d{1,2}-\d{1,2}) /
  key_name log
</filter>
<match **>
  @type stdout
</match>

docker compose config :

    logging:
      driver: fluentd
      options:
        fluentd-address: "myip:24224"

Application stacktrace :

2018-07-13 16:21:51.659 2979 [main] ERROR org.springframework.boot.SpringApplication [] - Application startup failed
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'adminController'
    at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:749) ~[spring-beans-4.3.12.RELEASE.jar:4.3.12.RELEASE]
    at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:189) ~[spring-beans-4.3.12.RELEASE.jar:4.3.12.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1193) ~[spring-beans-4.3.12.RELEASE.jar:4.3.12.RELEASE]

Sample Error in stdout :

 pattern not match with data '"\tat fr.stime.hermes.talaria.aggregator.Application.main(Application.java:45) [classes!/:0.1.0-SNAPSHOT]"'

Can you help me please ?

repeatedly commented 6 years ago

parser plugin doesn't support multiline parser for multiple records because parser plugin is stateless. See official document: https://docs.fluentd.org/container-deployment/docker-logging-driver#additional-step-2-concatenate-multiple-lines-log-messages

repeatedly commented 6 years ago

And this is a question. Github issue is not for questions. Closed.

fullee commented 4 years ago

@info-samir I met this same problem, how did you solve it