8
8
9
9
// +kubebuilder:object:generate:=true
10
10
11
- // The es output plugin, allows to ingest your records into a Elasticsearch database.
11
+ // Elasticsearch is the es output plugin, allows to ingest your records into an Elasticsearch database.
12
12
type Elasticsearch struct {
13
13
// IP address or hostname of the target Elasticsearch instance
14
14
Host string `json:"host,omitempty"`
@@ -28,11 +28,25 @@ type Elasticsearch struct {
28
28
// otherwise the value must be according to the Unit Size specification.
29
29
// +kubebuilder:validation:Pattern:="^\\d+(k|K|KB|kb|m|M|MB|mb|g|G|GB|gb)?$"
30
30
BufferSize string `json:"bufferSize,omitempty"`
31
- // Newer versions of Elasticsearch allows to setup filters called pipelines.
32
- // This option allows to define which pipeline the database should use.
33
- // For performance reasons is strongly suggested to do parsing
31
+ // Newer versions of Elasticsearch allows setting up filters called pipelines.
32
+ // This option allows defining which pipeline the database should use.
33
+ // For performance reasons is strongly suggested parsing
34
34
// and filtering on Fluent Bit side, avoid pipelines.
35
35
Pipeline string `json:"pipeline,omitempty"`
36
+ // Enable AWS Sigv4 Authentication for Amazon ElasticSearch Service.
37
+ AWSAuth string `json:"awsAuth,omitempty"`
38
+ // Specify the AWS region for Amazon ElasticSearch Service.
39
+ AWSRegion string `json:"awsRegion,omitempty"`
40
+ // Specify the custom sts endpoint to be used with STS API for Amazon ElasticSearch Service.
41
+ AWSSTSEndpoint string `json:"awsSTSEndpoint,omitempty"`
42
+ // AWS IAM Role to assume to put records to your Amazon ES cluster.
43
+ AWSRoleARN string `json:"awsRoleARN,omitempty"`
44
+ // External ID for the AWS IAM Role specified with aws_role_arn.
45
+ AWSExternalID string `json:"awsExternalID,omitempty"`
46
+ // If you are using Elastic's Elasticsearch Service you can specify the cloud_id of the cluster running.
47
+ CloudID string `json:"cloudID,omitempty"`
48
+ // Specify the credentials to use to connect to Elastic's Elasticsearch Service running on Elastic Cloud.
49
+ CloudAuth string `json:"cloudAuth,omitempty"`
36
50
// Optional username credential for Elastic X-Pack access
37
51
HTTPUser * plugins.Secret `json:"httpUser,omitempty"`
38
52
// Password for user defined in HTTP_User
@@ -62,6 +76,8 @@ type Elasticsearch struct {
62
76
// When enabled, generate _id for outgoing records.
63
77
// This prevents duplicate records when retrying ES.
64
78
GenerateID * bool `json:"generateID,omitempty"`
79
+ // If set, _id will be the value of the key from incoming record and Generate_ID option is ignored.
80
+ IdKey string `json:"idKey,omitempty"`
65
81
// When enabled, replace field name dots with underscore, required by Elasticsearch 2.0-2.3.
66
82
ReplaceDots * bool `json:"replaceDots,omitempty"`
67
83
// When enabled print the elasticsearch API calls to stdout (for diag only)
@@ -72,15 +88,17 @@ type Elasticsearch struct {
72
88
CurrentTimeIndex * bool `json:"currentTimeIndex,omitempty"`
73
89
// Prefix keys with this string
74
90
LogstashPrefixKey string `json:"logstashPrefixKey,omitempty"`
75
- * plugins.TLS `json:"tls,omitempty"`
91
+ // When enabled, mapping types is removed and Type option is ignored. Types are deprecated in APIs in v7.0. This options is for v7.0 or later.
92
+ SuppressTypeName string `json:"suppressTypeName,omitempty"`
93
+ * plugins.TLS `json:"tls,omitempty"`
76
94
}
77
95
78
- // implement Section() method
96
+ // Name implement Section() method
79
97
func (_ * Elasticsearch ) Name () string {
80
98
return "es"
81
99
}
82
100
83
- // implement Section() method
101
+ // Params implement Section() method
84
102
func (es * Elasticsearch ) Params (sl plugins.SecretLoader ) (* plugins.KVs , error ) {
85
103
kvs := plugins .NewKVs ()
86
104
if es .Host != "" {
@@ -98,6 +116,27 @@ func (es *Elasticsearch) Params(sl plugins.SecretLoader) (*plugins.KVs, error) {
98
116
if es .Pipeline != "" {
99
117
kvs .Insert ("Pipeline" , es .Pipeline )
100
118
}
119
+ if es .AWSAuth != "" {
120
+ kvs .Insert ("AWS_Auth" , es .AWSAuth )
121
+ }
122
+ if es .AWSRegion != "" {
123
+ kvs .Insert ("AWS_Region" , es .AWSRegion )
124
+ }
125
+ if es .AWSSTSEndpoint != "" {
126
+ kvs .Insert ("AWS_STS_Endpoint" , es .AWSSTSEndpoint )
127
+ }
128
+ if es .AWSRoleARN != "" {
129
+ kvs .Insert ("AWS_Role_ARN" , es .AWSRoleARN )
130
+ }
131
+ if es .CloudID != "" {
132
+ kvs .Insert ("Cloud_ID" , es .CloudID )
133
+ }
134
+ if es .CloudAuth != "" {
135
+ kvs .Insert ("Cloud_Auth" , es .CloudAuth )
136
+ }
137
+ if es .AWSExternalID != "" {
138
+ kvs .Insert ("AWS_External_ID" , es .AWSExternalID )
139
+ }
101
140
if es .HTTPUser != nil {
102
141
u , err := sl .LoadSecret (* es .HTTPUser )
103
142
if err != nil {
@@ -142,6 +181,9 @@ func (es *Elasticsearch) Params(sl plugins.SecretLoader) (*plugins.KVs, error) {
142
181
if es .GenerateID != nil {
143
182
kvs .Insert ("Generate_ID" , fmt .Sprint (* es .GenerateID ))
144
183
}
184
+ if es .IdKey != "" {
185
+ kvs .Insert ("ID_KEY" , es .IdKey )
186
+ }
145
187
if es .ReplaceDots != nil {
146
188
kvs .Insert ("Replace_Dots" , fmt .Sprint (* es .ReplaceDots ))
147
189
}
@@ -157,6 +199,9 @@ func (es *Elasticsearch) Params(sl plugins.SecretLoader) (*plugins.KVs, error) {
157
199
if es .LogstashPrefixKey != "" {
158
200
kvs .Insert ("Logstash_Prefix_Key" , es .LogstashPrefixKey )
159
201
}
202
+ if es .SuppressTypeName != "" {
203
+ kvs .Insert ("Suppress_Type_Name" , es .SuppressTypeName )
204
+ }
160
205
if es .TLS != nil {
161
206
tls , err := es .TLS .Params (sl )
162
207
if err != nil {
0 commit comments