Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 22 additions & 3 deletions apis/fluentbit/v1alpha2/plugins/parser/logfmt_types.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package parser

import (
"fmt"

"github.com/fluent/fluent-operator/v3/apis/fluentbit/v1alpha2/plugins"
"github.com/fluent/fluent-operator/v3/apis/fluentbit/v1alpha2/plugins/params"
)
Expand All @@ -9,12 +11,29 @@ import (

// The logfmt parser allows to parse the logfmt format described in https://brandur.org/logfmt . <br />
// **For full documentation, refer to https://docs.fluentbit.io/manual/pipeline/parsers/logfmt**
type Logfmt struct{}
type Logfmt struct {
// Time_Key
TimeKey string `json:"timeKey,omitempty"`
// Time_Format, eg. %Y-%m-%dT%H:%M:%S %z
TimeFormat string `json:"timeFormat,omitempty"`
// Time_Keep
TimeKeep *bool `json:"timeKeep,omitempty"`
}

func (_ *Logfmt) Name() string {
return "logfmt"
}

func (_ *Logfmt) Params(_ plugins.SecretLoader) (*params.KVs, error) {
return nil, nil
func (l *Logfmt) Params(_ plugins.SecretLoader) (*params.KVs, error) {
kvs := params.NewKVs()
if l.TimeKey != "" {
kvs.Insert("Time_Key", l.TimeKey)
}
if l.TimeFormat != "" {
kvs.Insert("Time_Format", l.TimeFormat)
}
if l.TimeKeep != nil {
kvs.Insert("Time_Keep", fmt.Sprint(*l.TimeKeep))
}
return kvs, nil
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion apis/fluentbit/v1alpha2/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,16 @@ spec:
type: object
logfmt:
description: Logfmt defines logfmt parser configuration.
properties:
timeFormat:
description: Time_Format, eg. %Y-%m-%dT%H:%M:%S %z
type: string
timeKeep:
description: Time_Keep
type: boolean
timeKey:
description: Time_Key
type: string
type: object
x-kubernetes-validations:
- message: logfmt must not be null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,16 @@ spec:
type: object
logfmt:
description: Logfmt defines logfmt parser configuration.
properties:
timeFormat:
description: Time_Format, eg. %Y-%m-%dT%H:%M:%S %z
type: string
timeKeep:
description: Time_Keep
type: boolean
timeKey:
description: Time_Key
type: string
type: object
x-kubernetes-validations:
- message: logfmt must not be null
Expand Down
10 changes: 10 additions & 0 deletions config/crd/bases/fluentbit.fluent.io_clusterparsers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,16 @@ spec:
type: object
logfmt:
description: Logfmt defines logfmt parser configuration.
properties:
timeFormat:
description: Time_Format, eg. %Y-%m-%dT%H:%M:%S %z
type: string
timeKeep:
description: Time_Keep
type: boolean
timeKey:
description: Time_Key
type: string
type: object
x-kubernetes-validations:
- message: logfmt must not be null
Expand Down
10 changes: 10 additions & 0 deletions config/crd/bases/fluentbit.fluent.io_parsers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,16 @@ spec:
type: object
logfmt:
description: Logfmt defines logfmt parser configuration.
properties:
timeFormat:
description: Time_Format, eg. %Y-%m-%dT%H:%M:%S %z
type: string
timeKeep:
description: Time_Keep
type: boolean
timeKey:
description: Time_Key
type: string
type: object
x-kubernetes-validations:
- message: logfmt must not be null
Expand Down
10 changes: 10 additions & 0 deletions docs/plugins/fluentbit/parser/logfmt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Logfmt

The logfmt parser allows to parse the logfmt format described in https://brandur.org/logfmt . <br /> **For full documentation, refer to https://docs.fluentbit.io/manual/pipeline/parsers/logfmt**


| Field | Description | Scheme |
| ----- | ----------- | ------ |
| timeKey | Time_Key | string |
| timeFormat | Time_Format, eg. %Y-%m-%dT%H:%M:%S %z | string |
| timeKeep | Time_Keep | *bool |
20 changes: 20 additions & 0 deletions manifests/setup/fluent-operator-crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11093,6 +11093,16 @@ spec:
type: object
logfmt:
description: Logfmt defines logfmt parser configuration.
properties:
timeFormat:
description: Time_Format, eg. %Y-%m-%dT%H:%M:%S %z
type: string
timeKeep:
description: Time_Keep
type: boolean
timeKey:
description: Time_Key
type: string
type: object
x-kubernetes-validations:
- message: logfmt must not be null
Expand Down Expand Up @@ -39981,6 +39991,16 @@ spec:
type: object
logfmt:
description: Logfmt defines logfmt parser configuration.
properties:
timeFormat:
description: Time_Format, eg. %Y-%m-%dT%H:%M:%S %z
type: string
timeKeep:
description: Time_Keep
type: boolean
timeKey:
description: Time_Key
type: string
type: object
x-kubernetes-validations:
- message: logfmt must not be null
Expand Down
20 changes: 20 additions & 0 deletions manifests/setup/setup.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11093,6 +11093,16 @@ spec:
type: object
logfmt:
description: Logfmt defines logfmt parser configuration.
properties:
timeFormat:
description: Time_Format, eg. %Y-%m-%dT%H:%M:%S %z
type: string
timeKeep:
description: Time_Keep
type: boolean
timeKey:
description: Time_Key
type: string
type: object
x-kubernetes-validations:
- message: logfmt must not be null
Expand Down Expand Up @@ -39981,6 +39991,16 @@ spec:
type: object
logfmt:
description: Logfmt defines logfmt parser configuration.
properties:
timeFormat:
description: Time_Format, eg. %Y-%m-%dT%H:%M:%S %z
type: string
timeKeep:
description: Time_Keep
type: boolean
timeKey:
description: Time_Key
type: string
type: object
x-kubernetes-validations:
- message: logfmt must not be null
Expand Down
Loading