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 (
9
9
10
10
// The logfmt parser allows to parse the logfmt format described in https://brandur.org/logfmt . <br />
11
11
// **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
+ }
13
20
14
21
func (_ * Logfmt ) Name () string {
15
22
return "logfmt"
16
23
}
17
24
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
20
37
}
You can’t perform that action at this time.
0 commit comments