logstash-plugins / logstash-input-cloudwatch

A Logstash input to pull events from the Amazon Web Services CloudWatch API
Apache License 2.0
43 stars 27 forks source link

A plugin had an unrecoverable error #12

Open pvencill opened 7 years ago

pvencill commented 7 years ago

I tried asking for help and debugging on both the forum and ServerFault, with no success. I am able to make AWS API calls from my server's command line, and I've verified that my aws credentials file allows read access to all users on the system (not that I'm crazy about that, but for debugging purposes I'm doing it).

input {
  cloudwatch {
   metrics => ["CPUUtilization"]
   filters => { "tag:Monitoring" => "Yes" }
   region => "us-east-1"
   namespace => "AWS/EC2"
   aws_credentials_file => "/home/pvencill/.aws/credentials" # this file is currently world-readable
  }
}
output {
  elasticsearch {
    hosts => ["localhost:9200"]
  }
}

Result is regular log entries of the format:

{:timestamp=>"2016-11-02T10:23:24.746000-0400", :message=>"A plugin had an unrecoverable error. Will restart this plugin.\n Plugin: <LogStash::Inputs::CloudWatch metrics=>[\"CPUUtilization\"], filters=>{\"tag:Monitoring\"=>\"Yes\"}, region=>\"us-east-1\", namespace=>\"AWS/EC2\", aws_credentials_file=>\"/home/pvencill/.aws/credentials\", codec=><LogStash::Codecs::Plain charset=>\"UTF-8\">, use_ssl=>true, statistics=>[\"SampleCount\", \"Average\", \"Minimum\", \"Maximum\", \"Sum\"], interval=>900, period=>300, combined=>false>\n Error: No metrics to query", :level=>:error}

kasarlajayapal commented 7 years ago

I am also facing the same issue when filtering through input cloudwatch .

Here is my Regular Log entries of Format.

[2016-12-02T10:46:21,495][INFO ][logstash.inputs.cloudwatch] Polling CloudWatch API [2016-12-02T10:46:21,496][ERROR][logstash.pipeline ] A plugin had an unrecoverable error. Will restart this plugin. Plugin: <LogStash::Inputs::CloudWatch namespace=>"AWS/EC2", filters=>{"tag:Name"=>"Logstash-NRT-dev-jnb699-IAM-rvm", "instance-id"=>"i-"}, region=>"us-east-1", period=>900, access_key_id=>"**", secret_access_key=>"***", session_token=>"****", id=>"4b8f5f4c9e8bbcbe8424a21513106bbf361bbf7c-1", enable_metric=>true, codec=><LogStash::Codecs::Plain id=>"plain_5d6527b4-bb8d-4e3e-9b37-04d299a7d4db", enable_metric=>true, charset=>"UTF-8">, use_ssl=>true, metrics=>["CPUUtilization", "DiskReadOps", "DiskWriteOps", "NetworkIn", "NetworkOut"], statistics=>["SampleCount", "Average", "Minimum", "Maximum", "Sum"], interval=>900, combined=>false> Error: No metrics to query