简体   繁体   English

无法使用logstash将数据发送到AWS弹性搜索实例

[英]Unable to send data to AWS elastic search instance using logstash

I am trying to send data to AWS elastic search end point using logstash that is installed on my local machine. 我正在尝试使用安装在我本地计算机上的logstash将数据发送到AWS弹性搜索端点。

The logstash conf file looks like this logstash conf文件如下所示

input {
     file {
        path => "/path/log.txt"
      }
}
output {
   amazon_es {
        hosts => ["https://search-abclostashtrial-5jdfc43oqql7qsrhfgbvwewku.us-east-2.es.amazonaws.com"]
    action => "index"   
    region => "us-east-2"   
    index => "trial"
    ssl => true

    }
}

The Elastic search Access policy looks like this 弹性搜索访问策略如下所示

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Principal": {
        "AWS": "*"
      },
      "Action": "es:*",
      "Resource": "arn:aws:es:us-east-2:0415721453395:domain/abclostashtrial/*"
    }
  ]
}

I am using logstash-output-amazon_es plugin to send the query like 我正在使用logstash-output-amazon_es插件来发送查询

sudo bin/logstash -f /path/logstash/abc.conf

And I get the following error log. 我得到以下错误日志。

[ERROR] 2019-04-30 20:05:52.900 [Converge PipelineAction::Create<main>] agent - Failed to execute action {:id=>:main, :action_type=>LogStash::ConvergeResult::FailedAction, :message=>"Could not execute action: PipelineAction::Create<main>, action_result: false", :backtrace=>nil} 
[INFO ] 2019-04-30 20:05:53.165 [Api Webserver] agent - Successfully started Logstash API endpoint {:port=>9600} 
[INFO ] 2019-04-30 20:05:58.037 [LogStash::Runner] runner - Logstash shut down.

What am I missing here ? 我在这里错过了什么?

One option to start with is to create an AccessKey that has rights to write to Elasticsearch, and configure that in the output. 一个选项是创建一个AccessKey,它有权写入Elasticsearch,并在输出中配置它。 Example: 例:

amazon_es {
    hosts => ["vpc-xxxxxxxxx-es-yyyyyy4pywmwigwi47em.us-east-1.es.amazonaws.com"]
    region => "us-east-1"
    aws_access_key_id => 'AKIxxxxxxxxxxx'
    aws_secret_access_key => '11xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
    index => "production-logindex-%{+YYYY.MM.dd}"
    }

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM