LoginSignup
11
10

More than 5 years have passed since last update.

fluentdからAmazon Elasticsearch ServiceにPOSTする

Last updated at Posted at 2015-11-30

403エラーに悩まされたのでメモ。

結論

これと同じエラーで悩まされたが、以下の設定でfluent-plugin-aws-elasticsearch-serviceは正常に動いた。

fluentd側

fluent-plugin-aws-elasticsearch-serviceのインストール

sudo td-agent-gem install fluent-plugin-aws-elasticsearch-service

configサンプル

type_nameが無いと403エラーになる

<match **.**>
  type copy

  <store>
    type aws-elasticsearch-service
    type_name access_log
    logstash_format true
    include_tag_key true
    tag_key @log_name
    flush_interval 10s

    <endpoint>
       url https://search-***.ap-northeast-1.es.amazonaws.com
       region ap-northeast-1
       access_key_id ***
       secret_access_key ***
    </endpoint>
  </store>
</match>

AWS ES側

policy

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Principal": {
        "AWS": [
          "arn:aws:iam::***:user/***"
        ]
      },
      "Action": "es:*",
      "Resource": "arn:aws:es:ap-northeast-1:***:domain/***/*"
    }
  ]
}
11
10
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
11
10