diff --git a/outputs/elasticsearch/output.go b/outputs/elasticsearch/output.go index 483570471353..9f2a7c6f3d4a 100644 --- a/outputs/elasticsearch/output.go +++ b/outputs/elasticsearch/output.go @@ -70,9 +70,9 @@ func (out *elasticsearchOutput) init( } // configure bulk size in config in case it is not set - if config.Bulk_size == nil { + if config.BulkMaxSize == nil { bulkSize := defaultBulkSize - config.Bulk_size = &bulkSize + config.BulkMaxSize = &bulkSize } clients, err := mode.MakeClients(config, makeClientFactory(beat, tlsConfig, config)) diff --git a/outputs/elasticsearch/output_test.go b/outputs/elasticsearch/output_test.go index 84c1617818cc..70023851165c 100644 --- a/outputs/elasticsearch/output_test.go +++ b/outputs/elasticsearch/output_test.go @@ -33,7 +33,7 @@ func createElasticsearchConnection(flushInterval int, bulkSize int) elasticsearc Index: index, Protocol: "http", Flush_interval: &flushInterval, - Bulk_size: &bulkSize, + BulkMaxSize: &bulkSize, }, 10) return output diff --git a/outputs/fileout/file.go b/outputs/fileout/file.go index d2bda1477ea8..b64e6a53eef3 100644 --- a/outputs/fileout/file.go +++ b/outputs/fileout/file.go @@ -42,7 +42,7 @@ func (out *fileOutput) init(beat string, config *outputs.MothershipConfig, topol // disable bulk support configDisableInt := -1 config.Flush_interval = &configDisableInt - config.Bulk_size = &configDisableInt + config.BulkMaxSize = &configDisableInt rotateeverybytes := uint64(config.Rotate_every_kb) * 1024 if rotateeverybytes == 0 { diff --git a/outputs/logstash/logstash_integration_test.go b/outputs/logstash/logstash_integration_test.go index f886fa426430..0c9efd54efc1 100644 --- a/outputs/logstash/logstash_integration_test.go +++ b/outputs/logstash/logstash_integration_test.go @@ -155,7 +155,7 @@ func newTestElasticsearchOutput(t *testing.T, test string) *testOutputer { Hosts: []string{getElasticsearchHost()}, Index: index, Flush_interval: &flushInterval, - Bulk_size: &bulkSize, + BulkMaxSize: &bulkSize, } output, err := plugin.NewOutput("test", &config, 10) diff --git a/outputs/outputs.go b/outputs/outputs.go index 85af56c4a290..7d51b3c3b3f8 100644 --- a/outputs/outputs.go +++ b/outputs/outputs.go @@ -28,7 +28,7 @@ type MothershipConfig struct { Number_of_files int DataType string Flush_interval *int - Bulk_size *int + BulkMaxSize *int `yaml:"bulk_max_size"` Max_retries *int Pretty *bool TLS *TLSConfig diff --git a/publisher/async.go b/publisher/async.go index bc1e60db82e8..c67adcf29180 100644 --- a/publisher/async.go +++ b/publisher/async.go @@ -82,8 +82,8 @@ func asyncOutputer(ws *workerSignal, worker *outputWorker) worker { } maxBulkSize := defaultBulkSize - if config.Bulk_size != nil { - maxBulkSize = *config.Bulk_size + if config.BulkMaxSize != nil { + maxBulkSize = *config.BulkMaxSize } // batching disabled diff --git a/publisher/common_test.go b/publisher/common_test.go index 2ffca350c2d6..2d7b08563928 100644 --- a/publisher/common_test.go +++ b/publisher/common_test.go @@ -137,7 +137,7 @@ func newTestPublisher(bulkSize int, response OutputResponse) *testPublisher { } ow := &outputWorker{} - ow.config.Bulk_size = &bulkSize + ow.config.BulkMaxSize = &bulkSize ow.handler = mh ws := workerSignal{} ow.messageWorker.init(&ws, 1000, mh) diff --git a/publisher/output.go b/publisher/output.go index b3e2bde6c6c9..567ff42201cd 100644 --- a/publisher/output.go +++ b/publisher/output.go @@ -22,8 +22,8 @@ func newOutputWorker( hwm int, ) *outputWorker { maxBulkSize := defaultBulkSize - if config.Bulk_size != nil { - maxBulkSize = *config.Bulk_size + if config.BulkMaxSize != nil { + maxBulkSize = *config.BulkMaxSize } o := &outputWorker{ diff --git a/publisher/publish.go b/publisher/publish.go index 552c315f43dd..b9e21aa738ab 100644 --- a/publisher/publish.go +++ b/publisher/publish.go @@ -193,7 +193,7 @@ func (publisher *PublisherType) Init( output := plugin.Output config := plugin.Config - debug("create output worker: %p, %p", config.Flush_interval, config.Bulk_size) + debug("create output worker: %p, %p", config.Flush_interval, config.BulkMaxSize) outputers = append(outputers, newOutputWorker(config, output, &publisher.wsOutput, 1000))