Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,8 @@ receivers:
insecureSkipVerify: true|false # optional, if set to true, the tls cert won't be verified
serverName: # optional, the domain, the certificate was issued for, in case it doesn't match the hostname used for the connection
caFile: # optional, path to the CA file of the trusted authority the cert was signed with
# If set to true, gzip compression is used for requests to ElasticSearch. Defaults to false.
compressRequestBody: true|false
```
### OpenSearch

Expand Down Expand Up @@ -201,6 +203,8 @@ receivers:
insecureSkipVerify: true|false # optional, if set to true, the tls cert won't be verified
serverName: # optional, the domain, the certificate was issued for, in case it doesn't match the hostname used for the connection
caFile: # optional, path to the CA file of the trusted authority the cert was signed with
# If set to true, gzip compression is used for requests to OpenSearch. Defaults to false.
compressRequestBody: true|false
```

### Slack
Expand Down
14 changes: 8 additions & 6 deletions pkg/sinks/elasticsearch.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,13 @@ type ElasticsearchConfig struct {
// Indexing preferences
UseEventID bool `yaml:"useEventID"`
// DeDot all labels and annotations in the event. For both the event and the involvedObject
DeDot bool `yaml:"deDot"`
Index string `yaml:"index"`
IndexFormat string `yaml:"indexFormat"`
Type string `yaml:"type"`
TLS TLS `yaml:"tls"`
Layout map[string]interface{} `yaml:"layout"`
DeDot bool `yaml:"deDot"`
Index string `yaml:"index"`
IndexFormat string `yaml:"indexFormat"`
Type string `yaml:"type"`
TLS TLS `yaml:"tls"`
Layout map[string]interface{} `yaml:"layout"`
CompressRequestBody bool `yaml:"compressRequestBody"`
}

func NewElasticsearch(cfg *ElasticsearchConfig) (*Elasticsearch, error) {
Expand All @@ -60,6 +61,7 @@ func NewElasticsearch(cfg *ElasticsearchConfig) (*Elasticsearch, error) {
Transport: &http.Transport{
TLSClientConfig: tlsClientConfig,
},
CompressRequestBody: cfg.CompressRequestBody,
})
if err != nil {
return nil, err
Expand Down
14 changes: 8 additions & 6 deletions pkg/sinks/opensearch.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,13 @@ type OpenSearchConfig struct {
// Indexing preferences
UseEventID bool `yaml:"useEventID"`
// DeDot all labels and annotations in the event. For both the event and the involvedObject
DeDot bool `yaml:"deDot"`
Index string `yaml:"index"`
IndexFormat string `yaml:"indexFormat"`
Type string `yaml:"type"`
TLS TLS `yaml:"tls"`
Layout map[string]interface{} `yaml:"layout"`
DeDot bool `yaml:"deDot"`
Index string `yaml:"index"`
IndexFormat string `yaml:"indexFormat"`
Type string `yaml:"type"`
TLS TLS `yaml:"tls"`
Layout map[string]interface{} `yaml:"layout"`
CompressRequestBody bool `yaml:"compressRequestBody"`
}

func NewOpenSearch(cfg *OpenSearchConfig) (*OpenSearch, error) {
Expand All @@ -47,6 +48,7 @@ func NewOpenSearch(cfg *OpenSearchConfig) (*OpenSearch, error) {
Transport: &http.Transport{
TLSClientConfig: tlsClientConfig,
},
CompressRequestBody: cfg.CompressRequestBody,
})
if err != nil {
return nil, err
Expand Down