thanks so the issue is .kibana index which does not have @timestamp. After I added the querry works without fields parameter but when I added to get the output back into one of the fields of the new event
if [type] == "cache" {
elasticsearch {
hosts => ["http://localhost:9200"]
query => "type:cache"
fields => ["sessionid", "message"]
}
}
I get the following in the logstash log. Not sure what I am doing wrong as I simplified to makes sure that sessionid exists on the retrieval an message field exists in the new event...
{:timestamp=>"2016-05-17T16:02:05.382000+0000", :message=>"Failed to query elasticsearch for previous event", :query=>"type:cache", :event=>#<LogStash::Event:0x2e30991a @metadata={}, @accessors=#<LogStash::Util::Accessors:0x789391a6 @store={"@version"=>"1", "@timestamp"=>"2016-05-17T16:01:59.613Z", "type"=>"cache", "beat"=>{"hostname"=>"2794669d9139", "name"=>"2794669d9139"}, "input_type"=>"log", "count"=>1, "fields"=>nil, .... "sessionid"=>"fe666e8e-a44e-425b-9dbb-6bd0815519b1", "client_sessionid"=>"fe666e8e-a44e-425b-9dbb-6bd0815519a1"}, @lut={"type"=>[{"@version"=>"1", "@timestamp"=>"2016-05-17T16:01:59.613Z", "type"=>"cache", "beat"=>{"hostname"=>"2794669d9139", "name"=>"2794669d9139"}, "input_type"=>"log", "count"=>1, "fields"=>nil, "source"=>"/dockershare/serviceB.log", "offset"=>36295, "host"=>"2794669d9139", "tags"=>["beats_input_codec_plain_applied"], "timestamp"=>"2016-05-03T11:53:15.761Z", "sessionid"=>"fe666e8e-a44e-425b-9dbb-6bd0815519b1", "client_sessionid"=>"fe666e8e-a44e-425b-9dbb-6bd0815519a1"}, "type"], "logregion"=>[{"@version"=>"1", "@timestamp"=>"2016-05-17T16:01:59.613Z", "type"=>"cache", "beat"=>{"hostname"=>"2794669d9139", "name"=>"2794669d9139"}, "input_type"=>"log", "count"=>1, "fields"=>nil, "...., "timestamp"=>"2016-05-03T11:53:15.761Z", "sessionid"=>"fe666e8e-a44e-425b-9dbb-6bd0815519b1", "client_sessionid"=>"fe666e8e-a44e-425b-9dbb-6bd0815519a1"}, "logregion"], "loglevel"=>[{"@version"=>"1", "@timestamp"=>"2016-05-17T16:01:59.613Z", "type"=>"cache", "beat"=>{"hostname"=>"2794669d9139", "name"=>"2794669d9139"}, "input_type"=>"log", "count"=>1, "fields"=>nil, "source"=>"/dockershare/serviceB.log", "offset"=>36295, "host"=>"2794669d9139", "tags"=>["beats_input_codec_plain_applied"], "timestamp"=>"2016-05-03T11:53:15.761Z", "sessionid"=>"fe666e8e-a44e-425b-9dbb-6bd0815519b1", "client_sessionid"=>"fe666e8e-a44e-425b-9dbb-6bd0815519a1"}, "loglevel"], "client_requestid"=>[{"@version"=>"1", "@timestamp"=>"2016-05-17T16:01:59.613Z", "type"=>"cache", "beat"=>{"hostname"=>"2794669d9139", "name"=>"2794669d9139"}, "input_type"=>"log", "count"=>1, "fields"=>nil, "source"=>"/dockershare/serviceB.log", "offset"=>36295, "host"=>"2794669d9139", "tags"=>["beats_input_codec_plain_applied"], "timestamp"=>"2016-05-03T11:53:15.761Z", "sessionid"=>"fe666e8e-a44e-425b-9dbb-6bd0815519b1", "client_sessionid"=>"fe666e8e-a44e-425b-9dbb-6bd0815519a1"}, "client_requestid"], "message"=>[{"@version"=>"1", "@timestamp"=>"2016-05-17T16:01:59.613Z", "type"=>"cache", "beat"=>{"hostname"=>"2794669d9139", "name"=>"2794669d9139"}, "input_type"=>"log", "count"=>1, "fields"=>nil, "source"=>"/dockershare/serviceB.log", "offset"=>36295, "host"=>"2794669d9139", "tags"=>["beats_input_codec_plain_applied"], "timestamp"=>"2016-05-03T11:53:15.761Z", "sessionid"=>"fe666e8e-a44e-425b-9dbb-6bd0815519b1", "client_sessionid"=>"fe666e8e-a44e-425b-9dbb-6bd0815519a1"}, "message"], "[type]"=>[{"@version"=>"1", "@timestamp"=>"2016-05-17T16:01:59.613Z", "type"=>"cache", "beat"=>{"hostname"=>"2794669d9139", "name"=>"2794669d9139"}, "input_type"=>"log", "count"=>1, "fields"=>nil, "source"=>"/dockershare/serviceB.log", "offset"=>36295, "host"=>"2794669d9139", "tags"=>["beats_input_codec_plain_applied"], "timestamp"=>"2016-05-03T11:53:15.761Z", "sessionid"=>"fe666e8e-a44e-425b-9dbb-6bd0815519b1", "client_sessionid"=>"fe666e8e-a44e-425b-9dbb-6bd0815519a1"}, "type"]}>, @data={"@version"=>"1", "@timestamp"=>"2016-05-17T16:01:59.613Z", "type"=>"cache", "beat"=>{"hostname"=>"2794669d9139", "name"=>"2794669d9139"}, "input_type"=>"log", "count"=>1, "fields"=>nil, "source"=>"/dockershare/serviceB.log", "offset"=>36295, "host"=>"2794669d9139", "tags"=>["beats_input_codec_plain_applied"], "timestamp"=>"2016-05-03T11:53:15.761Z", "sessionid"=>"fe666e8e-a44e-425b-9dbb-6bd0815519b1", "client_sessionid"=>"fe666e8e-a44e-425b-9dbb-6bd0815519a1"}, @metadata_accessors=#<LogStash::Util::Accessors:0x2e9ad16d @store={}, @lut={}>, @cancelled=false>, :error=>#<NoMethodError: undefined method `start_with?' for nil:NilClass>, :level=>:warn}
~
~
~