File tree Expand file tree Collapse file tree 1 file changed +8
-10
lines changed
lib/logstash/inputs/elasticsearch Expand file tree Collapse file tree 1 file changed +8
-10
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,13 @@ def initialize(client, plugin)
13
13
@plugin_params = plugin . params
14
14
15
15
@size = @plugin_params [ "size" ]
16
+ @query = @plugin_params [ "query" ]
16
17
@retries = @plugin_params [ "retries" ]
18
+ @agg_options = {
19
+ :index => @plugin_params [ "index" ] ,
20
+ :size => 0
21
+ } . merge ( :body => @query )
22
+
17
23
@plugin = plugin
18
24
end
19
25
@@ -27,18 +33,10 @@ def retryable(job_name, &block)
27
33
false
28
34
end
29
35
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 )
39
37
logger . info ( "Aggregation starting" )
40
38
r = retryable ( AGGREGATION_JOB ) do
41
- @client . search ( aggregation_options ( query_object ) )
39
+ @client . search ( @agg_options )
42
40
end
43
41
@plugin . push_hit ( r , output_queue , 'aggregations' ) if r
44
42
end
You can’t perform that action at this time.
0 commit comments