Skip to content

Commit baf7065

Browse files
committed
revert incorrect changes in aggs
1 parent 4b9f5ea commit baf7065

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

lib/logstash/inputs/elasticsearch/aggregation.rb

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,13 @@ def initialize(client, plugin)
1313
@plugin_params = plugin.params
1414

1515
@size = @plugin_params["size"]
16+
@query = @plugin_params["query"]
1617
@retries = @plugin_params["retries"]
18+
@agg_options = {
19+
:index => @plugin_params["index"],
20+
:size => 0
21+
}.merge(:body => @query)
22+
1723
@plugin = plugin
1824
end
1925

@@ -27,18 +33,10 @@ def retryable(job_name, &block)
2733
false
2834
end
2935

30-
def aggregation_options(query_object)
31-
{
32-
:index => @index,
33-
:size => 0,
34-
:body => query_object
35-
}
36-
end
37-
38-
def do_run(output_queue, query_object)
36+
def do_run(output_queue)
3937
logger.info("Aggregation starting")
4038
r = retryable(AGGREGATION_JOB) do
41-
@client.search(aggregation_options(query_object))
39+
@client.search(@agg_options)
4240
end
4341
@plugin.push_hit(r, output_queue, 'aggregations') if r
4442
end

0 commit comments

Comments
 (0)