配置cloudwatch - >通过java代码进行弹性搜索

问题描述:

如果您查看以下链接:http://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CWL_ES_Stream.html,有一种将日志组与弹性搜索域相关联的机制。你知道这可以通过java aws sdk完成,这样它可以在正在运行的应用程序中自动执行吗?配置cloudwatch - >通过java代码进行弹性搜索

假设EC域已被创建。

  1. 创建允许Cloudwatch日志访问ES的IAM角色。

    { 
    "Version": "2012-10-17", 
    
    "Statement": [ 
        { 
         "Action": [ 
          "es:*" 
         ], 
         "Effect": "Allow", 
         "Resource": "arn:aws:es:us-west-2:123456789012:domain/streaming-logs/*" 
        } 
        ] 
    
    } 
    
  2. Create the log group

  3. Create the Subscription filter