No commit activity in last 3 years
No release in over 3 years
Amazon RDS gen_log input plugin for Fluent event collector
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 10.0.4
~> 3.1.3

Runtime

~> 0.3.11
 Project Readme

This plugin was made based off the slowlog plugin code. This new plugin fluent-plugin-rds-genlog

Build Status

RDS Setting

Working with MySQL Database Log Files / aws documentation

  • Set the general_log parameter to 1

Overview

AWS RDS general_log input plugin.

  1. "CALL mysql.rds_rotate_general_log"
  2. "SELECT * FROM general_log_backup"
  3. "INSERT INTO yourdb.general_log_custom_backup SELECT * FROM general_log_backup" (if you want to take a backup)

every 10 seconds from AWS RDS.

Configuration

<source>
  type rds_genlog
  tag rds-genlog
  host [RDS Hostname]
  username [RDS Username]
  password [RDS Password]
  backup_table [Your Backup Tablename]<-- Optional (Not recommended)
</source>

PLEASE NOTE: The new backup table (yourdb.general_log_custom_backup) is OPTIONAL. And can cause performance degradation. If you simply leave out the backup_table line in the source config, then the script will run the CALL mysql.rds_rotate_general_log then do a SELECT from the mysql.general_log_backup table. This is the most efficient way to both manage the logs and also the most efficient way to use this plugin.

Example GET RDS general_log

<source>
  type rds_genlog
  tag rds-genlog
  host [RDS Hostname]
  username [RDS Username]
  password [RDS Password]
  interval 10
  backup_table [Your Backup Tablename] # Optional, not recommended.
</source>

<match rds-genlog>
  type copy
 <store>
  type file
  path /var/log/general_log
 </store>
</match>

output data format

2013-03-08T16:04:43+09:00       rds-genlog     {"start_time":"2013-03-08 07:04:38","user_host":"rds_db[rds_db] @  [192.0.2.10]","event_time":"00:00:00","command_type":"QUERY", "server_id":"100000000","argument":"select foo from bar"}
2013-03-08T16:04:43+09:00       rds-genlog     {"start_time":"2013-03-08 07:04:38","user_host":"rds_db[rds_db] @  [192.0.2.10]","event_time":"00:00:00","command_type":"QUERY", "server_id":"100000000","argument":"select sleep(2)"}

if not connect

  • td-agent.log
2013-06-29 00:32:55 +0900 [error]: fluent-plugin-rds-genlog: cannot connect RDS