PgSQL Output Plugin for @pastash/pastash
npm install @pastash/output_pgsqlPostgres output plugin
---
Status : core plugin, unit tested and maintained.
This plugin is used insert JSONB data into Postgres.
output {
if [type] == nginx {
pgsql {
db => mydatabase
table => test
host => localhost
port => 5432
}
}
}
``Parameters:
*
database: name of the postgresql database.
* table: name of the postgresql table. Defaults to pastash.
* host: ip of the postgresql server.
* port: port of the postgresql server.
* id: JSON object to be used as identifier of inserts. Autogenerated if missing.
* user: username for postgresql.
* password: password for postgresql.
* create_table: create postgresql table upon initialization. Default to false.
`
CREATE TABLE IF NOT EXISTS pastash (id TEXT NOT NULL PRIMARY KEY, data JSONB NOT NULL);
``