forked from fluent/fluent-operator
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request fluent#324 from jett-deng/develop
Fluentd integrate OpenSearch plugin
- Loading branch information
Showing
22 changed files
with
1,160 additions
and
7 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package output | ||
|
||
import "github.com/fluent/fluent-operator/apis/fluentd/v1alpha1/plugins" | ||
|
||
// Opensearch defines the parameters for out_opensearch plugin | ||
type Opensearch struct { | ||
// The hostname of your Opensearch node (default: localhost). | ||
Host *string `json:"host,omitempty"` | ||
// The port number of your Opensearch node (default: 9200). | ||
// +kubebuilder:validation:Minimum:=1 | ||
// +kubebuilder:validation:Maximum:=65535 | ||
Port *uint32 `json:"port,omitempty"` | ||
// Hosts defines a list of hosts if you want to connect to more than one Openearch nodes | ||
Hosts *string `json:"hosts,omitempty"` | ||
// Specify https if your Opensearch endpoint supports SSL (default: http). | ||
Scheme *string `json:"scheme,omitempty"` | ||
// Path defines the REST API endpoint of Opensearch to post write requests (default: nil). | ||
Path *string `json:"path,omitempty"` | ||
// IndexName defines the placeholder syntax of Fluentd plugin API. See https://docs.fluentd.org/configuration/buffer-section. | ||
IndexName *string `json:"indexName,omitempty"` | ||
// If true, Fluentd uses the conventional index name format logstash-%Y.%m.%d (default: false). This option supersedes the index_name option. | ||
LogstashFormat *bool `json:"logstashFormat,omitempty"` | ||
// LogstashPrefix defines the logstash prefix index name to write events when logstash_format is true (default: logstash). | ||
LogstashPrefix *string `json:"logstashPrefix,omitempty"` | ||
// Optional, The login credentials to connect to Opensearch | ||
User *plugins.Secret `json:"user,omitempty"` | ||
// Optional, The login credentials to connect to Opensearch | ||
Password *plugins.Secret `json:"password,omitempty"` | ||
} |
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
25 changes: 25 additions & 0 deletions
25
apis/fluentd/v1alpha1/tests/expected/fluentd-cluster-cfg-output-opensearch.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,25 @@ | ||
<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> | ||
<match **> | ||
@id ClusterFluentdConfig-cluster-fluentd-config::cluster::clusteroutput::fluentd-output-opensearch-0 | ||
@type opensearch | ||
host opensearch-logging-data.kubesphere-logging-system.svc | ||
logstash_format true | ||
logstash_prefix ks-logstash-log | ||
port 9200 | ||
</match> | ||
</label> |
41 changes: 41 additions & 0 deletions
41
apis/fluentd/v1alpha1/tests/expected/fluentd-mixed-cfgs-output-opensearch.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,41 @@ | ||
<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> | ||
<route> | ||
@label @2d9e59757d3bfc66d93c3bc44b408922 | ||
<match> | ||
namespaces fluent | ||
</match> | ||
</route> | ||
</match> | ||
<label @a2170d34e9940ec56d328100e375c43e> | ||
<match **> | ||
@id ClusterFluentdConfig-cluster-fluentd-config::cluster::clusteroutput::fluentd-output-opensearch-0 | ||
@type opensearch | ||
host opensearch-logging-data.kubesphere-logging-system.svc | ||
logstash_format true | ||
logstash_prefix ks-logstash-log | ||
port 9200 | ||
</match> | ||
</label> | ||
<label @2d9e59757d3bfc66d93c3bc44b408922> | ||
<match **> | ||
@id FluentdConfig-fluent-fluentd-config::cluster::clusteroutput::fluentd-output-opensearch-0 | ||
@type opensearch | ||
host opensearch-logging-data.kubesphere-logging-system.svc | ||
logstash_format true | ||
logstash_prefix ks-logstash-log | ||
port 9200 | ||
</match> | ||
</label> |
25 changes: 25 additions & 0 deletions
25
apis/fluentd/v1alpha1/tests/expected/fluentd-namespaced-cfg-output-opensearch.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,25 @@ | ||
<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::cluster::clusteroutput::fluentd-output-opensearch-0 | ||
@type opensearch | ||
host opensearch-logging-data.kubesphere-logging-system.svc | ||
logstash_format true | ||
logstash_prefix ks-logstash-log | ||
port 9200 | ||
</match> | ||
</label> |
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
Oops, something went wrong.