File tree Expand file tree Collapse file tree 1 file changed +20
-3
lines changed
apis/fluentbit/v1alpha2/plugins/parser Expand file tree Collapse file tree 1 file changed +20
-3
lines changed Original file line number Diff line number Diff line change @@ -9,12 +9,29 @@ import (
99
1010// The logfmt parser allows to parse the logfmt format described in https://brandur.org/logfmt . <br />
1111// **For full documentation, refer to https://docs.fluentbit.io/manual/pipeline/parsers/logfmt**
12- type Logfmt struct {}
12+ type Logfmt struct {
13+ // Time_Key
14+ TimeKey string `json:"timeKey,omitempty"`
15+ // Time_Format, eg. %Y-%m-%dT%H:%M:%S %z
16+ TimeFormat string `json:"timeFormat,omitempty"`
17+ // Time_Keep
18+ TimeKeep * bool `json:"timeKeep,omitempty"`
19+ }
1320
1421func (_ * Logfmt ) Name () string {
1522 return "logfmt"
1623}
1724
18- func (_ * Logfmt ) Params (_ plugins.SecretLoader ) (* params.KVs , error ) {
19- return nil , nil
25+ func (j * Logfmt ) Params (_ plugins.SecretLoader ) (* params.KVs , error ) {
26+ kvs := params .NewKVs ()
27+ if l .TimeKey != "" {
28+ kvs .Insert ("Time_Key" , l .TimeKey )
29+ }
30+ if l .TimeFormat != "" {
31+ kvs .Insert ("Time_Format" , l .TimeFormat )
32+ }
33+ if l .TimeKeep != nil {
34+ kvs .Insert ("Time_Keep" , fmt .Sprint (* l .TimeKeep ))
35+ }
36+ return kvs , nil
2037}
You can’t perform that action at this time.
0 commit comments