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

time_format configure #3571

Closed VuongAnnh closed 2 years ago

VuongAnnh commented 2 years ago

Describe the bug

I have prolem with time zone log fluend!

when i run any service and fluentd service. fulend was able to get the service's log but the log time is incorrect time displayed on log is path + time + ".log" (testlog.19700101_0.log)

image

To Reproduce

version: '3.7' networks: microservicesnet: services: fluentd: container_name: fluentd user: root image: fluent/fluentd:v1.13.0-1.1 restart: always ports:

Expected behavior

Your Environment

- Fluentd version:1.13.0

Your Configuration

 <source>
  @type tail
  format json
  read_from_head true
  tag docker

  path /fluentd/log/containers/*/*-json.log
  pos_file /tmp/container-logs.pos
</source>

<match docker>
  @type file
  path /output/testlog
  utc
  # time_slice_format %Y%m%d
  # time_slice_wait 10m
  # time_format %Y%m%dT%H%M%S%z
  # compress gzip
</match>

Your Error Log

1970-01-01T00:33:41Z docker {"log":"2021-12-09 08:45:03 +0000 [info]: #0 fluentd worker is now running worker=0\n","stream":"stdout"} 1970-01-01T00:33:41Z docker {"log":"\n","stream":"stdout","attrs":{"tag":"docker.eureka"}} 1970-01-01T00:33:41Z docker {"log":" . _ _ \n","stream":"stdout","attrs":{"tag":"docker.eureka"}} 1970-01-01T00:33:41Z docker {"log":" /\\ / '_ () \ \ \ \\n","stream":"stdout","attrs":{"tag":"docker.eureka"}} 1970-01-01T00:33:41Z docker {"log":"( ( )\ | ' | '| | ' \/ ` | \ \ \ \\n","stream":"stdout","attrs":{"tag":"docker.eureka"}} 1970-01-01T00:33:41Z docker {"log":" \\/ _)| |)| | | | | || (| | ) ) ) )\n","stream":"stdout","attrs":{"tag":"docker.eureka"}} 1970-01-01T00:33:41Z docker {"log":" ' |__| .|| ||| |\, | / / / /\n","stream":"stdout","attrs":{"tag":"docker.eureka"}} 1970-01-01T00:33:41Z docker {"log":" =========|_|==============|__/=////\n","stream":"stdout","attrs":{"tag":"docker.eureka"}} 1970-01-01T00:33:41Z docker {"log":" :: Spring Boot :: (v2.3.12.RELEASE)\n","stream":"stdout","attrs":{"tag":"docker.eureka"}} 1970-01-01T00:33:41Z docker {"log":"\n","stream":"stdout","attrs":{"tag":"docker.eureka"}}

Additional context

No response

VuongAnnh commented 2 years ago

after configure fluent.conf file time is correct but not automatically generate log file..only show file buffer.xxxxxx.log

image

Log image

dioguerra commented 2 years ago

This seems to be a problem with your configuration file. Did you manage to solve this?

VuongAnnh commented 2 years ago

This seems to be a problem with your configuration file. Did you manage to solve this? log file was generated after a day. 👍