LoginSignup
0
0

More than 5 years have passed since last update.

td-agentで"Elasticsearch::Transport::Transport::Errors::Unauthorized"エラーが発生した際の対応について

Posted at

自分の設定漏れが原因でした。
Elasticsearch::Transport::Transport::Errors::Unauthorizedは以下に記載される原因以外でも発生する可能性はあります。


td-agentからElasticsearchにログを流し込む際、以下のエラーが発生してElasticsearchにログがインポートさ
れない問題が発生。

2016-12-26 22:20:29 +0900 [warn]: temporarily failed to flush the buffer. next_retry=2016-12-26 22:21:03 +0900 error_class="Elasticsearch::Transport::Transport::Errors::Unauthorized" error="[401] " plugin_id="object:3ffeb220e400"

x-packを入れていたため、basic認証で弾かれていたのでした。
ドキュメントにあるようにtd-agent.confにuserとpasswordを追加して解決。

td-agent.conf
 <store>
    @type elasticsearch
    host 127.0.0.1
    port 9200
    user elastic
    password changeme
    index_name uptime
    type_name uptime
    logstash_format true
    logstash_prefix uptime
    flush_interval  1s
  </store>
0
0
0

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
0
0