@@ -61,38 +61,83 @@ server {
61
61
62
62
From the command line you can let Fluent Bit generate the checks with the following options:
63
63
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
66
66
```
67
67
68
68
To gather metrics from the command line with the NGINX Plus REST API you need to turn on the
69
69
` nginx_plus ` property:
70
70
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
73
73
```
74
74
75
75
### Configuration File
76
76
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" %}
78
99
79
- ``` python
100
+ ` ` ` text
80
101
[INPUT]
81
102
Name nginx_metrics
82
103
Nginx_Plus off
83
104
Host 127.0.0.1
84
105
Port 80
85
106
Status_URL /status
86
- Nginx_Plus off
87
107
88
108
[OUTPUT]
89
109
Name stdout
90
110
Match *
91
111
```
92
112
113
+ {% endtab %}
114
+ {% endtabs %}
115
+
93
116
And for NGINX Plus API:
94
117
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]
96
141
Name nginx_metrics
97
142
Nginx_Plus on
98
143
Host 127.0.0.1
@@ -104,23 +149,43 @@ And for NGINX Plus API:
104
149
Match *
105
150
```
106
151
152
+ {% endtab %}
153
+ {% endtabs %}
154
+
107
155
## Test your configuration
108
156
109
157
You can test against the NGINX server running on localhost by invoking it directly from the command line:
110
158
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
113
161
```
114
162
115
163
Which should return something like the following:
116
164
117
165
``` 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
121
168
* Fluent Bit is a CNCF sub-project under the umbrella of Fluentd
122
169
* https://fluentbit.io
123
170
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
124
189
2021-10-14T19:37:37.228691854Z nginx_connections_accepted = 788253884
125
190
2021-10-14T19:37:37.228691854Z nginx_connections_handled = 788253884
126
191
2021-10-14T19:37:37.228691854Z nginx_http_requests_total = 42045501
@@ -133,4 +198,4 @@ Fluent Bit v2.x.x
133
198
134
199
## Exported metrics
135
200
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