spec/inputs/elasticsearch_spec.rb in logstash-input-elasticsearch-0.1.2 vs spec/inputs/elasticsearch_spec.rb in logstash-input-elasticsearch-0.1.3
- old
+ new
@@ -1,16 +1,16 @@
# encoding: utf-8
require "logstash/devutils/rspec/spec_helper"
require "logstash/inputs/elasticsearch"
require "elasticsearch"
-describe "inputs/elasticsearch" do
+describe "inputs/elasticsearch", :elasticsearch => true do
it "should retrieve json event from elasticseach" do
config = %q[
input {
elasticsearch {
- hosts => ["node01"]
+ hosts => ["localhost"]
scan => false
query => '{ "query": { "match": { "city_name": "Okinawa" } }, "fields": ["message"] }'
}
}
]
@@ -55,11 +55,11 @@
it "should retrieve json event from elasticseach with scan" do
config = %q[
input {
elasticsearch {
- hosts => ["node01"]
+ hosts => ["localhost"]
scan => true
query => '{ "query": { "match": { "city_name": "Okinawa" } }, "fields": ["message"] }'
}
}
]
@@ -155,11 +155,11 @@
context 'when defining docinfo' do
let(:config_metadata) do
%q[
input {
elasticsearch {
- hosts => ["node01"]
+ hosts => ["localhost"]
scan => false
query => '{ "query": { "match": { "city_name": "Okinawa" } }, "fields": ["message"] }'
docinfo => true
}
}
@@ -170,11 +170,11 @@
metadata_field = 'metadata_with_hash'
config_metadata_with_hash = %Q[
input {
elasticsearch {
- hosts => ["node01"]
+ hosts => ["localhost"]
scan => false
query => '{ "query": { "match": { "city_name": "Okinawa" } }, "fields": ["message"] }'
docinfo => true
docinfo_target => '#{metadata_field}'
}
@@ -193,11 +193,11 @@
metadata_field = 'metadata_with_string'
config_metadata_with_string = %Q[
input {
elasticsearch {
- hosts => ["node01"]
+ hosts => ["localhost"]
scan => false
query => '{ "query": { "match": { "city_name": "Okinawa" } }, "fields": ["message"] }'
docinfo => true
docinfo_target => '#{metadata_field}'
}
@@ -223,11 +223,11 @@
it 'should move the document information to the specified field' do
config = %q[
input {
elasticsearch {
- hosts => ["node01"]
+ hosts => ["localhost"]
scan => false
query => '{ "query": { "match": { "city_name": "Okinawa" } }, "fields": ["message"] }'
docinfo => true
docinfo_target => 'meta'
}
@@ -243,11 +243,11 @@
it "should allow to specify which fields from the document info to save to the @metadata field" do
fields = ["_index"]
config = %Q[
input {
elasticsearch {
- hosts => ["node01"]
+ hosts => ["localhost"]
scan => false
query => '{ "query": { "match": { "city_name": "Okinawa" } }, "fields": ["message"] }'
docinfo => true
docinfo_fields => #{fields}
}
@@ -265,10 +265,10 @@
context "when not defining the docinfo" do
it 'should keep the document information in the root of the event' do
config = %q[
input {
elasticsearch {
- hosts => ["node01"]
+ hosts => ["localhost"]
scan => false
query => '{ "query": { "match": { "city_name": "Okinawa" } }, "fields": ["message"] }'
}
}
]