I am getting the following error while trying to read ELB logs from an S3 bucket.
The instance running logstash is in same region a bucket and booted with a role that gives it full S3 access.
Error: can't convert nil into String
[2016-11-30T18:35:47,828][ERROR][logstash.pipeline ] A plugin had an unrecoverable error. Will restart this plugin
Here is my conf file:
input {
s3 {
type => "elb"
bucket => "***-test"
region => "us-east-1"
# use_ssl => false
}
}
filter {
if [type] == "elb" {
grok {
match => [ "message", "%{TIMESTAMP_ISO8601:timestamp} %{NOTSPACE:loadbalancer} %{IP:client_ip}:%{NUMBER:client_port:int} %{IP:backend_ip}:%{NUMBER:backend_port:int} %{NUMBER:request_processing_time:float} %{NUMBER:backend_processing_time:float} %{NUMBER:response_processing_time:float} %{NUMBER:elb_status_code:int} %{NUMBER:backend_status_code:int} %{NUMBER:received_bytes:int} %{NUMBER:sent_bytes:int} %{QS:request}" ]
}
date {
match => [ "timestamp", "ISO8601" ]
}
Add geolocalization attributes based on ip.
geoip {
source => "ip"
}
}
}
EDIT: It turns out that I read the s3 input plugin doc too quickly, as regexp is not supported, so the above will not work. However, I would expect the below to work, and it does not.
I have tried that before as well, can you verify your path is right?
If I add this:
prefix => "AWSLogs/MYACCCOUNTNUMBER/elasticloadbalancing/us-east-1/"
I get the same error
but if I make a "mistake":
prefix => "AWSLogs/MYACCCOUNTNUMBER/elasticloadbalancing/us-west-1/"
then the error disappears, but I am guessing its because it doesn't find anything to process
No such luck. I just found the same thing you did -- when the path is accurate I get the can't convert nil to String message but when it doesn't match I get no error at all and, obviously, nothing in Elasticsearch.
I am pretty sure it is the sincedb_path though. I turned on debugging on the logstash.yml settings file and it pointed to that function in s3 rb plugin.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.