Skip to content

Fluentd does not flush its buffer to the file output #3760

Answered by hadrian08
hadrian08 asked this question in Q&A
Discussion options

You must be logged in to vote

Figured it out eventually; it requires the buffer section in order to write to the specified file and flush on shutdown; also needed it to be close to real time.

<source>
  @type forward
  port 9090
  bind 0.0.0.0
  tag myTag
  <security>
    self_hostname my-host
    shared_key shared-key
  </security>
</source>

<match myTag>
  @type file 
  path c:\logs\test.log
  append true
    <format>
      @type json
      output_tag false
    </format>
    <buffer>
       flush_mode interval
       flush_interval 5s
       flush_at_shutdown true
    </buffer>
</match>

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by hadrian08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant