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

Development

Runtime

< 2, >= 0.14.0
>= 0
 Project Readme

Fluent::Plugin::PostgresReplicator, a plugin for Fluentd

Gem Version Build Status

Fluentd input plugin to track insert/update event from PostgreSQL.

Requirements

fluent-plugin-postgres-replicator fluentd ruby
>= 0.1.0 >= v0.14.0 >= 2.1
< 0.1.0 >= v0.12.0 >= 1.9

Installation

$ apt-get install libpq-dev

$ gem install fluent-plugin-postgres-replicator

Configuration

<source>
  @type postgres_replicator
  host localhost
  username pipeline
  password pipeline
  database pipeline
  sql SELECT hour, project, total_pages from wiki_stats;
  primary_keys hour,project
  interval 1m
  tag replicator.pipeline.wiki_stats.${event}.${primary_keys}
</source>

Contributing

Bug reports and pull requests are welcome.

You can run the test on your machine as below.

$ docker run --name fluent-plugin-postgres-replicator-testing -e POSTGRES_DB=pg_repli_test_db -p 5432:5432 -d postgres:9.4.12-alpine
$ psql -c 'create table pg_repli_test_table (id int8 primary key, total int8) ;' -U postgres -h 127.0.0.1 -d pg_repli_test_db
$ psql -c 'insert into pg_repli_test_table values (1, 10) ;' -U postgres -h 127.0.0.1 -d pg_repli_test_db
$ psql -c 'insert into pg_repli_test_table values (2, 20) ;' -U postgres -h 127.0.0.1 -d pg_repli_test_db

$ bundle install --path vendor/bundle
$ bundle exec rake test

License