Skip to content

Commit e4183f0

Browse files
committed
Configure bulk_size (elastic#10)
The maximum bulk size is configurable (bulk_size) from the output/<output> section.
1 parent 0b389cb commit e4183f0

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

outputs/elasticsearch/output.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ func (out *ElasticsearchOutput) Init(config outputs.MothershipConfig, topology_e
5555
out.FlushInterval = time.Duration(*config.Flush_interval) * time.Millisecond
5656
}
5757
out.BulkMaxSize = 10000
58-
if config.BulkMaxSize != nil {
59-
out.BulkMaxSize = *config.BulkMaxSize
58+
if config.Bulk_size != nil {
59+
out.BulkMaxSize = *config.Bulk_size
6060
}
6161

6262
err := out.EnableTTL()
@@ -72,6 +72,7 @@ func (out *ElasticsearchOutput) Init(config outputs.MothershipConfig, topology_e
7272
logp.Info("[ElasticsearchOutput] Using index pattern [%s-]YYYY.MM.DD", out.Index)
7373
logp.Info("[ElasticsearchOutput] Topology expires after %ds", out.TopologyExpire/1000)
7474
logp.Info("[ElasticsearchOutput] Flush interval %s", out.FlushInterval)
75+
logp.Info("[ElasticsearchOutput] Bulk size %d", out.BulkMaxSize)
7576

7677
return nil
7778
}

outputs/outputs.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ type MothershipConfig struct {
2525
Number_of_files int
2626
DataType string
2727
Flush_interval *int
28-
BulkMaxSize *int
28+
Bulk_size *int
2929
}
3030

3131
// Functions to be exported by a output plugin

0 commit comments

Comments
 (0)