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