-
Notifications
You must be signed in to change notification settings - Fork 258
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add copy output plugin for fluentd #1017
Signed-off-by: Anthony TREUILLIER <[email protected]>
- Loading branch information
Showing
20 changed files
with
662 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package output | ||
|
||
// Copy defines the parameters for out_Copy plugin | ||
type Copy struct { | ||
// CopyMode defines how to pass the events to <store> plugins. | ||
// +kubebuilder:validation:Enum:=no_copy;shallow;deep;marshal | ||
CopyMode *string `json:"copyMode"` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
apis/fluentd/v1alpha1/tests/expected/fluentd-cluster-cfg-output-stdout-and-loki.cfg
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
<source> | ||
@type forward | ||
bind 0.0.0.0 | ||
port 24224 | ||
</source> | ||
<match **> | ||
@id main | ||
@type label_router | ||
<route> | ||
@label @a2170d34e9940ec56d328100e375c43e | ||
<match> | ||
namespaces default,kube-system | ||
</match> | ||
</route> | ||
</match> | ||
<label @a2170d34e9940ec56d328100e375c43e> | ||
<filter **> | ||
@id ClusterFluentdConfig-cluster-fluentd-config::cluster::clusterfilter::fluentd-filter-0 | ||
@type record_transformer | ||
enable_ruby true | ||
<record> | ||
kubernetes_ns ${record["kubernetes"]["namespace_name"]} | ||
</record> | ||
</filter> | ||
<match **> | ||
@id ClusterFluentdConfig-cluster-fluentd-config::cluster::clusteroutput::fluentd-output-copy-stdout-and-loki-0 | ||
@type copy | ||
copy_mode no_copy | ||
<store> | ||
@id ClusterFluentdConfig-cluster-fluentd-config::cluster::clusteroutput::fluentd-output-copy-stdout-and-loki-1 | ||
@type stdout | ||
</store> | ||
<store> | ||
@id ClusterFluentdConfig-cluster-fluentd-config::cluster::clusteroutput::fluentd-output-copy-stdout-and-loki-2 | ||
@type loki | ||
drop_single_key true | ||
extra_labels {"key11":"value11","key12":"value12"} | ||
extract_kubernetes_labels true | ||
include_thread_label true | ||
insecure_tls true | ||
remove_keys key31,key32 | ||
url http://loki-logging-data.kubesphere-logging-system.svc:3100 | ||
<label> | ||
key21 key21 | ||
key22 key22 | ||
</label> | ||
</store> | ||
</match> | ||
</label> |
53 changes: 53 additions & 0 deletions
53
apis/fluentd/v1alpha1/tests/expected/fluentd-mixed-cfgs-output-copy-1.cfg
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
<source> | ||
@type forward | ||
bind 0.0.0.0 | ||
port 24224 | ||
</source> | ||
<match **> | ||
@id main | ||
@type label_router | ||
<route> | ||
@label @2d9e59757d3bfc66d93c3bc44b408922 | ||
<match> | ||
namespaces fluent | ||
</match> | ||
</route> | ||
</match> | ||
<label @2d9e59757d3bfc66d93c3bc44b408922> | ||
<match **> | ||
@id FluentdConfig-fluent-fluentd-config::fluent::output::fluentd-mixed-copy-es-1-0 | ||
@type copy | ||
copy_mode no_copy | ||
<store> | ||
@id FluentdConfig-fluent-fluentd-config::fluent::output::fluentd-mixed-copy-es-1-1 | ||
@type elasticsearch | ||
host elasticsearch-logging-data.kubesphere-logging-system.svc | ||
index_name fluentd-mixed-copy-es-1 | ||
port 9243 | ||
scheme https | ||
</store> | ||
<store> | ||
@id FluentdConfig-fluent-fluentd-config::fluent::output::fluentd-mixed-copy-es-1-2 | ||
@type elasticsearch | ||
host elasticsearch-logging-data.kubesphere-logging-system.svc | ||
index_name fluentd-mixed-copy-es-2 | ||
port 9243 | ||
scheme https | ||
</store> | ||
<store> | ||
@id FluentdConfig-fluent-fluentd-config::cluster::clusteroutput::fluentd-output-loki-0 | ||
@type loki | ||
drop_single_key true | ||
extra_labels {"key11":"value11","key12":"value12"} | ||
extract_kubernetes_labels true | ||
include_thread_label true | ||
insecure_tls true | ||
remove_keys key31,key32 | ||
url http://loki-logging-data.kubesphere-logging-system.svc:3100 | ||
<label> | ||
key21 key21 | ||
key22 key22 | ||
</label> | ||
</store> | ||
</match> | ||
</label> |
38 changes: 38 additions & 0 deletions
38
apis/fluentd/v1alpha1/tests/expected/fluentd-mixed-cfgs-output-copy-2.cfg
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<source> | ||
@type forward | ||
bind 0.0.0.0 | ||
port 24224 | ||
</source> | ||
<match **> | ||
@id main | ||
@type label_router | ||
<route> | ||
@label @2d9e59757d3bfc66d93c3bc44b408922 | ||
<match> | ||
namespaces fluent | ||
</match> | ||
</route> | ||
</match> | ||
<label @2d9e59757d3bfc66d93c3bc44b408922> | ||
<match mixed2> | ||
@id FluentdConfig-fluent-fluentd-config::fluent::output::fluentd-mixed-copy-es-2-0 | ||
@type copy | ||
copy_mode no_copy | ||
<store> | ||
@id FluentdConfig-fluent-fluentd-config::fluent::output::fluentd-mixed-copy-es-2-1 | ||
@type elasticsearch | ||
host elasticsearch-logging-data.kubesphere-logging-system.svc | ||
index_name fluentd-mixed-copy-es-3 | ||
port 9243 | ||
scheme https | ||
</store> | ||
<store> | ||
@id FluentdConfig-fluent-fluentd-config::fluent::output::fluentd-mixed-copy-es-2-2 | ||
@type elasticsearch | ||
host elasticsearch-logging-data.kubesphere-logging-system.svc | ||
index_name fluentd-mixed-copy-es-4 | ||
port 9243 | ||
scheme https | ||
</store> | ||
</match> | ||
</label> |
33 changes: 33 additions & 0 deletions
33
apis/fluentd/v1alpha1/tests/expected/fluentd-mixed-cfgs-output-copy-3.cfg
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<source> | ||
@type forward | ||
bind 0.0.0.0 | ||
port 24224 | ||
</source> | ||
<match **> | ||
@id main | ||
@type label_router | ||
<route> | ||
@label @2d9e59757d3bfc66d93c3bc44b408922 | ||
<match> | ||
namespaces fluent | ||
</match> | ||
</route> | ||
</match> | ||
<label @2d9e59757d3bfc66d93c3bc44b408922> | ||
<match mixed3> | ||
@id FluentdConfig-fluent-fluentd-config::fluent::output::fluentd-mixed-copy-es-3-0 | ||
@type elasticsearch | ||
host elasticsearch-logging-data.kubesphere-logging-system.svc | ||
index_name fluentd-mixed-copy-es-5 | ||
port 9243 | ||
scheme https | ||
</match> | ||
<match mixed3> | ||
@id FluentdConfig-fluent-fluentd-config::fluent::output::fluentd-mixed-copy-es-3-1 | ||
@type elasticsearch | ||
host elasticsearch-logging-data.kubesphere-logging-system.svc | ||
index_name fluentd-mixed-copy-es-6 | ||
port 9243 | ||
scheme https | ||
</match> | ||
</label> |
Oops, something went wrong.