Skip to content

Commit

Permalink
fix fluentbit operator not support Time_Key_Nanos field bug
Browse files Browse the repository at this point in the history
  • Loading branch information
root committed Mar 24, 2022
1 parent 2885c57 commit 190bb88
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 0 deletions.
5 changes: 5 additions & 0 deletions apis/fluentbit/v1alpha2/plugins/output/elasticsearch_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ type Elasticsearch struct {
TimeKey string `json:"timeKey,omitempty"`
// When Logstash_Format is enabled, this property defines the format of the timestamp.
TimeKeyFormat string `json:"timeKeyFormat,omitempty"`
// When Logstash_Format is enabled, enabling this property sends nanosecond precision timestamps.
TimeKeyNanos *bool `json:"timeKeyNanos,omitempty"`
// When enabled, it append the Tag name to the record.
IncludeTagKey *bool `json:"includeTagKey,omitempty"`
// When Include_Tag_Key is enabled, this property defines the key name for the tag.
Expand Down Expand Up @@ -173,6 +175,9 @@ func (es *Elasticsearch) Params(sl plugins.SecretLoader) (*params.KVs, error) {
if es.TimeKeyFormat != "" {
kvs.Insert("Time_Key_Format", es.TimeKeyFormat)
}
if es.TimeKeyNanos != nil {
kvs.Insert("Time_Key_Nanos", fmt.Sprint(*es.TimeKeyNanos))
}
if es.IncludeTagKey != nil {
kvs.Insert("Include_Tag_Key", fmt.Sprint(*es.IncludeTagKey))
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,10 @@ spec:
description: When Logstash_Format is enabled, this property defines
the format of the timestamp.
type: string
timeKeyNanos:
description: When Logstash_Format is enabled, enabling this property
sends nanosecond precision timestamps.
type: boolean
tls:
description: Fluent Bit provides integrated support for Transport
Layer Security (TLS) and it predecessor Secure Sockets Layer
Expand Down
4 changes: 4 additions & 0 deletions config/crd/bases/fluentbit.fluent.io_clusteroutputs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,10 @@ spec:
description: When Logstash_Format is enabled, this property defines
the format of the timestamp.
type: string
timeKeyNanos:
description: When Logstash_Format is enabled, enabling this property
sends nanosecond precision timestamps.
type: boolean
tls:
description: Fluent Bit provides integrated support for Transport
Layer Security (TLS) and it predecessor Secure Sockets Layer
Expand Down
4 changes: 4 additions & 0 deletions manifests/setup/fluent-operator-crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1958,6 +1958,10 @@ spec:
description: When Logstash_Format is enabled, this property defines
the format of the timestamp.
type: string
timeKeyNanos:
description: When Logstash_Format is enabled, enabling this property
sends nanosecond precision timestamps.
type: boolean
tls:
description: Fluent Bit provides integrated support for Transport
Layer Security (TLS) and it predecessor Secure Sockets Layer
Expand Down
4 changes: 4 additions & 0 deletions manifests/setup/setup.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1958,6 +1958,10 @@ spec:
description: When Logstash_Format is enabled, this property defines
the format of the timestamp.
type: string
timeKeyNanos:
description: When Logstash_Format is enabled, enabling this property
sends nanosecond precision timestamps.
type: boolean
tls:
description: Fluent Bit provides integrated support for Transport
Layer Security (TLS) and it predecessor Secure Sockets Layer
Expand Down

0 comments on commit 190bb88

Please sign in to comment.