Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

root_agent flush labels #1508

Merged
merged 1 commit into from Mar 21, 2017
Merged

Conversation

tatsu-yam
Copy link
Contributor

fluentd v0.12 cannot send a USR1 signal to the output instances in the label sections, so that it can not flush parts of the buffers.
This patch solves it.

before:

$ ./bin/fluentd -c fluent.conf
2017-03-19 16:52:08 +0900 [info]: reading config file path="fluent.conf"
2017-03-19 16:52:08 +0900 [info]: starting fluentd-0.12.33
2017-03-19 16:52:08 +0900 [info]: gem 'fluent-plugin-elasticsearch' version '1.3.0'
2017-03-19 16:52:08 +0900 [info]: gem 'fluentd' version '0.12.19'
2017-03-19 16:52:08 +0900 [info]: adding match in @fuga pattern="fuga" type="file"
2017-03-19 16:52:08 +0900 [info]: adding match pattern="hoge" type="file"
2017-03-19 16:52:08 +0900 [info]: adding match pattern="fuga" type="relabel"
2017-03-19 16:52:08 +0900 [info]: adding source type="forward"
2017-03-19 16:52:08 +0900 [info]: using configuration file: <ROOT>
  <source>
    @type forward
  </source>
  <match hoge>
    @type file
    path /tmp/hoge
    time_slice_format %Y%m%d
    buffer_path /tmp/hoge.*
  </match>
  <match fuga>
    @type relabel
    @label @fuga
  </match>
  <label @fuga>
    <match fuga>
      @type file
      path /tmp/fuga
      time_slice_format %Y%m%d
      buffer_path /tmp/fuga.*
    </match>
  </label>
</ROOT>
2017-03-19 16:52:08 +0900 [info]: listening fluent socket on 0.0.0.0:24224
...
2017-03-19 16:57:07 +0900 [info]: force flushing buffered events

$ echo '{"msg":"this is test"}' |./bin/fluent-cat hoge
$ ls -l /tmp/hoge.20170319.b54b109ecfa4c00f1
-rw-r--r-- 1 tatsu-yam tatsu-yam 54  3 19 16:47 /tmp/hoge.20170319.b54b109ecfa4c00f1

$ echo '{"msg":"this is test"}' |./bin/fluent-cat fuga
$ ls -l /tmp/fuga.20170319.b54b10a1c81f12693
-rw-r--r-- 1 tatsu-yam tatsu-yam 54  3 19 16:48 /tmp/fuga.20170319.b54b10a1c81f12693

$ kill -USR1 xxx
$ ls -l /tmp/ |egrep 'hoge|fuga'
-rw-r--r-- 1 tatsu-yam tatsu-yam  54  3 19 16:48 fuga.20170319.b54b10a1c81f12693
-rw-r--r-- 1 tatsu-yam tatsu-yam  54  3 19 16:49 hoge.20170319_0.log

after:

$ kill -USR1 xxx
$ ls -l /tmp/ |egrep 'hoge|fuga'
-rw-r--r-- 1 tatsu-yam tatsu-yam  54  3 19 16:57 fuga.20170319_0.log
-rw-r--r-- 1 tatsu-yam tatsu-yam  54  3 19 16:57 hoge.20170319_0.log

This problem has already solved in fluentd v0.14.

@repeatedly repeatedly merged commit d8df66c into fluent:v0.12 Mar 21, 2017
@repeatedly
Copy link
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants