Skip to content

Commit d242dcb

Browse files
author
ibinyami
committed
changing depracted api in ES6
1 parent 32ca02c commit d242dcb

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

lib/logstash/outputs/elasticsearch/common.rb

+3-3
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def event_action_tuple(event)
4343
:_id => @document_id ? event.sprintf(@document_id) : nil,
4444
:_index => event.sprintf(@index),
4545
:_type => get_event_type(event),
46-
:_routing => @routing ? event.sprintf(@routing) : nil
46+
:routing => @routing ? event.sprintf(@routing) : nil
4747
}
4848

4949
if @pipeline
@@ -55,7 +55,7 @@ def event_action_tuple(event)
5555
join_value = event.get(@join_field)
5656
parent_value = event.sprintf(@parent)
5757
event.set(@join_field, { "name" => join_value, "parent" => parent_value })
58-
params[:_routing] = event.sprintf(@parent)
58+
params[:routing] = event.sprintf(@parent)
5959
else
6060
params[:parent] = event.sprintf(@parent)
6161
end
@@ -64,7 +64,7 @@ def event_action_tuple(event)
6464
if action == 'update'
6565
params[:_upsert] = LogStash::Json.load(event.sprintf(@upsert)) if @upsert != ""
6666
params[:_script] = event.sprintf(@script) if @script != ""
67-
params[:_retry_on_conflict] = @retry_on_conflict
67+
params[:retry_on_conflict] = @retry_on_conflict
6868
end
6969

7070
if @version

spec/integration/outputs/retry_spec.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
describe "failures in bulk class expected behavior", :integration => true do
55
let(:template) { '{"template" : "not important, will be updated by :index"}' }
66
let(:event1) { LogStash::Event.new("somevalue" => 100, "@timestamp" => "2014-11-17T20:37:17.223Z", "@metadata" => {"retry_count" => 0}) }
7-
let(:action1) { ["index", {:_id=>nil, :_routing=>nil, :_index=>"logstash-2014.11.17", :_type=>"doc"}, event1] }
7+
let(:action1) { ["index", {:_id=>nil, :routing=>nil, :_index=>"logstash-2014.11.17", :_type=>"doc"}, event1] }
88
let(:event2) { LogStash::Event.new("geoip" => { "location" => [ 0.0, 0.0] }, "@timestamp" => "2014-11-17T20:37:17.223Z", "@metadata" => {"retry_count" => 0}) }
9-
let(:action2) { ["index", {:_id=>nil, :_routing=>nil, :_index=>"logstash-2014.11.17", :_type=>"doc"}, event2] }
9+
let(:action2) { ["index", {:_id=>nil, :routing=>nil, :_index=>"logstash-2014.11.17", :_type=>"doc"}, event2] }
1010
let(:invalid_event) { LogStash::Event.new("geoip" => { "location" => "notlatlon" }, "@timestamp" => "2014-11-17T20:37:17.223Z") }
1111

1212
def mock_actions_with_response(*resp)

spec/unit/outputs/elasticsearch_spec.rb

+3-3
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@
355355

356356
it "should not set the retry_on_conflict parameter when creating an event_action_tuple" do
357357
action, params, event_data = subject.event_action_tuple(event)
358-
expect(params).not_to include({:_retry_on_conflict => num_retries})
358+
expect(params).not_to include({:retry_on_conflict => num_retries})
359359
end
360360
end
361361

@@ -364,7 +364,7 @@
364364

365365
it "should set the retry_on_conflict parameter when creating an event_action_tuple" do
366366
action, params, event_data = subject.event_action_tuple(event)
367-
expect(params).to include({:_retry_on_conflict => num_retries})
367+
expect(params).to include({:retry_on_conflict => num_retries})
368368
end
369369
end
370370

@@ -373,7 +373,7 @@
373373

374374
it "should set the retry_on_conflict parameter when creating an event_action_tuple" do
375375
action, params, event_data = subject.event_action_tuple(event)
376-
expect(params).to include({:_retry_on_conflict => num_retries})
376+
expect(params).to include({:retry_on_conflict => num_retries})
377377
expect(action).to eq("update")
378378
end
379379
end

spec/unit/outputs/error_whitelist_spec.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
describe "whitelisting error types in expected behavior" do
55
let(:template) { '{"template" : "not important, will be updated by :index"}' }
66
let(:event1) { LogStash::Event.new("somevalue" => 100, "@timestamp" => "2014-11-17T20:37:17.223Z") }
7-
let(:action1) { ["index", {:_id=>1, :_routing=>nil, :_index=>"logstash-2014.11.17", :_type=>"doc"}, event1] }
7+
let(:action1) { ["index", {:_id=>1, :routing=>nil, :_index=>"logstash-2014.11.17", :_type=>"doc"}, event1] }
88
let(:settings) { {"manage_template" => true, "index" => "logstash-2014.11.17", "template_overwrite" => true, "hosts" => get_host_port() } }
99

1010
subject { LogStash::Outputs::ElasticSearch.new(settings) }

0 commit comments

Comments
 (0)