Hi,
I am trying to pull Cloudwatch logs (specifically EC2 status) into Logstash. I can retrieve the status using AWS_CLI, but the CloudWatch plugin throws the following error:
Pipeline_id:main
Plugin: <LogStash::Inputs::CloudWatch access_key_id=>"
Error: uninitialized constant Aws::EC2
Exception: NameError
My logstash_config.conf file is:
input {
cloudwatch {
namespace => "AWS/EC2"
metrics => ["StatusCheckFailed"]
filters => { "instance-id" => "i-ccc"}
region => "us-east-1"
access_key_id => "aaaa"
secret_access_key => "bbb"
}
}
filter {
#}
output {
stdout{
codec => rubydebug
}
}
I am expecting to receive teh logs from Cloudwatch and print on stdout when I run logstash with this config file.
I do get the status via AWS_CLI when I run > aws ec2 describe-instance-status --instance-ids i-cccc
as below
{
"InstanceStatuses": [
{
"AvailabilityZone": "us-east-1c",
"InstanceId": "i-cccc",
"InstanceState": {
"Code": 16,
"Name": "running"
},
"InstanceStatus": {
"Details": [
{
"Name": "reachability",
"Status": "passed"
}
],
"Status": "ok"
},
"SystemStatus": {
"Details": [
{
"Name": "reachability",
"Status": "passed"
}
],
"Status": "ok"
}
}
]
}
Any pointers on what needs to be corrected please? Appreciate in advance.