-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Create new out file plugins only for secondary #1154
Create new out file plugins only for secondary #1154
Conversation
This is new plugin only for <secondary> section.
769ae75
to
b169908
Compare
7dd7218
to
486c0d8
Compare
486c0d8
to
a6a1d11
Compare
@@ -55,7 +55,11 @@ class BufferChunkOverflowError < BufferError; end # A record size is larger than | |||
# if chunk size (or records) is 95% or more after #write, then that chunk will be enqueued | |||
config_param :chunk_full_threshold, :float, default: DEFAULT_CHUNK_FULL_THRESHOLD | |||
|
|||
Metadata = Struct.new(:timekey, :tag, :variables) | |||
Metadata = Struct.new(:timekey, :tag, :variables) do | |||
def nil? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ruby's document says that "Only the object nil responds true to nil?".
This method breaks it. Change this method name to something else, like empty?
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I changed this method name empty?
https://github.com/fluent/fluentd/pull/1154/files#diff-7d794f77abc9222413b9120533cff327R59
assert_equal 'out_file_test', d.instance.basename | ||
assert_equal TMP_DIR, d.instance.directory | ||
assert_equal :gzip, d.instance.compress | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto.
I added review comments. |
8c7d4c7
to
dcb294a
Compare
* Add `directory` and `basename` config_pa rams(Remove `path` config_params) * Do not support a path that includes "*" * Add placeholder regex test * Do not use chunk_id as path name(pass default name) * Remove `gz` of compress type * Fix some typos
dcb294a
to
a1f5a10
Compare
a1f5a10
to
cbc1f1f
Compare
@tagomoris |
".gz" | ||
end | ||
|
||
test_path = generate_path(File.join(@directory, Time.now.strftime("%Y%m%d"))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
test_path
loses @basename
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. But test_path
is used for a test that directory is writable or not.
I think it is reasonable that test_path
loses @basename
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are there any positive reason not to use @basename
for this test?
@basename
might contain /
... (users do everything possible).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@basename
might contain /... (users do everything possible).
I didn't care about it.
I added a test for it.
And I use basename
as test_path
I found that |
I wrote a test that directory has placeholders ( https://github.com/fluent/fluentd/pull/1154/files#diff-39910dc690f56dd659cdccdca103e55aR417 ) and this test passed. If configuration is like I think it is good enough to check. |
@ganmacs Ah, I misread the code... you're right. |
Merged! It'll be released as v0.14.5. Thank you! |
This explanation is missing since the beginning. * https://github.com/fluent/fluentd/blob/master/CHANGELOG.md#release-v0145---20160906 * fluent/fluentd#1154 Signed-off-by: Daijiro Fukuda <[email protected]>
Consider points
This plugins's name is
out_secondary_file
now.It may be too verbose.
I think supporting
compress
andappend
params.Not for this PR tasks
Close #873