Skip to content

Commit

Permalink
Welcome to Ruby
Browse files Browse the repository at this point in the history
  • Loading branch information
Mathieu Martin committed May 25, 2018
1 parent cf048a3 commit 4f9bc4f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions lib/logstash/outputs/elasticsearch/helpers.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Small functions that don't require a full instance of the plugin should go here.
# This will promote lightning fast tests.
#
# Methods are defined right on the module to ensure no context can be shared with the plugin instance :-)
module LogStash; module Outputs; class ElasticSearch;
module Helpers
INDEX_REQUIRING_TIMESTAMP = /%{\+.+\}/
Expand Down
4 changes: 2 additions & 2 deletions spec/unit/outputs/elasticsearch_helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

describe LogStash::Outputs::ElasticSearch::Helpers do
context "detecting if an index name can be determined for an event" do
let(:event_with_ts) { LogStash::Event.new() }
let(:event_with_no_ts) { LogStash::Event.new().tap { |e| e.remove('@timestamp') } }
let(:event_with_ts) { LogStash::Event.new }
let(:event_with_no_ts) { LogStash::Event.new.tap { |e| e.remove('@timestamp') } }

context "when the index pattern doesn't include a timestamp" do
['my-index', 'logstash-%{normal_field_interpolation}'].each do |index|
Expand Down

0 comments on commit 4f9bc4f

Please sign in to comment.