自分の設定漏れが原因でした。
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>