You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When used in conjunction with an input plugin that changes how it calls parse() depending on the value of parser_type(), it receives a value that's outside PARSER_TYPES, namely string or regexp rather than say :text_per_line
I reproduced this with input_exec input plugin, which falls back to calling parse() with the entire input buffer if the parser plugin doesn't return :text_per_line from parser_type(). This causes the parser to get confused (all lines end up in the message) if the exec exits, or seems to completely not parse anything if the exec'd process is long-running (presumably because the fallback buffer relies on the exec'd command exiting before it passes the buffer over).
To Reproduce
This config standalone is enough to reproduce the issue:
These plugins accept a parameter `plugin_type` but it hides the parent
class's method `Fluent::Plugin::Parser#parser_type`, it causes
unexpected behavior on a plugin which uses this method such as in_exec.
Fixfluent#3296
Signed-off-by: Takuro Ashie <[email protected]>
Describe the bug
The parser_syslog plugin accepts a parameter
parser_type
(equal tostring
orregexp
):fluentd/lib/fluent/plugin/parser_syslog.rb
Line 59 in 436c7da
This configuration key has a naming conflict with a method that's also called
parser_type
defined here:fluentd/lib/fluent/plugin/parser.rb
Line 104 in 436c7da
When used in conjunction with an input plugin that changes how it calls
parse()
depending on the value ofparser_type()
, it receives a value that's outsidePARSER_TYPES
, namelystring
orregexp
rather than say:text_per_line
I reproduced this with input_exec input plugin, which falls back to calling
parse()
with the entire input buffer if the parser plugin doesn't return:text_per_line
fromparser_type()
. This causes the parser to get confused (all lines end up in the message) if the exec exits, or seems to completely not parse anything if the exec'd process is long-running (presumably because the fallback buffer relies on the exec'd command exiting before it passes the buffer over).To Reproduce
This config standalone is enough to reproduce the issue:
Expected behavior
The above config should output:
Instead it outputs:
Your Environment
Your Configuration
Similar to the above, though with a different command that's long-running and streams syslog.
Your Error Log
The text was updated successfully, but these errors were encountered: