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
add multiline filter plugin #176
Conversation
// The Multiline Filter helps to concatenate messages that originally belong to one context but were split across multiple records or log lines. | ||
type Multiline struct { | ||
// The Multi struct helps to concatenate messages that originally belong to one context but were split across multiple records or log lines. | ||
Multi *Multi `json:"multiline,omitempty"` |
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.
What is the purpose of multi
?
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.
Because its arguments are multiline.parser
and multiline.key_content
. So I created a structure so that I could add new parameters.
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.
The mutil
is not optional, the omitempty should be deleted.
Maybe inline
is more suitable for multi
?
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.
Sorry, I am not clear about it. I mean Mutil
should be inline
type.
type Multiline struct {
*Multi `json:",inline"`
}
|
||
func (m *Multiline) Params(_ plugins.SecretLoader) (*params.KVs, error) { | ||
kvs := params.NewKVs() | ||
if m.Multi.KeyContent != "" { |
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.
It needs to determine whether the mutil
is empty here.
type Multi struct { | ||
// Specify one or multiple Multiline Parsing definitions to apply to the content. | ||
//You can specify multiple multiline parsers to detect different formats by separating them with a comma. | ||
Parser string `json:"parser,omitempty"` |
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.
The parser
is not optional, the omitempty
should be deleted.
// The Multiline Filter helps to concatenate messages that originally belong to one context but were split across multiple records or log lines. | ||
type Multiline struct { | ||
// The Multi struct helps to concatenate messages that originally belong to one context but were split across multiple records or log lines. | ||
Multi *Multi `json:"multiline,omitempty"` |
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.
The mutil
is not optional, the omitempty should be deleted.
Maybe inline
is more suitable for multi
?
Signed-off-by: chengdehao <dehaocheng@yunify.com>
What this PR dose?
Adds support for https://docs.fluentbit.io/manual/pipeline/filters/multiline-stacktrace filter plugin
Why we need it?
Fluentbit supports a variety of plug-ins, but not all fluentbit-operator adaptations. More plug-ins will be supported in the future, see the fields supported by the multiline plug-in
The final results
The configuration is written to secret
Signed-off-by: chengdehao <dehaocheng@yunify.com