No commit activity in last 3 years
No release in over 3 years
fluentd plugin for Amazon RDS for PostgreSQL log input with slow query support
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.7

Runtime

 Project Readme

Amazon RDS for PostgreSQL log input plugin for fluentd

Overview

  • Amazon Web Services RDS log input plugin for fluentd
  • Forked from fluentd-plugin-rds-pgsql-log
  • Add slow query duration parsing.
  • Modify time to ISO 8601 format for ELK

Installation

$ fluentd-gem install fluent-plugin-rds-pgsql-slow-query-log

AWS ELB Settings

When SSL certification error

log:

SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed

Do env setting follows:

SSL_CERT_FILE=/etc/ssl/certs/ca-bundle.crt (If you using amazon linux)

Configuration

<source>
  type rds_pgsql_slow_query_log
  # required
  region                 <region name>
  db_instance_identifier <instance identifier>
  # optional if you can IAM credentials
  access_key_id          <access_key>
  secret_access_key      <secret_access_key>
  # optional
  refresh_interval       <interval number by second(default: 30)>
  tag                    <tag name(default: rds-pgsql.log>
  pos_file               <log getting position file(default: rds-pgsql.log)>
</source>

Example setting

<source>
  type rds_pgsql_log
  region ap-northeast-1
  db_instance_identifier test-postgres
  access_key_id     XXXXXXXXXXXXXXXXXXXX
  secret_access_key xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
  refresh_interval  30
  tag pgsql.log
  pos_file /tmp/pgsql-log-pos.dat
</source>

<match pgsql.log>
  type stdout
</match>

json output example


{"time":"2015-10-04T05:55:10+00:00",
 "host":"192.168.30.175(53092)",
 "user":"testuser",
 "database":"db1",
 "pid":"9769",
 "message_level":"LOG",
 "message":"  statement: select 1;",
 "log_file_name":"error/postgresql.log.2015-05-30-02"
}