Skip to content

Commit ac23946

Browse files
authored
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]>
1 parent a0023a6 commit ac23946

File tree

6 files changed

+621
-425
lines changed

6 files changed

+621
-425
lines changed

pipeline/outputs/http.md

Lines changed: 112 additions & 94 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# HTTP
22

3-
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.
44

55
## Configuration Parameters
66

@@ -21,7 +21,7 @@ The **http** output plugin allows to flush your records into a HTTP endpoint. Fo
2121
| compress | Set payload compression mechanism. Option available is 'gzip' | |
2222
| 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 |
2323
| 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 |
2525
| header\_tag | Specify an optional HTTP header field for the original message tag. | |
2626
| header | Add a HTTP header key/value pair. Multiple headers can be set. | |
2727
| 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 [
4242

4343
## Getting Started
4444

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:
4646

4747
### Command Line
4848

4949
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:
5050

51-
```
51+
```text
5252
http://host:port/something
5353
```
5454

5555
Using the format specified, you could start Fluent Bit through:
5656

57-
```
57+
```shell
5858
fluent-bit -i cpu -t cpu -o http://192.168.2.3:80/something -m '*'
5959
```
6060

6161
### Configuration File
6262

63-
In your main configuration file, append the following _Input_ & _Output_ sections:
63+
In your main configuration file append the following:
6464

6565
{% 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 %}
6682
{% tab title="fluent-bit.conf" %}
67-
```python
83+
84+
```text
6885
[INPUT]
69-
Name cpu
70-
Tag cpu
86+
Name cpu
87+
Tag cpu
7188

7289
[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
7895
```
79-
{% endtab %}
8096

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-
```
9497
{% endtab %}
9598
{% endtabs %}
9699

@@ -101,37 +104,42 @@ Another approach we also support is the sending the original message tag in a co
101104
To configure this behaviour, add this config:
102105

103106
{% 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
114120
```
121+
115122
{% endtab %}
123+
{% tab title="fluent-bit.conf" %}
116124
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
127134
```
135+
128136
{% endtab %}
129137
{% endtabs %}
130138

131139

132140
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.
133141

134-
```
142+
```text
135143
<source>
136144
@type http
137145
add_http_headers true
@@ -152,31 +160,36 @@ Notice how we override the tag, which is from URI path, with our custom header
152160
#### Example : Add a header
153161

154162
{% 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
165177
```
178+
166179
{% endtab %}
180+
{% tab title="fluent-bit.conf" %}
167181
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
179191
```
192+
180193
{% endtab %}
181194
{% endtabs %}
182195

@@ -185,40 +198,45 @@ Notice how we override the tag, which is from URI path, with our custom header
185198
Suggested configuration for Sumo Logic using `json_lines` with `iso8601` timestamps. The `PrivateKey` is specific to a configured HTTP collector.
186199

187200
{% 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
199215
```
216+
200217
{% endtab %}
218+
{% tab title="fluent-bit.conf" %}
201219
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
213230
```
231+
214232
{% endtab %}
215233
{% endtabs %}
216234

217235
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\).
218236

219-
```
237+
```text
220238
_sourcecategory="my_fluent_bit"
221239
| json "cpu_p" as cpu
222240
| timeslice 1m
223241
| max(cpu) as cpu group by _timeslice
224-
```
242+
```

0 commit comments

Comments
 (0)