Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
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
4 changes: 4 additions & 0 deletions apis/fluentbit/v1alpha2/plugins/output/splunk_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ type Splunk struct {
*plugins.TLS `json:"tls,omitempty"`
// Include fluentbit networking options for this output-plugin
*plugins.Networking `json:"networking,omitempty"`
// Limit the maximum number of Chunks in the filesystem for the current output logical destination.
TotalLimitSize string `json:"totalLimitSize,omitempty"`
Comment thread
geirra marked this conversation as resolved.
}

// Name implement Section() method
Expand Down Expand Up @@ -119,5 +121,7 @@ func (o *Splunk) Params(sl plugins.SecretLoader) (*params.KVs, error) {
}
}

plugins.InsertKVString(kvs, "storage.total_limit_size", o.TotalLimitSize)

return kvs, nil
}
42 changes: 42 additions & 0 deletions apis/fluentbit/v1alpha2/plugins/output/splunk_types_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
package output

import (
"testing"

"github.com/fluent/fluent-operator/v3/apis/fluentbit/v1alpha2/plugins"
"github.com/fluent/fluent-operator/v3/apis/fluentbit/v1alpha2/plugins/params"
"github.com/fluent/fluent-operator/v3/pkg/utils"
. "github.com/onsi/gomega"
v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"sigs.k8s.io/controller-runtime/pkg/client/fake"
)

func TestSplunk_Params(t *testing.T) {
g := NewGomegaWithT(t)
fcb := fake.ClientBuilder{}
fc := fcb.WithObjects(&v1.Secret{
ObjectMeta: metav1.ObjectMeta{Namespace: "test_namespace", Name: "splunk_secret"},
Data: map[string][]byte{
"splunk_token": []byte("expected_splunk_token"),
},
}).Build()

sl := plugins.NewSecretLoader(fc, "test_namespace")
s := Splunk{
Host: "splunk.example.com",
Port: utils.ToPtr[int32](8088),
SplunkToken: &plugins.Secret{ValueFrom: plugins.ValueSource{SecretKeyRef: v1.SecretKeySelector{LocalObjectReference: v1.LocalObjectReference{Name: "splunk_secret"}, Key: "splunk_token"}}},
TotalLimitSize: "512M",
}

expected := params.NewKVs()
expected.Insert("splunk_token", "expected_splunk_token")
expected.Insert("host", "splunk.example.com")
expected.Insert("port", "8088")
expected.Insert("storage.total_limit_size", "512M")

kvs, err := s.Params(sl)
g.Expect(err).NotTo(HaveOccurred())
g.Expect(kvs).To(Equal(expected))
}
Original file line number Diff line number Diff line change
Expand Up @@ -4380,6 +4380,10 @@ spec:
description: Hostname to be used for TLS SNI extension
type: string
type: object
totalLimitSize:
description: Limit the maximum number of Chunks in the filesystem
for the current output logical destination.
type: string
type: object
stackdriver:
description: Stackdriver defines Stackdriver Output Configuration
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4380,6 +4380,10 @@ spec:
description: Hostname to be used for TLS SNI extension
type: string
type: object
totalLimitSize:
description: Limit the maximum number of Chunks in the filesystem
for the current output logical destination.
type: string
type: object
stackdriver:
description: Stackdriver defines Stackdriver Output Configuration
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4378,6 +4378,10 @@ spec:
description: Hostname to be used for TLS SNI extension
type: string
type: object
totalLimitSize:
description: Limit the maximum number of Chunks in the filesystem
for the current output logical destination.
type: string
type: object
stackdriver:
description: Stackdriver defines Stackdriver Output Configuration
Expand Down
4 changes: 4 additions & 0 deletions charts/fluent-operator/crds/fluentbit.fluent.io_outputs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4378,6 +4378,10 @@ spec:
description: Hostname to be used for TLS SNI extension
type: string
type: object
totalLimitSize:
description: Limit the maximum number of Chunks in the filesystem
for the current output logical destination.
type: string
type: object
stackdriver:
description: Stackdriver defines Stackdriver Output Configuration
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 @@ -4379,6 +4379,10 @@ spec:
description: Hostname to be used for TLS SNI extension
type: string
type: object
totalLimitSize:
description: Limit the maximum number of Chunks in the filesystem
for the current output logical destination.
type: string
type: object
stackdriver:
description: Stackdriver defines Stackdriver Output Configuration
Expand Down
4 changes: 4 additions & 0 deletions config/crd/bases/fluentbit.fluent.io_outputs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4379,6 +4379,10 @@ spec:
description: Hostname to be used for TLS SNI extension
type: string
type: object
totalLimitSize:
description: Limit the maximum number of Chunks in the filesystem
for the current output logical destination.
type: string
type: object
stackdriver:
description: Stackdriver defines Stackdriver Output Configuration
Expand Down
1 change: 1 addition & 0 deletions docs/plugins/fluentbit/output/splunk.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,4 @@ Splunk output plugin allows to ingest your records into a Splunk Enterprise serv
| Workers | Enables dedicated thread(s) for this output. Default value `2` is set since version 1.8.13. For previous versions is 0. | *int32 |
| tls | | *[plugins.TLS](../tls.md) |
| networking | Include fluentbit networking options for this output-plugin | *[plugins.Networking](../net.md) |
| totalLimitSize | Limit the maximum number of Chunks in the filesystem for the current output logical destination. | string |
Comment thread
geirra marked this conversation as resolved.
8 changes: 8 additions & 0 deletions manifests/setup/setup.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8579,6 +8579,10 @@ spec:
description: Hostname to be used for TLS SNI extension
type: string
type: object
totalLimitSize:
description: Limit the maximum number of Chunks in the filesystem
for the current output logical destination.
type: string
type: object
stackdriver:
description: Stackdriver defines Stackdriver Output Configuration
Expand Down Expand Up @@ -39245,6 +39249,10 @@ spec:
description: Hostname to be used for TLS SNI extension
type: string
type: object
totalLimitSize:
description: Limit the maximum number of Chunks in the filesystem
for the current output logical destination.
type: string
type: object
stackdriver:
description: Stackdriver defines Stackdriver Output Configuration
Expand Down
Loading