No commit activity in last 3 years
No release in over 3 years
Fluentd Output Plugin for PostgreSQL JSON Type.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies

Development

>= 11.0
>= 3.1.0

Runtime

>= 1.0.0, < 2
>= 0
 Project Readme

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

linux

Output Plugin for PostgreSQL Json Type.

Json type is availble in PostgreSQL version over 9.2

Requirements

fluent-plugin-pgjson fluentd Ruby
>= 1.0.0 >= v1.0.0 >= 2.2
< 1.0.0 >= v0.12.0 >= 1.9

Installation

$ fluent-gem install fluent-plugin-pgjson

Schema

Specified table must have following schema:

col type
{tag_col} Text
{time_col} Timestamp WITH TIME ZONE
{record_col} Json

Example

CREATE TABLE fluentd (
    tag Text
    ,time Timestamptz
    ,record Json
);

JSONB?

Yes! Just define a record column as JSONB type.

CREATE TABLE fluentd (
    tag Text
    ,time Timestamptz
    ,record Jsonb
);

Configuration

Example

<match **>
  @type pgjson
  #host localhost
  #port 5432
  #sslmode prefer
  database fluentd
  table fluentd
  user postgres
  password postgres
  #time_col time
  #tag_col tag
  #record_col record
  #msgpack false
  #encoder yajl
</match>

Parameter

parameter description default
host The hostname of PostgreSQL server localhost
port The port of PostgreSQL server 5432
sslmode Set the sslmode to enable Eavesdropping protection/MITM protection. See PostgreSQL Documentation for more details. (disable, allow, prefer, require, verify-ca, verify-full) prefer
database The database name to connect
table The table name to insert records
user The user name to connect database nil
password The password to connect database nil
time_col The column name for the time time
tag_col The column name for the tag tag
record_col The column name for the record record
msgpack If true, insert records formatted as msgpack false
encoder JSON encoder (yajl, json) yajl

Copyright

  • Copyright (c) 2014- OKUNO Akihiro
  • License
    • Apache License, version 2.0