2017-04-25 63 views
0

嘗試從aws Cloudwatch提取日誌時出現以下異常。請讓我知道如何讓插件工作。Logstash輸入cloudwatch插件無法正常工作

logstash版本:5.1.1 CloudWatch的輸入插件版本:2.0.0

10:51:06.452 [[主要] 「AWS /日誌」,指標=> [ 「IncomingLogEvents」],過濾器=> {「LogGroupName」=>「test」},id =>「5d5114c61b58d374e42e44ca04d64215282cf5c1-1」,enable_metric => true,codec =>「plain_be95e7fb-ed07-4d9c-a765-1a1308e51254」,enable_metric => true,charset =>「UTF 「> - >」us-east-1「,use_ssl => true,statistics => [」SampleCount「,」Average「,」Minimum「,」Maximum「,」Sum「],interval => 900 ,period => 300,combined => false> 錯誤:無查詢指標 例外情況:RuntimeError

回答

0

您是奔跑在本地機器上還是在AWS上?

本地機:


確保您使用插件的aws_credentials屬性設置在這樣或點logstash的conf文件的AWS憑據到本地的AWS憑據YAML文件

input { 
    cloudwatch { 
    namespace => "AWS/Logs" 
    metrics => [ "IncomingBytes", "IncomingLogEvents"] 
    filters => { "LogGroupName" => "/aws/lambda/your_lambda_name" } 
    region => "us-east-1" 
    access_key_id => "Insert access key ID" 
    secret_access_key => "Insert secret access key" 
    session_token => "Insert session token" 
    } 
} 
output { 
    elasticsearch { hosts => ["localhost:9200"] } 
    stdout { codec => rubydebug } 
} 

注意:如果您正在使用臨時AWS證書,請確保它們有效且未過期。

EC2


確保EC2實例的IAM實例配置文件訪問雲watch日誌。

參考 - Logstash Cloudwatch Input plugin