-
Notifications
You must be signed in to change notification settings - Fork 247
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
[WIP] feat: add multiline parser support for fluentbit #842
Conversation
// +genclient:nonNamespaced | ||
|
||
// ClusterMultilineParser is the Schema for the cluster-level multiline parser API | ||
type ClusterMultilineParser struct { |
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.
Why need to create a new CRD? I think multiline Parser is also a kind of Parser
, it can use Parser CRD.
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 section for multiline parser is
[MULTILINE_PARSER]
instead of[PARSER]
- multiline parser is not located under Parsers in fluentbit doc
i agree with the idea that it's better to treat multiline parser as one kind of parsers as well.
but it seems like currently it's not implemented like this from fluentbit's perspective. it's also reasonable to follow the convention of fluentbit so that customers won't get confused.
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.
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. so i propose to add one new field called parsersFiles
to support multiple parsers_file
in SERVICE
section, and keep parsersFile
for backward compatibility: https://github.com/fluent/fluent-operator/pull/842/files#diff-7aad9bf9eeeaa93f3a61c5ea93ea5a30d57bcfa6307ec4ea188222fdf69f438cR180 in case customers want to add parsers.conf and parsers_multiline.conf at the same time.
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.
@wanjunlei would you review this again?
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.
So how to set the ClusterFluentBitConfig
when I define a MultilineParser
and want to use it?
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 for the late reply. i'll have an E2E test tomorrow.
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.
- fix rbac for new crd
- inline for
MultilineParser
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.
how to set the ClusterFluentBitConfig when I define a MultilineParser and want to use it
apiVersion: fluentbit.fluent.io/v1alpha2
kind: ClusterFluentBitConfig
metadata:
labels:
app.kubernetes.io/name: fluent-bit
name: fluent-bit-config
spec:
filterSelector:
matchLabels:
fluentbit.fluent.io/enabled: "true"
inputSelector:
matchLabels:
fluentbit.fluent.io/enabled: "true"
multilineparserSelector:
matchLabels:
fluentbit.fluent.io/enabled: "true"
outputSelector:
matchLabels:
fluentbit.fluent.io/enabled: "true"
parserSelector:
matchLabels:
fluentbit.fluent.io/enabled: "true"
service:
logLevel: info
parsersFile: parsers_multiline.conf
apiVersion: fluentbit.fluent.io/v1alpha2
kind: ClusterMultilineParser
metadata:
labels:
fluentbit.fluent.io/component: logging
fluentbit.fluent.io/enabled: "true"
name: stacktrace
spec:
flushTimeout: 1000
rules:
- next: cont
regex: /([a-zA-Z]+ \d+ \d+\:\d+\:\d+)(.*)/
start: start_state
- next: cont
regex: /^\s+at.*/
start: cont
type: regex
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.
By default, the parsersFile
in ClusterFluentBitConfig
is parsers.conf
, And it points to /fluent-bit/etc/parsers.conf which include the common parsers such as docker
, cri
. If it was set to parsers_multiline.conf
, the fluentbit cannot find these parsers.
BTW, if the parsersFile
in ClusterFluentBitConfig
is a relative path, the fluentbit will find it in the directory where the fluentbit configuration file is located, which is /fluent-bit/etc/
, but the parsers_multiline.conf
is in /fluent-bit/config/
.
Maybe you should handle the parsers_multiline.conf
like parsers.conf
1382b7a
to
2b0bbbc
Compare
e0ef681
to
08cb6a3
Compare
@@ -41,6 +41,8 @@ type FluentBitConfigSpec struct { | |||
OutputSelector metav1.LabelSelector `json:"outputSelector,omitempty"` | |||
// Select parser plugins | |||
ParserSelector metav1.LabelSelector `json:"parserSelector,omitempty"` | |||
// Select multiline parser plugins | |||
MultilineParserSelector metav1.LabelSelector `json:"multilineparserSelector,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.
MultilineParserSelector metav1.LabelSelector `json:"multilineparserSelector,omitempty"` | |
MultilineParserSelector metav1.LabelSelector `json:"multilineParserSelector,omitempty"` |
@ksdpmx Hi Jason, would you resolve the conflicts and conversation remains? |
@benjaminhuo |
@ksdpmx looking forward multiline feature, could you please find time to resolve conflicts. |
@ksdpmx Do you have any updates when you will have time to resolve these conflicts, this is a feature I would be very interested also. Thanks. |
|
Hi, @ksdpmx do you need any help with this task? |
Hi, @ksdpmx! Also interested in this feature. How can I help you? |
Signed-off-by: jasonz <ksdpmx@gmail.com>
Signed-off-by: Alex Krasnov <askrasnov@gmail.com>
Signed-off-by: Alex Krasnov <askrasnov@gmail.com>
Hi everybody!
|
I think you can resubmit a pull request to this repository. There are too many commits here, which makes it a bit confusing. After reviewing the code, I noticed that you are treating 'multiline' as a resource to watch, and I don't think it's the best approach in this regard (it could be my misunderstanding). I suggest you submit a pull request so that we can discuss and explore alternative solutions together." |
(cherry picked from commit 9005e1b)
@ksdpmx are you able to look at this? :) |
some internal team is also interested in this feature.. allow me few hours to catch with the context this time.. |
8d3f00d
to
e6e7b19
Compare
97d0608
to
e0c5675
Compare
Signed-off-by: jasonz <ksdpmx@gmail.com>
e0c5675
to
132b2df
Compare
Merge pull request #1 from shturval-tech/multiline_parser Signed-off-by: jasonz <ksdpmx@gmail.com>
4835723
to
a445c9d
Compare
so here's the new one #1100. |
Finished in #1100, close this for now |
What this PR does / why we need it:
currently users cannot setup custom multiline parser via operator.
and there're many unsupported fields for multiline parser in filter
Which issue(s) this PR fixes:
Fixes #176 and #336
Does this PR introduced a user-facing change?
Additional documentation, usage docs, etc.: