@@ -61,38 +61,83 @@ server {
6161
6262From the command line you can let Fluent Bit generate the checks with the following options:
6363
64- ``` bash
65- fluent-bit -i nginx_metrics -p host=127.0.0.1 -p port=80 -p status_url=/status -p nginx_plus=off -o stdout
64+ ``` shell
65+ $ fluent-bit -i nginx_metrics -p host=127.0.0.1 -p port=80 -p status_url=/status -p nginx_plus=off -o stdout
6666```
6767
6868To gather metrics from the command line with the NGINX Plus REST API you need to turn on the
6969` nginx_plus ` property:
7070
71- ``` bash
72- fluent-bit -i nginx_metrics -p host=127.0.0.1 -p port=80 -p nginx_plus=on -p status_url=/api -o stdout
71+ ``` shell
72+ $ fluent-bit -i nginx_metrics -p host=127.0.0.1 -p port=80 -p nginx_plus=on -p status_url=/api -o stdout
7373```
7474
7575### Configuration File
7676
77- In your main configuration file append the following ` Input ` and ` Output ` sections:
77+ In your main configuration file append the following:
78+
79+ {% tabs %}
80+ {% tab title="fluent-bit.yaml" %}
81+
82+ ``` yaml
83+ pipeline :
84+ inputs :
85+ - name : nginx_metrics
86+ nginx_plus : off
87+ host : 127.0.0.1
88+ port : 80
89+ status_URL : /status
90+
91+
92+ outputs :
93+ - name : stdout
94+ match : ' *'
95+ ` ` `
96+
97+ {% endtab %}
98+ {% tab title="fluent-bit.conf" %}
7899
79- ``` python
100+ ` ` ` text
80101[INPUT]
81102 Name nginx_metrics
82103 Nginx_Plus off
83104 Host 127.0.0.1
84105 Port 80
85106 Status_URL /status
86- Nginx_Plus off
87107
88108[OUTPUT]
89109 Name stdout
90110 Match *
91111```
92112
113+ {% endtab %}
114+ {% endtabs %}
115+
93116And for NGINX Plus API:
94117
95- ``` python
118+ {% tabs %}
119+ {% tab title="fluent-bit.yaml" %}
120+
121+ ``` yaml
122+ pipeline :
123+ inputs :
124+ - name : nginx_metrics
125+ nginx_plus : on
126+ host : 127.0.0.1
127+ port : 80
128+ status_URL : /api
129+
130+
131+ outputs :
132+ - name : stdout
133+ match : ' *'
134+ ` ` `
135+
136+ {% endtab %}
137+ {% tab title="fluent-bit.conf" %}
138+
139+ ` ` ` text
140+ [INPUT]
96141 Name nginx_metrics
97142 Nginx_Plus on
98143 Host 127.0.0.1
@@ -104,23 +149,43 @@ And for NGINX Plus API:
104149 Match *
105150```
106151
152+ {% endtab %}
153+ {% endtabs %}
154+
107155## Test your configuration
108156
109157You can test against the NGINX server running on localhost by invoking it directly from the command line:
110158
111- ``` bash
112- fluent-bit -i nginx_metrics -p host=127.0.0.1 -p nginx_plus=off -o stdout -p match=* -f 1
159+ ``` shell
160+ $ fluent-bit -i nginx_metrics -p host=127.0.0.1 -p nginx_plus=off -o stdout -p match=* -f 1
113161```
114162
115163Which should return something like the following:
116164
117165``` text
118- Fluent Bit v2.x.x
119- * Copyright (C) 2019-2020 The Fluent Bit Authors
120- * Copyright (C) 2015-2018 Treasure Data
166+ Fluent Bit v4.0.3
167+ * Copyright (C) 2015-2025 The Fluent Bit Authors
121168* Fluent Bit is a CNCF sub-project under the umbrella of Fluentd
122169* https://fluentbit.io
123170
171+ ______ _ _ ______ _ _ ___ _____
172+ | ___| | | | | ___ (_) | / || _ |
173+ | |_ | |_ _ ___ _ __ | |_ | |_/ /_| |_ __ __/ /| || |/' |
174+ | _| | | | | |/ _ \ '_ \| __| | ___ \ | __| \ \ / / /_| || /| |
175+ | | | | |_| | __/ | | | |_ | |_/ / | |_ \ V /\___ |\ |_/ /
176+ \_| |_|\__,_|\___|_| |_|\__| \____/|_|\__| \_/ |_(_)___/
177+
178+
179+ [2025/07/01 14:44:47] [ info] [fluent bit] version=4.0.3, commit=f5f5f3c17d, pid=1
180+ [2025/07/01 14:44:47] [ info] [storage] ver=1.5.3, type=memory, sync=normal, checksum=off, max_chunks_up=128
181+ [2025/07/01 14:44:47] [ info] [simd ] disabled
182+ [2025/07/01 14:44:47] [ info] [cmetrics] version=1.0.3
183+ [2025/07/01 14:44:47] [ info] [ctraces ] version=0.6.6
184+ [2025/07/01 14:44:47] [ info] [input:mem:mem.0] initializing
185+ [2025/07/01 14:44:47] [ info] [input:mem:mem.0] storage_strategy='memory' (memory only)
186+ [2025/07/01 14:44:47] [ info] [sp] stream processor started
187+ [2025/07/01 14:44:47] [ info] [engine] Shutdown Grace Period=5, Shutdown Input Grace Period=2
188+ [2025/07/01 14:44:47] [ info] [output:stdout:stdout.0] worker #0 started
1241892021-10-14T19:37:37.228691854Z nginx_connections_accepted = 788253884
1251902021-10-14T19:37:37.228691854Z nginx_connections_handled = 788253884
1261912021-10-14T19:37:37.228691854Z nginx_http_requests_total = 42045501
@@ -133,4 +198,4 @@ Fluent Bit v2.x.x
133198
134199## Exported metrics
135200
136- For a list of available metrics, see the [ NGINX Prometheus Exporter metrics documentation] ( https://github.com/nginxinc/nginx-prometheus-exporter/blob/main/README.md ) on GitHub.
201+ For a list of available metrics, see the [ NGINX Prometheus Exporter metrics documentation] ( https://github.com/nginxinc/nginx-prometheus-exporter/blob/main/README.md ) on GitHub.
0 commit comments