You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: pipeline/outputs/postgresql.md
+6-8Lines changed: 6 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
3
3
[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.
4
4
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.
6
6
7
7
PostgreSQL 9.4 or higher is required.
8
8
@@ -56,19 +56,17 @@ This plugin supports the following parameters:
56
56
57
57
| Key | Description | Default |
58
58
|:----|:------------|:-------|
59
-
|`async`| Define if the plugin will use asynchronous or synchronous connections. |`false`|
60
59
|`cockroachdb`| Set to `true` if you will connect the plugin with a CockroachDB. |`false`|
61
60
|`connection_options`| Specifies any valid [PostgreSQL connection options](https://www.postgresql.org/docs/devel/libpq-connect.html#LIBPQ-CONNECT-OPTIONS). |`_none_`|
62
61
|`database`| Database name to connect to. |`fluentbit`|
63
62
|`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`|
66
63
|`password`| Password of PostgreSQL username. |`_none_`|
67
64
|`port`| PostgreSQL port. |`5432`|
68
65
|`table`| Table name where to store data. |`fluentbit`|
69
-
|`timestamp_key`| Key in the JSON object containing the record timestamp. |`date`|
70
66
|`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.
72
70
73
71
### Libpq
74
72
@@ -96,7 +94,6 @@ pipeline:
96
94
database: fluentbit
97
95
table: fluentbit
98
96
connection_options: '-c statement_timeout=0'
99
-
timestamp_key: ts
100
97
```
101
98
102
99
{% endtab %}
@@ -113,7 +110,6 @@ pipeline:
113
110
Database fluentbit
114
111
Table fluentbit
115
112
Connection_Options -c statement_timeout=0
116
-
Timestamp_Key ts
117
113
```
118
114
119
115
{% endtab %}
@@ -127,6 +123,8 @@ The output plugin automatically creates a table with the name specified by the `
127
123
-`time TIMESTAMP WITHOUT TIMEZONE`
128
124
-`data JSONB`
129
125
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
+
130
128
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).
131
129
132
130
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