@@ -37,27 +37,12 @@ The tag for the HTTP input plugin is set by adding the tag to the end of the req
37
37
For example, in the following curl message the tag set is ` app.log**. ** ` because the end path is ` /app_log ` :
38
38
39
39
``` 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
41
41
```
42
42
43
43
### Configuration file
44
44
45
45
{% 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
-
61
46
{% tab title="fluent-bit.yaml" %}
62
47
63
48
``` yaml
@@ -66,38 +51,38 @@ pipeline:
66
51
- name : http
67
52
listen : 0.0.0.0
68
53
port : 8888
54
+
69
55
outputs :
70
56
- name : stdout
71
57
match : app.log
72
58
` ` `
73
59
74
60
{% 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 %}
86
61
{% tab title="fluent-bit.conf" %}
87
62
88
- ` ` ` python
63
+ ` ` ` text
89
64
[INPUT]
90
65
name http
91
66
listen 0.0.0.0
92
67
port 8888
93
68
94
69
[OUTPUT]
95
- name stdout
96
- match http.0
70
+ name stdout
71
+ match app.log
97
72
```
98
73
99
74
{% endtab %}
75
+ {% endtabs %}
76
+
77
+ ### Configuration file ` http.0 ` example
100
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 %}
101
86
{% tab title="fluent-bit.yaml" %}
102
87
103
88
``` yaml
@@ -106,11 +91,26 @@ pipeline:
106
91
- name : http
107
92
listen : 0.0.0.0
108
93
port : 8888
94
+
109
95
outputs :
110
96
- name : stdout
111
97
match : http.0
112
98
` ` `
113
99
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
+
114
114
{% endtab %}
115
115
{% endtabs %}
116
116
@@ -121,15 +121,31 @@ The `tag_key` configuration option lets you specify the key name that will be us
121
121
### Curl request
122
122
123
123
``` 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
125
125
```
126
126
127
127
### Configuration file ` tag_key ` example
128
128
129
129
{% 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 %}
130
146
{% tab title="fluent-bit.conf" %}
131
147
132
- ` ` ` python
148
+ ` ` ` text
133
149
[INPUT]
134
150
name http
135
151
listen 0.0.0.0
@@ -142,76 +158,46 @@ curl -d '{"key1":"value1","key2":"value2"}' -XPOST -H "content-type: application
142
158
```
143
159
144
160
{% endtab %}
161
+ {% endtabs %}
162
+
163
+ #### Set multiple custom HTTP headers on success
145
164
165
+ The ` success_header ` parameter lets you set multiple HTTP headers on success. The format is:
166
+
167
+ {% tabs %}
146
168
{% tab title="fluent-bit.yaml" %}
147
169
148
170
``` yaml
149
171
pipeline :
150
172
inputs :
151
173
- 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
158
177
` ` `
159
178
160
179
{% 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 %}
168
180
{% tab title="fluent-bit.conf" %}
169
181
170
- ` ` ` python
182
+ ` ` ` text
171
183
[INPUT]
172
184
name http
173
185
success_header X-Custom custom-answer
174
186
success_header X-Another another-answer
175
187
```
176
188
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
-
188
189
{% endtab %}
189
190
{% endtabs %}
190
191
191
192
#### Example curl message
192
193
193
194
``` 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
195
196
```
196
197
197
198
### Configuration file example 3
198
199
199
200
{% 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
-
215
201
{% tab title="fluent-bit.yaml" %}
216
202
217
203
``` yaml
@@ -226,11 +212,25 @@ pipeline:
226
212
match : ' *'
227
213
` ` `
228
214
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
+
229
229
{% endtab %}
230
230
{% endtabs %}
231
231
232
232
### Command line
233
233
234
234
``` 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