質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.48%
Ruby

Rubyはプログラミング言語のひとつで、オープンソース、オブジェクト指向のプログラミング開発に対応しています。

RubyGems

RubyGemsはRubyによるプログラミングのためのパッケージマネジメントツールです。ユーザはこれを使用することで、Rubyライブラリのダウンロードやアップデートや、依存関係の自動解決が可能になります。

AWS(Amazon Web Services)

Amazon Web Services (AWS)は、仮想空間を機軸とした、クラスター状のコンピュータ・ネットワーク・データベース・ストーレッジ・サポートツールをAWSというインフラから提供する商用サービスです。

Fluentd

Fluentdは、オープンソースのログ収集ツールです。ログの収集方法、ログの記録先などのログデータ処理を柔軟にカスタマイズでき、インプットおよびアウトプットが全てプラグインとして実装されています。

Q&A

0回答

3024閲覧

td-agentのfluent-plugin-cloudwatch-logsの使い方について

teketeke

総合スコア46

Ruby

Rubyはプログラミング言語のひとつで、オープンソース、オブジェクト指向のプログラミング開発に対応しています。

RubyGems

RubyGemsはRubyによるプログラミングのためのパッケージマネジメントツールです。ユーザはこれを使用することで、Rubyライブラリのダウンロードやアップデートや、依存関係の自動解決が可能になります。

AWS(Amazon Web Services)

Amazon Web Services (AWS)は、仮想空間を機軸とした、クラスター状のコンピュータ・ネットワーク・データベース・ストーレッジ・サポートツールをAWSというインフラから提供する商用サービスです。

Fluentd

Fluentdは、オープンソースのログ収集ツールです。ログの収集方法、ログの記録先などのログデータ処理を柔軟にカスタマイズでき、インプットおよびアウトプットが全てプラグインとして実装されています。

0グッド

0クリップ

投稿2015/12/15 01:56

http://blog.cloudpack.jp/2014/07/23/aws-fluent-plugin-cloudwatch/

上記のサイトを参考に、td-agentを使って、
AWS の cloudwatch-logs のログを取得しようとしています。
単純に td-agent とコマンドを実行すると、ログが取得できるのですが、
service td-agent start , /etc/init.d/td-agent start として
実行すると、cloudwatch-logs のログが取得できなくなります。

ログにはエラーが出ていないので、原因が分からずにいます。
どなたか解決方法を御存じの方はいらっしゃいますでしょうか。


■環境情報

bash

