@@ -37,27 +37,12 @@ The tag for the HTTP input plugin is set by adding the tag to the end of the req
3737For example, in the following curl message the tag set is ` app.log**. ** ` because the end path is ` /app_log ` :
3838
3939``` shell
40- curl -d ' {"key1":"value1","key2":"value2"}' -XPOST -H " content-type: application/json" http://localhost:8888/app.log
40+ $ curl -d ' {"key1":"value1","key2":"value2"}' -XPOST -H " content-type: application/json" http://localhost:8888/app.log
4141```
4242
4343### Configuration file
4444
4545{% tabs %}
46- {% tab title="fluent-bit.conf" %}
47-
48- ``` python
49- [INPUT ]
50- name http
51- listen 0.0 .0.0
52- port 8888
53-
54- [OUTPUT ]
55- name stdout
56- match app.log
57- ```
58-
59- {% endtab %}
60-
6146{% tab title="fluent-bit.yaml" %}
6247
6348``` yaml
@@ -66,38 +51,38 @@ pipeline:
6651 - name : http
6752 listen : 0.0.0.0
6853 port : 8888
54+
6955 outputs :
7056 - name : stdout
7157 match : app.log
7258` ` `
7359
7460{% endtab %}
75- {% endtabs %}
76-
77- ### Configuration file ` http.0` example
78-
79- If you don't set the tag, `http.0` is automatically used. If you have multiple HTTP inputs then they will follow a pattern of `http.N` where `N` is an integer representing the input.
80-
81- ` ` ` shell
82- curl -d '{"key1":"value1","key2":"value2"}' -XPOST -H "content-type: application/json" http://localhost:8888
83- ` ` `
84-
85- {% tabs %}
8661{% tab title="fluent-bit.conf" %}
8762
88- ` ` ` python
63+ ` ` ` text
8964[INPUT]
9065 name http
9166 listen 0.0.0.0
9267 port 8888
9368
9469[OUTPUT]
95- name stdout
96- match http.0
70+ name stdout
71+ match app.log
9772```
9873
9974{% endtab %}
75+ {% endtabs %}
76+
77+ ### Configuration file ` http.0 ` example
10078
79+ If you don't set the tag, ` http.0 ` is automatically used. If you have multiple HTTP inputs then they will follow a pattern of ` http.N ` where ` N ` is an integer representing the input.
80+
81+ ``` shell
82+ $ curl -d ' {"key1":"value1","key2":"value2"}' -XPOST -H " content-type: application/json" http://localhost:8888
83+ ```
84+
85+ {% tabs %}
10186{% tab title="fluent-bit.yaml" %}
10287
10388``` yaml
@@ -106,11 +91,26 @@ pipeline:
10691 - name : http
10792 listen : 0.0.0.0
10893 port : 8888
94+
10995 outputs :
11096 - name : stdout
11197 match : http.0
11298` ` `
11399
100+ {% endtab %}
101+ {% tab title="fluent-bit.conf" %}
102+
103+ ` ` ` text
104+ [INPUT]
105+ name http
106+ listen 0.0.0.0
107+ port 8888
108+
109+ [OUTPUT]
110+ name stdout
111+ match http.0
112+ ```
113+
114114{% endtab %}
115115{% endtabs %}
116116
@@ -121,15 +121,31 @@ The `tag_key` configuration option lets you specify the key name that will be us
121121### Curl request
122122
123123``` shell
124- curl -d '{"key1":"value1","key2":"value2"}' -XPOST -H "content-type: application/json" http://localhost:8888/app.log
124+ $ curl -d ' {"key1":"value1","key2":"value2"}' -XPOST -H " content-type: application/json" http://localhost:8888/app.log
125125```
126126
127127### Configuration file ` tag_key ` example
128128
129129{% tabs %}
130+ {% tab title="fluent-bit.yaml" %}
131+
132+ ``` yaml
133+ pipeline :
134+ inputs :
135+ - name : http
136+ listen : 0.0.0.0
137+ port : 8888
138+ tag_key : key1
139+
140+ outputs :
141+ - name : stdout
142+ match : value1
143+ ` ` `
144+
145+ {% endtab %}
130146{% tab title="fluent-bit.conf" %}
131147
132- ` ` ` python
148+ ` ` ` text
133149[INPUT]
134150 name http
135151 listen 0.0.0.0
@@ -142,76 +158,46 @@ curl -d '{"key1":"value1","key2":"value2"}' -XPOST -H "content-type: application
142158```
143159
144160{% endtab %}
161+ {% endtabs %}
162+
163+ #### Set multiple custom HTTP headers on success
145164
165+ The ` success_header ` parameter lets you set multiple HTTP headers on success. The format is:
166+
167+ {% tabs %}
146168{% tab title="fluent-bit.yaml" %}
147169
148170``` yaml
149171pipeline :
150172 inputs :
151173 - name : http
152- listen: 0.0.0.0
153- port: 8888
154- tag_key: key1
155- outputs:
156- - name: stdout
157- match: value1
174+ success_header :
175+ - X-Custom custom-answer
176+ - X-Another another-answer
158177` ` `
159178
160179{% endtab %}
161- {% endtabs %}
162-
163- # ### Set multiple custom HTTP headers on success
164-
165- The `success_header` parameter lets you set multiple HTTP headers on success. The format is :
166-
167- {% tabs %}
168180{% tab title="fluent-bit.conf" %}
169181
170- ` ` ` python
182+ ` ` ` text
171183[INPUT]
172184 name http
173185 success_header X-Custom custom-answer
174186 success_header X-Another another-answer
175187```
176188
177- {% endtab %}
178-
179- {% tab title="fluent-bit.yaml" %}
180-
181- ` ` ` yaml
182- inputs:
183- - name: http
184- success_header: X-Custom custom-answer
185- success_header: X-Another another-answer
186- ` ` `
187-
188189{% endtab %}
189190{% endtabs %}
190191
191192#### Example curl message
192193
193194``` shell
194- curl -d @app.log -XPOST -H "content-type: application/json" http://localhost:8888/app.log
195+ $ curl -d @app.log -XPOST -H " content-type: application/json" http://localhost:8888/app.log
195196```
196197
197198### Configuration file example 3
198199
199200{% tabs %}
200- {% tab title="fluent-bit.conf" %}
201-
202- ` ` ` python
203- [INPUT]
204- name http
205- listen 0.0.0.0
206- port 8888
207-
208- [OUTPUT]
209- name stdout
210- match *
211- ` ` `
212-
213- {% endtab %}
214-
215201{% tab title="fluent-bit.yaml" %}
216202
217203``` yaml
@@ -226,11 +212,25 @@ pipeline:
226212 match : ' *'
227213` ` `
228214
215+ {% endtab %}
216+ {% tab title="fluent-bit.conf" %}
217+
218+ ` ` ` text
219+ [INPUT]
220+ name http
221+ listen 0.0.0.0
222+ port 8888
223+
224+ [OUTPUT]
225+ name stdout
226+ match *
227+ ```
228+
229229{% endtab %}
230230{% endtabs %}
231231
232232### Command line
233233
234234``` shell
235- fluent-bit -i http -p port=8888 -o stdout
236- ` ` `
235+ $ fluent-bit -i http -p port=8888 -o stdout
236+ ```
0 commit comments