Skip to content

Commit 016db28

Browse files
committed
feat(opensearch): add option to enable gzip compression
Signed-off-by: Timon Engelke <[email protected]>
1 parent 907ce91 commit 016db28

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,8 @@ receivers:
201201
insecureSkipVerify: true|false # optional, if set to true, the tls cert won't be verified
202202
serverName: # optional, the domain, the certificate was issued for, in case it doesn't match the hostname used for the connection
203203
caFile: # optional, path to the CA file of the trusted authority the cert was signed with
204+
# If set to true, gzip compression is used for requests to OpenSearch. Defaults to false.
205+
compressRequestBody: true|false
204206
```
205207
206208
### Slack

pkg/sinks/opensearch.go

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,13 @@ type OpenSearchConfig struct {
2525
// Indexing preferences
2626
UseEventID bool `yaml:"useEventID"`
2727
// DeDot all labels and annotations in the event. For both the event and the involvedObject
28-
DeDot bool `yaml:"deDot"`
29-
Index string `yaml:"index"`
30-
IndexFormat string `yaml:"indexFormat"`
31-
Type string `yaml:"type"`
32-
TLS TLS `yaml:"tls"`
33-
Layout map[string]interface{} `yaml:"layout"`
28+
DeDot bool `yaml:"deDot"`
29+
Index string `yaml:"index"`
30+
IndexFormat string `yaml:"indexFormat"`
31+
Type string `yaml:"type"`
32+
TLS TLS `yaml:"tls"`
33+
Layout map[string]interface{} `yaml:"layout"`
34+
CompressRequestBody bool `yaml:"compressRequestBody"`
3435
}
3536

3637
func NewOpenSearch(cfg *OpenSearchConfig) (*OpenSearch, error) {
@@ -47,6 +48,7 @@ func NewOpenSearch(cfg *OpenSearchConfig) (*OpenSearch, error) {
4748
Transport: &http.Transport{
4849
TLSClientConfig: tlsClientConfig,
4950
},
51+
CompressRequestBody: cfg.CompressRequestBody,
5052
})
5153
if err != nil {
5254
return nil, err

0 commit comments

Comments
 (0)