1# cat /etc/redhat-release 2CentOS release 6.7 (Final) 3# ruby -v 4ruby 1.8.7 (2013-06-27 patchlevel 374) [x86_64-linux] 5 6# td-agent --version 7td-agent 0.10.55 8 9# gem -v 101.3.7 11 12・プラグインの一覧 13# cd /usr/lib64/fluent/ruby/lib/ruby/gems/1.9.1/gems/ 14# ls -1 15aws-sdk-1.52.0 16aws-sdk-2.2.5 17aws-sdk-core-2.2.5 18aws-sdk-resources-2.2.5 19aws-sdk-v1-1.52.0 20aws-sdk-v1-1.56.0 21bson-1.11.1 22bson-1.8.6 23bson_ext-1.8.6 24bundler-1.3.6 25cool.io-1.1.1 26cool.io-1.4.2 27diff-lcs-1.2.5 28fluentd-0.10.55 29fluent-logger-0.4.9 30fluent-mixin-config-placeholders-0.2.4 31fluent-mixin-config-placeholders-0.3.0 32fluent-mixin-plaintextformatter-0.2.6 33fluent-plugin-cloudwatch-logs-0.1.2 34fluent-plugin-flume-0.1.1 35fluent-plugin-mongo-0.7.3 36fluent-plugin-rewrite-tag-filter-1.4.1 37fluent-plugin-s3-0.4.1 38fluent-plugin-scribe-0.10.12 39fluent-plugin-td-0.10.22 40fluent-plugin-td-monitoring-0.1.3 41fluent-plugin-webhdfs-0.3.1 42git-1.2.8 43hirb-0.7.2 44httpclient-2.3.4.1 45httpclient-2.4.0 46http_parser.rb-0.5.1 47iobuffer-1.1.2 48ipaddress-0.8.0 49jeweler-1.6.2 50jmespath-1.1.3 51json-1.7.7 52ltsv-0.1.0 53mini_portile-0.6.0 54mixlib-cli-1.5.0 55mixlib-config-2.1.0 56mixlib-log-1.6.0 57mixlib-shellout-1.6.0 58mongo-1.8.6 59msgpack-0.4.7 60msgpack-0.5.12 61nokogiri-1.5.10 62ohai-6.20.0 63parallel-0.6.5 64rake-0.9.2.2 65rdoc-3.9.5 66rspec-3.0.0 67rspec-core-3.0.4 68rspec-expectations-3.0.4 69rspec-mocks-3.0.4 70rspec-support-3.0.4 71rubyzip-0.9.9 72sigdump-0.2.2 73string-scrub-0.0.3 74systemu-2.5.2 75td-0.11.5 76td-client-0.8.66 77td-logger-0.3.23 78thread_safe-0.3.5 79thrift-0.8.0 80tzinfo-1.2.2 81tzinfo-data-1.2015.7 82uuidtools-2.1.5 83webhdfs-0.5.5 84yajl-ruby-1.1.0 85 86■td-agent 設定ファイル 87# cat td-agent.conf 88<source> 89 type monitor_agent 90 bind 0.0.0.0 91 port 24220 92</source> 93include conf.d/*.conf 94 95# cat cloudwatch-logs.conf 96<source> 97 type forward 98</source> 99 100<source> 101 type cloudwatch_logs 102 tag test.cloudwatch_logs.in 103 log_group_name fluent-plugin-cloudwatch-example 104 log_stream_name fluent-plugin-cloudwatch-example 105 state_file /tmp/fluent-plugin-cloudwatch-example.state 106</source> 107 108<match test.cloudwatch_logs.in> 109 type file 110 path /tmp/cloudwatch_logs 111</match> 112 113■td-agent起動時のログ 114※起動コマンド /etc/init.d/td-agent start 115~~~~~ 1162015-12-15 10:10:11 +0900 [info]: starting fluentd-0.10.55 1172015-12-15 10:10:11 +0900 [info]: reading config file path="/etc/td-agent/td-agent.conf" 1182015-12-15 10:10:11 +0900 [info]: gem 'fluent-mixin-config-placeholders' version '0.3.0' 1192015-12-15 10:10:11 +0900 [info]: gem 'fluent-mixin-config-placeholders' version '0.2.4' 1202015-12-15 10:10:11 +0900 [info]: gem 'fluent-mixin-plaintextformatter' version '0.2.6' 1212015-12-15 10:10:11 +0900 [info]: gem 'fluent-plugin-cloudwatch-logs' version '0.1.2' 1222015-12-15 10:10:11 +0900 [info]: gem 'fluent-plugin-flume' version '0.1.1' 1232015-12-15 10:10:11 +0900 [info]: gem 'fluent-plugin-mongo' version '0.7.3' 1242015-12-15 10:10:11 +0900 [info]: gem 'fluent-plugin-rewrite-tag-filter' version '1.4.1' 1252015-12-15 10:10:11 +0900 [info]: gem 'fluent-plugin-s3' version '0.4.1' 1262015-12-15 10:10:11 +0900 [info]: gem 'fluent-plugin-scribe' version '0.10.12' 1272015-12-15 10:10:11 +0900 [info]: gem 'fluent-plugin-td' version '0.10.22' 1282015-12-15 10:10:11 +0900 [info]: gem 'fluent-plugin-td-monitoring' version '0.1.3' 1292015-12-15 10:10:11 +0900 [info]: gem 'fluent-plugin-webhdfs' version '0.3.1' 1302015-12-15 10:10:11 +0900 [info]: gem 'fluentd' version '0.10.55' 1312015-12-15 10:10:11 +0900 [info]: using configuration file: <ROOT> 132 <source> 133 type monitor_agent 134 bind 0.0.0.0 135 port 24220 136 </source> 137 <source> 138 type forward 139 </source> 140 <source> 141 type cloudwatch_logs 142 tag test.cloudwatch_logs.in 143 log_group_name fluent-plugin-cloudwatch-example 144 log_stream_name fluent-plugin-cloudwatch-example 145 state_file /tmp/fluent-plugin-cloudwatch-example.state 146 </source> 147 <match test.cloudwatch_logs.in> 148 type file 149 path /tmp/cloudwatch_logs 150 </match> 151</ROOT> 1522015-12-15 10:10:11 +0900 [info]: adding source type="monitor_agent" 1532015-12-15 10:10:11 +0900 [info]: adding source type="forward" 1542015-12-15 10:10:11 +0900 [info]: adding source type="cloudwatch_logs" 1552015-12-15 10:10:11 +0900 [info]: adding match pattern="test.cloudwatch_logs.in" type="file" 1562015-12-15 10:10:11 +0900 [info]: listening fluent socket on 0.0.0.0:24224 157~~~~~ 158※td-agent を実行した場合のps 159root 2040 1498 2 13:13 pts/0 00:00:00 /usr/lib64/fluent/ruby/bin/ruby /usr/sbin/td-agent 160root 2042 2040 1 13:13 pts/0 00:00:00 /usr/lib64/fluent/ruby/bin/ruby /usr/sbin/td-agent 161 162※/etc/init.d/td-agent start を実行した場合のps 163td-agent 5531 1 0 09:44 ? 00:00:00 /usr/lib64/fluent/ruby/bin/ruby /usr/sbin/td-agent --group td-agent --log /var/log/td-agent/td-agent.log --daemon /var/run/td-agent/td-agent.pid 164td-agent 5534 5531 0 09:44 ? 00:00:00 /usr/lib64/fluent/ruby/bin/ruby /usr/sbin/td-agent --group td-agent --log /var/log/td-agent/td-agent.log --daemon /var/run/td-agent/td-agent.pid 165

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

まだ回答がついていません

会員登録して回答してみよう

アカウントをお持ちの方は

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.48%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問