Fluentd(td-agent2)を用いてApache(2.2.15)のログをPostgresql(9.6.0)に格納しようとしています。
一通り、設定が完了したのですが、fluentdで以下のエラーが発生しており、上手く動作しません。
お手数ですが、問題解決に向けてアドバイスを頂けないでしょうか。宜しくお願いします。
◆td-agent.logのログ
2017-03-09 14:58:44 +0900 [info]: following tail of /var/log/httpd/access_log
2017-03-09 03:07:01 +0900 [warn]: suppressed same stacktrace
2017-03-09 11:13:14 +0900 [warn]: retry count exceededs limit.
2017-03-09 11:13:14 +0900 [warn]: suppressed same stacktrace
2017-03-09 11:13:14 +0900 [error]: throwing away old logs.
2017-03-09 14:58:42 +0900 [info]: shutting down fluentd
2017-03-09 14:58:42 +0900 [info]: shutting down input type="tail" plugin_id="object:3f9a8b9abae0"
2017-03-09 14:58:42 +0900 [info]: shutting down output type="pgjson" plugin_id="object:3f9a8b5716f0"
2017-03-09 14:58:42 +0900 [warn]: /opt/td-agent/embedded/lib/ruby/2.1.0/monitor.rb:211:in `mon_synchronize'
<source>
tag apache.access
port 5432
time_col time
2017-03-09 14:58:44 +0900 [info]: following tail of /var/log/httpd/access_log
2017-03-09 03:07:01 +0900 [warn]: suppressed same stacktrace
2017-03-09 11:13:14 +0900 [warn]: retry count exceededs limit.
2017-03-09 11:13:14 +0900 [warn]: suppressed same stacktrace
2017-03-09 11:13:14 +0900 [error]: throwing away old logs.
2017-03-09 14:58:42 +0900 [info]: shutting down fluentd
2017-03-09 14:58:42 +0900 [info]: shutting down input type="tail" plugin_id="object:3f9a8b9abae0"
2017-03-09 14:58:42 +0900 [info]: shutting down output type="pgjson" plugin_id="object:3f9a8b5716f0"
2017-03-09 14:58:42 +0900 [warn]: /opt/td-agent/embedded/lib/ruby/2.1.0/monitor.rb:211:in `mon_synchronize'
<source>
tag apache.access
port 5432
time_col time
2017-03-09 14:58:44 +0900 [info]: following tail of /var/log/httpd/access_log
host localhost
port 5432
time_col time
2017-03-09 14:58:44 +0900 [info]: following tail of /var/log/httpd/access_log
<source>
tag apache.access
port 5432
time_col time
2017-03-09 14:58:44 +0900 [info]: following tail of /var/log/httpd/access_log
2017-03-09 14:58:44 +0900 [info]: gem 'fluentd' version '0.12.31'
2017-03-09 14:58:44 +0900 [info]: adding match pattern="apache.access" type="pgjson"
2017-03-09 14:58:44 +0900 [info]: adding source type="tail"
2017-03-09 14:58:44 +0900 [info]: using configuration file: <ROOT>
<source>
type tail
format apache
path /var/log/httpd/access_log
pos_file /var/log/td-agent/pos/apache.test.log.pos
tag apache.access
</source>
<match apache.access>
type pgjson
host localhost
port 5432
database weblog
table fluentd
user postgres
password xxxxxx
time_col time
tag_col tag
record_col record
</match>
</ROOT>
2017-03-09 14:58:44 +0900 [info]: following tail of /var/log/httpd/access_log
2017-03-09 14:59:44 +0900 [warn]: temporarily failed to flush the buffer. next_retry=2017-03-09 14:59:45 +0900 error_class="RuntimeError" error="failed to initialize connection: FATAL: \xE3\x83\xA6\xE3\x83\xBC\xE3\x82\xB6\"postgres\"\xE3\x81\xAEIdent\xE8\xAA\x8D\xE8\xA8\xBC\xE3\x81\xAB\xE5\xA4\xB1\xE6\x95\x97\xE3\x81\x97\xE3\x81\xBE\xE3\x81\x97\xE3\x81\x9F\n" plugin_id="object:3fde721ebd34"
2017-03-09 14:59:44 +0900 [warn]: /opt/td-agent/embedded/lib/ruby/gems/2.1.0/gems/fluent-plugin-pgjson-0.0.8/lib/fluent/plugin/out_pgjson.rb:71:in `rescue in init_connection'
2017-03-09 14:59:44 +0900 [warn]: /opt/td-agent/embedded/lib/ruby/gems/2.1.0/gems/fluent-plugin-pgjson-0.0.8/lib/fluent/plugin/out_pgjson.rb:64:in `init_connection'
2017-03-09 14:59:44 +0900 [warn]: /opt/td-agent/embedded/lib/ruby/gems/2.1.0/gems/fluent-plugin-pgjson-0.0.8/lib/fluent/plugin/out_pgjson.rb:41:in `write'
2017-03-09 14:59:44 +0900 [warn]: /opt/td-agent/embedded/lib/ruby/gems/2.1.0/gems/fluentd-0.12.31/lib/fluent/buffer.rb:354:in `write_chunk'
2017-03-09 14:59:44 +0900 [warn]: /opt/td-agent/embedded/lib/ruby/gems/2.1.0/gems/fluentd-0.12.31/lib/fluent/buffer.rb:333:in `pop'
2017-03-09 14:59:44 +0900 [warn]: /opt/td-agent/embedded/lib/ruby/gems/2.1.0/gems/fluentd-0.12.31/lib/fluent/output.rb:342:in `try_flush'
2017-03-09 14:59:44 +0900 [warn]: /opt/td-agent/embedded/lib/ruby/gems/2.1.0/gems/fluentd-0.12.31/lib/fluent/output.rb:149:in `run'
2017-03-09 14:59:45 +0900 [warn]: temporarily failed to flush the buffer. next_retry=2017-03-09 14:59:47 +0900 error_class="RuntimeError" error="failed to initialize connection: FATAL: \xE3\x83\xA6\xE3\x83\xBC\xE3\x82\xB6\"postgres\"\xE3\x81\xAEIdent\xE8\xAA\x8D\xE8\xA8\xBC\xE3\x81\xAB\xE5\xA4\xB1\xE6\x95\x97\xE3\x81\x97\xE3\x81\xBE\xE3\x81\x97\xE3\x81\x9F\n" plugin_id="object:3fde721ebd34"
2017-03-09 14:59:45 +0900 [warn]: suppressed same stacktrace
2017-03-09 14:59:47 +0900 [warn]: temporarily failed to flush the buffer. next_retry=2017-03-09 14:59:50 +0900 error_class="RuntimeError" error="failed to initialize connection: FATAL: \xE3\x83\xA6\xE3\x83\xBC\xE3\x82\xB6\"postgres\"\xE3\x81\xAEIdent\xE8\xAA\x8D\xE8\xA8\xBC\xE3\x81\xAB\xE5\xA4\xB1\xE6\x95\x97\xE3\x81\x97\xE3\x81\xBE\xE3\x81\x97\xE3\x81\x9F\n" plugin_id="object:3fde721ebd34"
◆◆td-agentの設定
<source>
type tail
format apache
path /var/log/httpd/access_log
pos_file /var/log/td-agent/pos/apache.test.log.pos
tag apache.access
</source>
<match apache.access>
type pgjson
host localhost
port 5432
database weblog
table fluentd
user postgres
password XXXXXXXX
time_col time
tag_col tag
record_col record
</match>
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。