diff --git a/apis/fluentbit/v1alpha2/plugins/output/azure_log_analytics_types.go b/apis/fluentbit/v1alpha2/plugins/output/azure_log_analytics_types.go index 457388498..f3785f702 100644 --- a/apis/fluentbit/v1alpha2/plugins/output/azure_log_analytics_types.go +++ b/apis/fluentbit/v1alpha2/plugins/output/azure_log_analytics_types.go @@ -18,6 +18,8 @@ type AzureLogAnalytics struct { SharedKey *plugins.Secret `json:"sharedKey"` // Name of the event type. LogType string `json:"logType,omitempty"` + // Set a record key that will populate 'logtype'. If the key is found, it will have precedence + LogTypeKey string `json:"logTypeKey,omitempty"` // Specify the name of the key where the timestamp is stored. TimeKey string `json:"timeKey,omitempty"` // If set, overrides the timeKey value with the `time-generated-field` HTTP header value. @@ -49,6 +51,9 @@ func (o *AzureLogAnalytics) Params(sl plugins.SecretLoader) (*params.KVs, error) if o.LogType != "" { kvs.Insert("Log_Type", o.LogType) } + if o.LogTypeKey != "" { + kvs.Insert("Log_Type_Key", o.LogTypeKey) + } if o.TimeKey != "" { kvs.Insert("Time_Key", o.TimeKey) } diff --git a/charts/fluent-operator/charts/fluent-bit-crds/crds/fluentbit.fluent.io_clusteroutputs.yaml b/charts/fluent-operator/charts/fluent-bit-crds/crds/fluentbit.fluent.io_clusteroutputs.yaml index 32efef86b..b434232bd 100644 --- a/charts/fluent-operator/charts/fluent-bit-crds/crds/fluentbit.fluent.io_clusteroutputs.yaml +++ b/charts/fluent-operator/charts/fluent-bit-crds/crds/fluentbit.fluent.io_clusteroutputs.yaml @@ -289,6 +289,10 @@ spec: logType: description: Name of the event type. type: string + logTypeKey: + description: Set a record key that will populate 'logtype'. If + the key is found, it will have precedence + type: string sharedKey: description: Specify the primary or the secondary client authentication key diff --git a/charts/fluent-operator/charts/fluent-bit-crds/crds/fluentbit.fluent.io_outputs.yaml b/charts/fluent-operator/charts/fluent-bit-crds/crds/fluentbit.fluent.io_outputs.yaml index 4831c6ecf..b3b11db98 100644 --- a/charts/fluent-operator/charts/fluent-bit-crds/crds/fluentbit.fluent.io_outputs.yaml +++ b/charts/fluent-operator/charts/fluent-bit-crds/crds/fluentbit.fluent.io_outputs.yaml @@ -289,6 +289,10 @@ spec: logType: description: Name of the event type. type: string + logTypeKey: + description: Set a record key that will populate 'logtype'. If + the key is found, it will have precedence + type: string sharedKey: description: Specify the primary or the secondary client authentication key diff --git a/config/crd/bases/fluentbit.fluent.io_clusteroutputs.yaml b/config/crd/bases/fluentbit.fluent.io_clusteroutputs.yaml index 32efef86b..b434232bd 100644 --- a/config/crd/bases/fluentbit.fluent.io_clusteroutputs.yaml +++ b/config/crd/bases/fluentbit.fluent.io_clusteroutputs.yaml @@ -289,6 +289,10 @@ spec: logType: description: Name of the event type. type: string + logTypeKey: + description: Set a record key that will populate 'logtype'. If + the key is found, it will have precedence + type: string sharedKey: description: Specify the primary or the secondary client authentication key diff --git a/config/crd/bases/fluentbit.fluent.io_outputs.yaml b/config/crd/bases/fluentbit.fluent.io_outputs.yaml index 4831c6ecf..b3b11db98 100644 --- a/config/crd/bases/fluentbit.fluent.io_outputs.yaml +++ b/config/crd/bases/fluentbit.fluent.io_outputs.yaml @@ -289,6 +289,10 @@ spec: logType: description: Name of the event type. type: string + logTypeKey: + description: Set a record key that will populate 'logtype'. If + the key is found, it will have precedence + type: string sharedKey: description: Specify the primary or the secondary client authentication key diff --git a/go.mod b/go.mod index 9c9fe343a..a6c85d40c 100644 --- a/go.mod +++ b/go.mod @@ -60,12 +60,14 @@ require ( go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.26.0 // indirect golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 // indirect + golang.org/x/mod v0.19.0 // indirect golang.org/x/net v0.27.0 // indirect golang.org/x/oauth2 v0.12.0 // indirect golang.org/x/sys v0.22.0 // indirect golang.org/x/term v0.22.0 // indirect golang.org/x/text v0.16.0 // indirect golang.org/x/time v0.3.0 // indirect + golang.org/x/tools v0.23.0 // indirect gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect google.golang.org/appengine v1.6.7 // indirect google.golang.org/protobuf v1.34.1 // indirect @@ -74,6 +76,8 @@ require ( gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect k8s.io/apiextensions-apiserver v0.30.1 // indirect + k8s.io/code-generator v0.30.3 // indirect + k8s.io/gengo/v2 v2.0.0-20240228010128-51d4e06bde70 // indirect k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 // indirect k8s.io/utils v0.0.0-20230726121419-3b25d923346b // indirect sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect diff --git a/go.sum b/go.sum index b682598dc..8e73a9ea0 100644 --- a/go.sum +++ b/go.sum @@ -152,6 +152,8 @@ golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 h1:2dVuKD2vS7b0QIHQbpyTISPd0 golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56/go.mod h1:M4RDyNAINzryxdtnbRXRL/OHtkFuWGRjvuhBJpk2IlY= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.19.0 h1:fEdghXQSo20giMthA7cd28ZC+jts4amQ3YMXiP5oMQ8= +golang.org/x/mod v0.19.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= @@ -238,6 +240,10 @@ k8s.io/apimachinery v0.30.3 h1:q1laaWCmrszyQuSQCfNB8cFgCuDAoPszKY4ucAjDwHc= k8s.io/apimachinery v0.30.3/go.mod h1:iexa2somDaxdnj7bha06bhb43Zpa6eWH8N8dbqVjTUc= k8s.io/client-go v0.30.3 h1:bHrJu3xQZNXIi8/MoxYtZBBWQQXwy16zqJwloXXfD3k= k8s.io/client-go v0.30.3/go.mod h1:8d4pf8vYu665/kUbsxWAQ/JDBNWqfFeZnvFiVdmx89U= +k8s.io/code-generator v0.30.3 h1:bmtnLJKagDS5f5uOEpLyJiDfIMKXGMKgOLBdde+w0Mc= +k8s.io/code-generator v0.30.3/go.mod h1:PFgBiv+miFV7TZYp+RXgROkhA+sWYZ+mtpbMLofMke8= +k8s.io/gengo/v2 v2.0.0-20240228010128-51d4e06bde70 h1:NGrVE502P0s0/1hudf8zjgwki1X/TByhmAoILTarmzo= +k8s.io/gengo/v2 v2.0.0-20240228010128-51d4e06bde70/go.mod h1:VH3AT8AaQOqiGjMF9p0/IM1Dj+82ZwjfxUP1IxaHE+8= k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk= k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 h1:BZqlfIlq5YbRMFko6/PM7FjZpUb45WallggurYhKGag= diff --git a/manifests/setup/fluent-operator-crd.yaml b/manifests/setup/fluent-operator-crd.yaml index 308b0abe5..b1fe030cd 100644 --- a/manifests/setup/fluent-operator-crd.yaml +++ b/manifests/setup/fluent-operator-crd.yaml @@ -4326,6 +4326,10 @@ spec: logType: description: Name of the event type. type: string + logTypeKey: + description: Set a record key that will populate 'logtype'. If + the key is found, it will have precedence + type: string sharedKey: description: Specify the primary or the secondary client authentication key @@ -33013,6 +33017,10 @@ spec: logType: description: Name of the event type. type: string + logTypeKey: + description: Set a record key that will populate 'logtype'. If + the key is found, it will have precedence + type: string sharedKey: description: Specify the primary or the secondary client authentication key diff --git a/manifests/setup/setup.yaml b/manifests/setup/setup.yaml index 4b2553377..3a111c138 100644 --- a/manifests/setup/setup.yaml +++ b/manifests/setup/setup.yaml @@ -4326,6 +4326,10 @@ spec: logType: description: Name of the event type. type: string + logTypeKey: + description: Set a record key that will populate 'logtype'. If + the key is found, it will have precedence + type: string sharedKey: description: Specify the primary or the secondary client authentication key @@ -33013,6 +33017,10 @@ spec: logType: description: Name of the event type. type: string + logTypeKey: + description: Set a record key that will populate 'logtype'. If + the key is found, it will have precedence + type: string sharedKey: description: Specify the primary or the secondary client authentication key