Skip to content

Commit 9007e77

Browse files
authored
output: update pgsql documentation (#2542)
Signed-off-by: Jonathan Gonzalez V. <jonathan.abdiel@gmail.com>
1 parent 20eda88 commit 9007e77

1 file changed

Lines changed: 6 additions & 8 deletions

File tree

pipeline/outputs/postgresql.md

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[PostgreSQL](https://www.postgresql.org) is an open source database management system that supports the SQL language and is capable of storing both structured and unstructured data, such as JSON objects.
44

5-
Fluent Bit is designed to work with JSON objects, and the `pgsql` output plugin allows users to send their data to a PostgreSQL database and store it using the `JSONB` type.
5+
The `pgsql` output plugin accepts log records and stores each record body in a PostgreSQL database using the `JSONB` type.
66

77
PostgreSQL 9.4 or higher is required.
88

@@ -56,19 +56,17 @@ This plugin supports the following parameters:
5656

5757
| Key | Description | Default |
5858
|:----|:------------|:-------|
59-
| `async` | Define if the plugin will use asynchronous or synchronous connections. | `false` |
6059
| `cockroachdb` | Set to `true` if you will connect the plugin with a CockroachDB. | `false` |
6160
| `connection_options` | Specifies any valid [PostgreSQL connection options](https://www.postgresql.org/docs/devel/libpq-connect.html#LIBPQ-CONNECT-OPTIONS). | `_none_` |
6261
| `database` | Database name to connect to. | `fluentbit` |
6362
| `host` | Hostname/IP address of the PostgreSQL instance. | `127.0.0.1` |
64-
| `max_pool_size` | Maximum amount of connections in asynchronous mode. | `4` |
65-
| `min_pool_size` | Minimum number of connections in asynchronous mode. | `1` |
6663
| `password` | Password of PostgreSQL username. | `_none_` |
6764
| `port` | PostgreSQL port. | `5432` |
6865
| `table` | Table name where to store data. | `fluentbit` |
69-
| `timestamp_key` | Key in the JSON object containing the record timestamp. | `date` |
7066
| `user` | PostgreSQL username. | `_none_` |
71-
| `workers` | The number of [workers](../../administration/multithreading.md#outputs) to perform flush operations for this output. | `0` |
67+
| `workers` | The number of [workers](../../administration/multithreading.md#outputs) to perform flush operations for this output. | `1` |
68+
69+
The plugin uses one PostgreSQL connection per worker. The previous `async`, `max_pool_size`, and `min_pool_size` settings are no longer supported.
7270

7371
### Libpq
7472

@@ -96,7 +94,6 @@ pipeline:
9694
database: fluentbit
9795
table: fluentbit
9896
connection_options: '-c statement_timeout=0'
99-
timestamp_key: ts
10097
```
10198
10299
{% endtab %}
@@ -113,7 +110,6 @@ pipeline:
113110
Database fluentbit
114111
Table fluentbit
115112
Connection_Options -c statement_timeout=0
116-
Timestamp_Key ts
117113
```
118114

119115
{% endtab %}
@@ -127,6 +123,8 @@ The output plugin automatically creates a table with the name specified by the `
127123
- `time TIMESTAMP WITHOUT TIMEZONE`
128124
- `data JSONB`
129125

126+
Each flushed log record becomes one row in the destination table. The `time` column is populated from the Fluent Bit event timestamp, and the `data` column stores only the record body as `JSONB`, so a separate `timestamp_key` setting is no longer needed.
127+
130128
The timestamp doesn't contain any information about the time zone, and it's therefore referred to the time zone used by the connection to PostgreSQL (`timezone` setting).
131129

132130
For more information about the `JSONB` data type in PostgreSQL, refer to the [JSON types](https://www.postgresql.org/docs/current/datatype-json.html) page in the official documentation. You can find instructions on how to index or query the objects (including `jsonpath` introduced in PostgreSQL 12).

0 commit comments

Comments
 (0)