Skip to content

Commit

Permalink
Configure bulk_size (elastic#10)
Browse files Browse the repository at this point in the history
The maximum bulk size is configurable (bulk_size) from the
output/<output> section.
  • Loading branch information
monicasarbu committed May 19, 2015
1 parent 86053cc commit 86949ff
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions outputs/elasticsearch/output.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ func (out *ElasticsearchOutput) Init(config outputs.MothershipConfig, topology_e
out.FlushInterval = time.Duration(*config.Flush_interval) * time.Millisecond
}
out.BulkMaxSize = 10000
if config.BulkMaxSize != nil {
out.BulkMaxSize = *config.BulkMaxSize
if config.Bulk_size != nil {
out.BulkMaxSize = *config.Bulk_size
}

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

return nil
}
Expand Down
2 changes: 1 addition & 1 deletion outputs/outputs.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ type MothershipConfig struct {
Number_of_files int
DataType string
Flush_interval *int
BulkMaxSize *int
Bulk_size *int
}

// Functions to be exported by a output plugin
Expand Down

0 comments on commit 86949ff

Please sign in to comment.