所以我启动了一个 2 实例 Amazon Elasticsearch 集群。
我已经安装了logstash-output-amazon_es插件。这是我的logstash配置文件:
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
}
}
现在我从我的终端运行它:
/usr/local/opt/logstash/bin/logstash -f apache_logstash.conf
我得到错误:
Failed to install template: undefined method `credentials' for nil:NilClass {:level=>:error}
我想我完全错了。基本上我只想通过logstash向我的亚马逊elasticsearch集群提供一些虚拟日志输入。我应该如何进行?
编辑存储类型为实例,访问策略设置为可供所有人访问。
编辑
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
}
}