-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
[pkg/stanza] Clean up split package #26544
[pkg/stanza] Clean up split package #26544
Conversation
96dc63f
to
6df4bb6
Compare
6df4bb6
to
81eaee7
Compare
MaxConcurrentFiles int `mapstructure:"max_concurrent_files,omitempty"` | ||
MaxBatches int `mapstructure:"max_batches,omitempty"` | ||
DeleteAfterRead bool `mapstructure:"delete_after_read,omitempty"` | ||
SplitConfig split.Config `mapstructure:"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.
We are not going to change how it's exposed to end-user as multiline
, right?
Is there any other use cases where this config is being used? I mean where it's actually used for splitting rather then multiline which is rather combining.
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.
Right, this doesn't change the user facing config at all.
Is there any other use cases where this config is being used? I mean where it's actually used for splitting rather then multiline which is rather combining?
I'm not aware of any other uses outside of pkg/stanza.
I think the word "multiline" is a bit of a misnomer. What is really meant here is "splitting based on something other than newlines". This can mean splitting out multiple logs from one line, or reading in a single log that spans multiple lines. Either way, it is concerned more with splitting than combining. (The recombine operator is more directly meant for "combining" logs.)
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.
Ok, I'm wondering if we can pick a word that works for splitting and combining so it can be exposed to the user with the same word but nothing good comes to my mind
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.
Hmm, not sure I agree that we should indicate combining here either way. It's all about splitting, just a question of whether we split on newlines or something else.
In terms of the actual term exposed to users in the config, I think multiline is not ideal, but in my experience it's been much more common to find logs that span multiple lines vs having multiple logs in a single line, so multiline is at least descriptive of the more common case. And of course logs that are naturally separated by newlines don't require configuration of the multiline section at all.
Subset of #26241
Follows #26540
MultilineConfig
tosplit.Config
Multiline
, previously a struct representation that only wrapped a split funcNewMultilineConfig
, becausesplit.Config
is just two simple fields with "" defaults.split
package.