-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Backport #1492 to v0.12 #1495
Backport #1492 to v0.12 #1495
Conversation
lib/fluent/parser.rb
Outdated
@@ -549,6 +553,26 @@ def configure(conf) | |||
super | |||
|
|||
@regexp = @with_priority ? REGEXP_WITH_PRI : REGEXP |
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.
Can we remove this line?
lib/fluent/parser.rb
Outdated
end | ||
|
||
def parse_auto(text, &block) | ||
if @message_format == :auto |
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.
We can remove this condition because parse_auto
is not called directly.
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.
Oh! I've overlooked this. 😖
Commented. I will merged this patch after applied reviews. |
`@message_format` is always :auto in #parse_auto.
lib/fluent/parser.rb
Outdated
class << self | ||
alias_method :parse, :parse_plain | ||
end | ||
REGEXP_RFC5424 |
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.
Assigning @time_format = @rfc5424_time_format
is needed when time_format
is not set by user?
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.
Ah! Your suggestion means that we should set @time_format
in the following situation?
@time_format = @rfc5424_time_format unless @time_format
It is reasonable for me.
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 time_format has default value for now.
So there are two approaches:
- Change time_format's default to
nil
and set each default time_format inmessage_format
condition - Use conf.has_key?('time_format')
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 want to choose conf.has_key?('time_format')
approach.
I re-checked the code and I have one question. Commented it. |
Thanks! |
I've added in 223d249. |
Thanks! |
No description provided.