-
Notifications
You must be signed in to change notification settings - Fork 220
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: chengdehao <dehaocheng@yunify.com>
- Loading branch information
Showing
9 changed files
with
131 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
api/fluentbitoperator/v1alpha2/plugins/filter/multiline_types.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package filter | ||
|
||
import ( | ||
"kubesphere.io/fluentbit-operator/api/fluentbitoperator/v1alpha2/plugins" | ||
"kubesphere.io/fluentbit-operator/api/fluentbitoperator/v1alpha2/plugins/params" | ||
) | ||
|
||
// +kubebuilder:object:generate:=true | ||
|
||
// 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 Inline struct helps to concatenate messages that originally belong to one context but were split across multiple records or log lines. | ||
*Multi `json:",inline"` | ||
} | ||
|
||
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"` | ||
//Key name that holds the content to process. | ||
//Note that a Multiline Parser definition can already specify the key_content to use, but this option allows to overwrite that value for the purpose of the filter. | ||
KeyContent string `json:"keyContent,omitempty"` | ||
} | ||
|
||
func (_ *Multiline) Name() string { | ||
return "multiline" | ||
} | ||
|
||
func (m *Multiline) Params(_ plugins.SecretLoader) (*params.KVs, error) { | ||
kvs := params.NewKVs() | ||
if m.Multi != nil { | ||
if m.Multi.Parser != "" { | ||
kvs.Insert("multiline.parser", m.Multi.Parser) | ||
} | ||
if m.Multi.KeyContent != "" { | ||
kvs.Insert("multiline.key_content", m.Multi.KeyContent) | ||
} | ||
} | ||
return kvs, nil | ||
} |
20 changes: 20 additions & 0 deletions
20
api/fluentbitoperator/v1alpha2/plugins/filter/zz_generated.deepcopy.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Multiline | ||
|
||
The Multiline Filter helps to concatenate messages that originally belong to one context but were split across multiple records or log lines. Common examples are stack traces or applications that print logs in multiple lines. | ||
|
||
|
||
| Field | Description | Scheme |Default| | ||
| ----- | ----------- | ------ | -----| | ||
| multiline.parser | Specify one or multiple Multiline Parser definitions to apply to the content. You can specify multiple multiline parsers to detect different formats by separating them with a comma. | string || | ||
| multiline.key_content| Key name that holds the content to process. Note that a Multiline Parser definition can already specify the key_content to use, but this option allows to overwrite that value for the purpose of the filter. | string || |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters