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
Missing YAML examples for the output plugins starting with an H, K, or L. Fixes#1916. (#1917)
* Adding YAML examples and layout fixes for HTTP output plugin. Part of issue #1916.
Signed-off-by: Eric D. Schabell <[email protected]>
* Adding YAML examples and layout fixes for HTTP output plugin. Part of issue #1916.
Signed-off-by: Eric D. Schabell <[email protected]>
* Adding YAML examples and layout fixes for InfluxDB output plugin. Part of issue #1916.
Signed-off-by: Eric D. Schabell <[email protected]>
* Fixes in grammer for http output plugin doc. Part of issue #1916.
Signed-off-by: Eric D. Schabell <[email protected]>
* Adding YAML examples and layout fixes for Kafka output plugin. Part of issue #1916.
Signed-off-by: Eric D. Schabell <[email protected]>
* Adding YAML examples and layout fixes for Kafka REST Proxy output plugin. Part of issue #1916.
Signed-off-by: Eric D. Schabell <[email protected]>
* Adding YAML examples and layout fixes for LoogDNA output plugin. Part of issue #1916.
Signed-off-by: Eric D. Schabell <[email protected]>
* Adding YAML examples and layout fixes for Loki output plugin. Part of issue #1916.
Signed-off-by: Eric D. Schabell <[email protected]>
---------
Signed-off-by: Eric D. Schabell <[email protected]>
The **http** output plugin allows to flush your records into a HTTP endpoint. For now the functionality is pretty basic and it issues a POST request with the data records in [MessagePack](http://msgpack.org) (or JSON) format.
3
+
The **http** output plugin allows to flush your records into an HTTP endpoint. For now the functionality is pretty basic, and it issues a POST request with the data records in [MessagePack](http://msgpack.org) (or JSON) format.
4
4
5
5
## Configuration Parameters
6
6
@@ -21,7 +21,7 @@ The **http** output plugin allows to flush your records into a HTTP endpoint. Fo
21
21
| compress | Set payload compression mechanism. Option available is 'gzip' ||
22
22
| format | Specify the data format to be used in the HTTP request body, by default it uses _msgpack_. Other supported formats are _json_, _json\_stream_ and _json\_lines_ and _gelf_. | msgpack |
23
23
| allow\_duplicated\_headers | Specify if duplicated headers are allowed. If a duplicated header is found, the latest key/value set is preserved. | true |
24
-
| log\_response\_payload | Specify if the response paylod should be logged or not. | true |
24
+
| log\_response\_payload | Specify if the response payload should be logged or not. | true |
25
25
| header\_tag | Specify an optional HTTP header field for the original message tag. ||
26
26
| header | Add a HTTP header key/value pair. Multiple headers can be set. ||
27
27
| json\_date\_key | Specify the name of the time key in the output record. To disable the time key just set the value to `false`. | date |
@@ -42,55 +42,58 @@ For more details about the properties available and general configuration, see [
42
42
43
43
## Getting Started
44
44
45
-
In order to insert records into a HTTP server, you can run the plugin from the command line or through the configuration file:
45
+
In order to insert records into an HTTP server, you can run the plugin from the command line or through the configuration file:
46
46
47
47
### Command Line
48
48
49
49
The **http** plugin, can read the parameters from the command line in two ways, through the **-p** argument (property) or setting them directly through the service URI. The URI format is the following:
50
50
51
-
```
51
+
```text
52
52
http://host:port/something
53
53
```
54
54
55
55
Using the format specified, you could start Fluent Bit through:
56
56
57
-
```
57
+
```shell
58
58
fluent-bit -i cpu -t cpu -o http://192.168.2.3:80/something -m '*'
59
59
```
60
60
61
61
### Configuration File
62
62
63
-
In your main configuration file, append the following_Input_ & _Output_ sections:
63
+
In your main configuration file append the following:
64
64
65
65
{% tabs %}
66
+
{% tab title="fluent-bit.yaml" %}
67
+
68
+
```yaml
69
+
pipeline:
70
+
inputs:
71
+
- name: cpu
72
+
tag: cpu
73
+
outputs:
74
+
- name: http
75
+
match: '*'
76
+
host: 192.168.2.3
77
+
port: 80
78
+
uri: /something
79
+
```
80
+
81
+
{% endtab %}
66
82
{% tab title="fluent-bit.conf" %}
67
-
```python
83
+
84
+
```text
68
85
[INPUT]
69
-
Name cpu
70
-
Tag cpu
86
+
Name cpu
87
+
Tag cpu
71
88
72
89
[OUTPUT]
73
-
Name http
74
-
Match *
75
-
Host 192.168.2.3
76
-
Port 80
77
-
URI/something
90
+
Name http
91
+
Match *
92
+
Host 192.168.2.3
93
+
Port 80
94
+
URI /something
78
95
```
79
-
{% endtab %}
80
96
81
-
{% tab title="fluent-bit.yaml" %}
82
-
```yaml
83
-
pipeline:
84
-
inputs:
85
-
- name: cpu
86
-
tag: cpu
87
-
outputs:
88
-
- name: http
89
-
match: '*'
90
-
host: 192.168.2.3
91
-
port: 80
92
-
URI: /something
93
-
```
94
97
{% endtab %}
95
98
{% endtabs %}
96
99
@@ -101,37 +104,42 @@ Another approach we also support is the sending the original message tag in a co
101
104
To configure this behaviour, add this config:
102
105
103
106
{% tabs %}
104
-
{% tab title="fluent-bit.conf" %}
105
-
```
106
-
[OUTPUT]
107
-
Name http
108
-
Match *
109
-
Host 192.168.2.3
110
-
Port 80
111
-
URI /something
112
-
Format json
113
-
header_tag FLUENT-TAG
107
+
{% tab title="fluent-bit.yaml" %}
108
+
109
+
```yaml
110
+
pipeline:
111
+
112
+
outputs:
113
+
- name: http
114
+
match: '*'
115
+
host: 192.168.2.3
116
+
port: 80
117
+
uri: /something
118
+
format: json
119
+
header_tag: FLUENT-TAG
114
120
```
121
+
115
122
{% endtab %}
123
+
{% tab title="fluent-bit.conf" %}
116
124
117
-
{% tab title="fluent-bit.yaml" %}
118
-
```yaml
119
-
outputs:
120
-
- name: http
121
-
match: '*'
122
-
host: 192.168.2.3
123
-
port: 80
124
-
URI: /something
125
-
format: json
126
-
header_tag: FLUENT-TAG
125
+
```text
126
+
[OUTPUT]
127
+
Name http
128
+
Match *
129
+
Host 192.168.2.3
130
+
Port 80
131
+
URI /something
132
+
Format json
133
+
header_tag FLUENT-TAG
127
134
```
135
+
128
136
{% endtab %}
129
137
{% endtabs %}
130
138
131
139
132
140
Provided you are using Fluentd as data receiver, you can combine `in_http` and `out_rewrite_tag_filter` to make use of this HTTP header.
133
141
134
-
```
142
+
```text
135
143
<source>
136
144
@type http
137
145
add_http_headers true
@@ -152,31 +160,36 @@ Notice how we override the tag, which is from URI path, with our custom header
152
160
#### Example : Add a header
153
161
154
162
{% tabs %}
155
-
{% tab title="fluent-bit.conf" %}
156
-
```
157
-
[OUTPUT]
158
-
Name http
159
-
Match *
160
-
Host 127.0.0.1
161
-
Port 9000
162
-
Header X-Key-A Value_A
163
-
Header X-Key-B Value_B
164
-
URI /something
163
+
{% tab title="fluent-bit.yaml" %}
164
+
165
+
```yaml
166
+
pipeline:
167
+
168
+
outputs:
169
+
- name: http
170
+
match: '*'
171
+
host: 127.0.0.1
172
+
port: 9000
173
+
header:
174
+
- X-Key-A Value_A
175
+
- X-Key-B Value_B
176
+
uri: /something
165
177
```
178
+
166
179
{% endtab %}
180
+
{% tab title="fluent-bit.conf" %}
167
181
168
-
{% tab title="fluent-bit.yaml" %}
169
-
```yaml
170
-
outputs:
171
-
- name: http
172
-
match: '*'
173
-
host: 127.0.0.1
174
-
port: 9000
175
-
header:
176
-
- X-Key-A Value_A
177
-
- X-Key-B Value_B
178
-
URI: /something
182
+
```text
183
+
[OUTPUT]
184
+
Name http
185
+
Match *
186
+
Host 127.0.0.1
187
+
Port 9000
188
+
Header X-Key-A Value_A
189
+
Header X-Key-B Value_B
190
+
URI /something
179
191
```
192
+
180
193
{% endtab %}
181
194
{% endtabs %}
182
195
@@ -185,40 +198,45 @@ Notice how we override the tag, which is from URI path, with our custom header
185
198
Suggested configuration for Sumo Logic using `json_lines` with `iso8601` timestamps. The `PrivateKey` is specific to a configured HTTP collector.
186
199
187
200
{% tabs %}
188
-
{% tab title="fluent-bit.conf" %}
189
-
```
190
-
[OUTPUT]
191
-
Name http
192
-
Match *
193
-
Host collectors.au.sumologic.com
194
-
Port 443
195
-
URI /receiver/v1/http/[PrivateKey]
196
-
Format json_lines
197
-
Json_date_key timestamp
198
-
Json_date_format iso8601
201
+
{% tab title="fluent-bit.yaml" %}
202
+
203
+
```yaml
204
+
pipeline:
205
+
206
+
outputs:
207
+
- name: http
208
+
match: '*'
209
+
host: collectors.au.sumologic.com
210
+
port: 443
211
+
uri: /receiver/v1/http/[PrivateKey]
212
+
format: json_lines
213
+
json_date_key: timestamp
214
+
json_date_format: iso8601
199
215
```
216
+
200
217
{% endtab %}
218
+
{% tab title="fluent-bit.conf" %}
201
219
202
-
{% tab title="fluent-bit.yaml" %}
203
-
```yaml
204
-
outputs:
205
-
- name: http
206
-
match: '*'
207
-
host: collectors.au.sumologic.com
208
-
port: 443
209
-
URI: /receiver/v1/http/[PrivateKey]
210
-
format: json_lines
211
-
json_date_key: timestamp
212
-
json_date_format: iso8601
220
+
```text
221
+
[OUTPUT]
222
+
Name http
223
+
Match *
224
+
Host collectors.au.sumologic.com
225
+
Port 443
226
+
URI /receiver/v1/http/[PrivateKey]
227
+
Format json_lines
228
+
Json_date_key timestamp
229
+
Json_date_format iso8601
213
230
```
231
+
214
232
{% endtab %}
215
233
{% endtabs %}
216
234
217
235
A sample Sumo Logic query for the [CPU](../inputs/cpu-metrics.md) input. \(Requires `json_lines` format with `iso8601` date format for the `timestamp` field\).
0 commit comments