Skip to content

Commit

Permalink
Merge pull request #423 from JanNemcik/patch-1
Browse files Browse the repository at this point in the history
Added support for Time_Offset parameter in regex parser
  • Loading branch information
benjaminhuo authored Oct 17, 2022
2 parents 1324fe3 + 432765d commit b4efc09
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 2 deletions.
9 changes: 7 additions & 2 deletions apis/fluentbit/v1alpha2/plugins/parser/regex_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@ type Regex struct {
// Time_Format, eg. %Y-%m-%dT%H:%M:%S %z
TimeFormat string `json:"timeFormat,omitempty"`
// Time_Keep
TimeKeep *bool `json:"timeKeep,omitempty"`
Types string `json:"types,omitempty"`
TimeKeep *bool `json:"timeKeep,omitempty"`
// Time_Offset, eg. +0200
TimeOffset string `json:"timeOffset,omitempty"`
Types string `json:"types,omitempty"`
}

func (_ *Regex) Name() string {
Expand All @@ -39,6 +41,9 @@ func (re *Regex) Params(_ plugins.SecretLoader) (*params.KVs, error) {
if re.TimeKeep != nil {
kvs.Insert("Time_Keep", fmt.Sprint(*re.TimeKeep))
}
if re.TimeOffset != "" {
kvs.Insert("Time_Offset", re.TimeOffset)
}
if re.Types != "" {
kvs.Insert("Types", re.Types)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,9 @@ spec:
timeKey:
description: Time_Key
type: string
timeOffset:
description: Time_Offset, eg. +0200
type: string
types:
type: string
type: object
Expand Down
3 changes: 3 additions & 0 deletions config/crd/bases/fluentbit.fluent.io_clusterparsers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,9 @@ spec:
timeKey:
description: Time_Key
type: string
timeOffset:
description: Time_Offset, eg. +0200
type: string
types:
type: string
type: object
Expand Down
1 change: 1 addition & 0 deletions docs/plugins/fluentbit/clusterparser/regex.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ The regex parser plugin
| timeKey | Time_Key | string |
| timeFormat | Time_Format, eg. %Y-%m-%dT%H:%M:%S %z | string |
| timeKeep | Time_Keep | *bool |
| timeOffset | Time_Offset eg. +0200 | string |
| types | | string |
3 changes: 3 additions & 0 deletions manifests/setup/fluent-operator-crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5535,6 +5535,9 @@ spec:
timeKey:
description: Time_Key
type: string
timeOffset:
description: Time_Offset, eg. +0200
type: string
types:
type: string
type: object
Expand Down
3 changes: 3 additions & 0 deletions manifests/setup/setup.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5535,6 +5535,9 @@ spec:
timeKey:
description: Time_Key
type: string
timeOffset:
description: Time_Offset, eg. +0200
type: string
types:
type: string
type: object
Expand Down

0 comments on commit b4efc09

Please sign in to comment.