pgsqloutput plugin allows users to send their data to a PostgreSQL database and store it using the
tableoption in the database defined by the
databaseoption hosted on the server defined by the
hostoption. It will use the PostgreSQL user defined by the
useroption, which needs to have the right privileges to create such a table in that database.
fluentbitin a database called
fluentbitthat is owned by the user
fluentbit. Feel free to use different names. Preferably, for security reasons, do not use the
postgresuser (which has
pwgen 20 1) and store it safely. Then, as
postgressystem user on the server where PostgreSQL is installed, execute:
fluentbitwithout superuser privileges will be created.
createuserapplication, you can directly use the SQL command
postgressystem user, please run:
fluentbitowned by the
fluentbituser. As a result, the
fluentbituser will be able to safely create the data table.
fluentbituser can connect to the
fluentbitdatabase on the specified target host. This might require you to properly configure the
tableconfiguration option and made up of the following fields:
time TIMESTAMP WITHOUT TIMEZONE
JSONBdata type in PostgreSQL, please refer to the JSON types page in the official documentation, where you can find instructions on how to index or query the objects (including
jsonpathintroduced in PostgreSQL 12).
BEFORE INSERTtriggers on the main table and re-route records on normalised tables, depending on tags and content of the actual JSON objects.
BEFORE INSERTtrigger (a function in
plpgsqllanguage) that normalises the content of the JSON object and that inserts the record in another table (with its own structure and partitioning model). This kind of triggers allow you to discard the record from the landing table by returning