Skip to content

Commit

Permalink
[cloud] default to medium compression (#5446)
Browse files Browse the repository at this point in the history
Set compression level to 5 on cloud.
  • Loading branch information
simitt authored Jun 16, 2021
1 parent 1a93a25 commit 1c09eed
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 3 additions & 2 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,9 @@ var libbeatConfigOverrides = func() []cfgfile.ConditionalOverride {
return common.MustNewConfigFrom(map[string]interface{}{
"output": map[string]interface{}{
"elasticsearch": map[string]interface{}{
"worker": cloudMatrix[cap].worker,
"bulk_max_size": cloudMatrix[cap].bulkMaxSize,
"compression_level": 5, //default to medium compression on cloud
"worker": cloudMatrix[cap].worker,
"bulk_max_size": cloudMatrix[cap].bulkMaxSize,
},
},
"queue": map[string]interface{}{
Expand Down
4 changes: 4 additions & 0 deletions cmd/root_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ func TestCloudEnv(t *testing.T) {
require.NoError(t, err)
assert.Equal(t, int64(5), workers)

compression, err := cfg.Int("output.elasticsearch.compression_level", -1)
require.NoError(t, err)
assert.Equal(t, int64(5), compression)

// bad cloud environment value
os.Setenv(cloudEnv, "123")
settings = DefaultSettings()
Expand Down

0 comments on commit 1c09eed

Please sign in to comment.