我在私有 vpc 网络中有一个 EC2 实例设置,其 IAM 角色如下所示:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "CloudWatchAccess",
"Effect": "Allow",
"Action": [
"cloudwatch:*"
],
"Resource": "*"
},
{
"Sid": "EC2",
"Effect": "Allow",
"Action": [
"ec2:DescribeInstances"
],
"Resource": "*"
}
]
}
我的logstash配置文件有:
input {
stdin{}
cloudwatch {
namespace => "AWS/EC2"
metrics => [ 'CPUUtilization']
filters => { "tag:TAG" => "VALUE" }
region => "us-east-1"
proxy_uri => “http://proxy.company.com:port/”
}
}
output {
stdout {
codec => rubydebug
}
elasticsearch {
hosts => ["IP:PORT"]
}
}
我使用以下方式启动我的logstash:
/path/to/logstash -f /path/to/logstash.conf
命令运行,我可以在调试模式下看到来自 cloudwatch 的数据:
{:timestamp=>"2016-04-13T17:26:40.685000-0400", :message=>"DPs: {:datapoints=>[{:timestamp=>2016-04-13 21:24:00 UTC, :sample_count=>2.0, :unit=>\"Percent\", :minimum=>0.17, :maximum=>0.25, :sum=>0.42000000000000004, :average=>0.21000000000000002}, {:timestamp=>2016-04-13 21:22:00 UTC, :sample_count=>2.0, :unit=>\"Percent\", :minimum=>0.08, :maximum=>0.17, :sum=>0.25, :average=>0.125}], :label=>\"CPUUtilization\", :response_metadata=>{:request_id=
但logstash 不会向elasticsearch 推送任何内容。
有谁知道可能是什么问题?或者知道我该如何调试?