@pastash/output_pgsql

PgSQL Output Plugin for @pastash/pastash

Usage no npm install needed!

<script type="module">
  import pastashOutputPgsql from 'https://cdn.skypack.dev/@pastash/output_pgsql';
</script>

README

Postgres output plugin

Status : core plugin, unit tested and maintained.

This plugin is used insert JSONB data into Postgres.

Config using logstash format:

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);