So I spinned up a 2 instance Amazon Elasticsearch cluster.
I have installed the logstash-output-amazon_es plugin. This is my logstash configuration file :
input {
file {
path => "/Users/user/Desktop/user/logs/*"
}
}
filter {
grok {
match => {
"message" => '%{COMMONAPACHELOG} %{QS}%{QS}'
}
}
date {
match => [ "timestamp", "dd/MMM/YYYY:HH:mm:ss Z" ]
locale => en
}
useragent {
source => "agent"
target => "useragent"
}
}
output {
amazon_es {
hosts => ["foo.us-east-1.es.amazonaws.com"]
region => "us-east-1"
index => "apache_elk_example"
template => "./apache_template.json"
template_name => "apache_elk_example"
template_overwrite => true
}
}
Now I am running this from my terminal:
/usr/local/opt/logstash/bin/logstash -f apache_logstash.conf
I get the error:
Failed to install template: undefined method `credentials' for nil:NilClass {:level=>:error}
I think I have got something completely wrong. Basically I just want to feed some dummy log inputs to my amazon elasticsearch cluster through logstash. How should I proceed?
Edit Storage type is Instance and access policy is set to accessible to all.
Edit
output {
elasticsearch {
hosts => ["foo.us-east-1.es.amazonaws.com"]
ssl => true
index => "apache_elk_example"
template => "./apache_template.json"
template_name => "apache_elk_example"
template_overwrite => true
}
}