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
Copy file name to clipboardExpand all lines: pipeline/outputs/http.md
+73Lines changed: 73 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -61,6 +61,8 @@ $ fluent-bit -i cpu -t cpu -o http://192.168.2.3:80/something -m '*'
61
61
62
62
In your main configuration file, append the following _Input_ & _Output_ sections:
63
63
64
+
{% tabs %}
65
+
{% tab title="fluent-bit.conf" %}
64
66
```python
65
67
[INPUT]
66
68
Name cpu
@@ -73,13 +75,32 @@ In your main configuration file, append the following _Input_ & _Output_ section
73
75
Port 80
74
76
URI/something
75
77
```
78
+
{% endtab %}
79
+
80
+
{% tab title="fluent-bit.yaml" %}
81
+
```yaml
82
+
pipeline:
83
+
inputs:
84
+
- name: cpu
85
+
tag: cpu
86
+
outputs:
87
+
- name: http
88
+
match: '*'
89
+
host: 192.168.2.3
90
+
port: 80
91
+
URI: /something
92
+
```
93
+
{% endtab %}
94
+
{% endtabs %}
76
95
77
96
By default, the URI becomes tag of the message, the original tag is ignored. To retain the tag, multiple configuration sections have to be made based and flush to different URIs.
78
97
79
98
Another approach we also support is the sending the original message tag in a configurable header. It's up to the receiver to do what it wants with that header field: parse it and use it as the tag for example.
80
99
81
100
To configure this behaviour, add this config:
82
101
102
+
{% tabs %}
103
+
{% tab title="fluent-bit.conf" %}
83
104
```
84
105
[OUTPUT]
85
106
Name http
@@ -90,6 +111,22 @@ To configure this behaviour, add this config:
90
111
Format json
91
112
header_tag FLUENT-TAG
92
113
```
114
+
{% endtab %}
115
+
116
+
{% tab title="fluent-bit.yaml" %}
117
+
```yaml
118
+
outputs:
119
+
- name: http
120
+
match: '*'
121
+
host: 192.168.2.3
122
+
port: 80
123
+
URI: /something
124
+
format: json
125
+
header_tag: FLUENT-TAG
126
+
```
127
+
{% endtab %}
128
+
{% endtabs %}
129
+
93
130
94
131
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.
95
132
@@ -113,6 +150,8 @@ Notice how we override the tag, which is from URI path, with our custom header
113
150
114
151
#### Example : Add a header
115
152
153
+
{% tabs %}
154
+
{% tab title="fluent-bit.conf" %}
116
155
```
117
156
[OUTPUT]
118
157
Name http
@@ -123,11 +162,29 @@ Notice how we override the tag, which is from URI path, with our custom header
123
162
Header X-Key-B Value_B
124
163
URI /something
125
164
```
165
+
{% endtab %}
166
+
167
+
{% tab title="fluent-bit.yaml" %}
168
+
```yaml
169
+
outputs:
170
+
- name: http
171
+
match: '*'
172
+
host: 127.0.0.1
173
+
port: 9000
174
+
header:
175
+
- X-Key-A Value_A
176
+
- X-Key-B Value_B
177
+
URI: /something
178
+
```
179
+
{% endtab %}
180
+
{% endtabs %}
126
181
127
182
#### Example : Sumo Logic HTTP Collector
128
183
129
184
Suggested configuration for Sumo Logic using `json_lines` with `iso8601` timestamps. The `PrivateKey` is specific to a configured HTTP collector.
130
185
186
+
{% tabs %}
187
+
{% tab title="fluent-bit.conf" %}
131
188
```
132
189
[OUTPUT]
133
190
Name http
@@ -139,6 +196,22 @@ Suggested configuration for Sumo Logic using `json_lines` with `iso8601` timesta
139
196
Json_date_key timestamp
140
197
Json_date_format iso8601
141
198
```
199
+
{% endtab %}
200
+
201
+
{% tab title="fluent-bit.yaml" %}
202
+
```yaml
203
+
outputs:
204
+
- name: http
205
+
match: '*'
206
+
host: collectors.au.sumologic.com
207
+
port: 443
208
+
URI: /receiver/v1/http/[PrivateKey]
209
+
format: json_lines
210
+
json_date_key: timestamp
211
+
json_date_format: iso8601
212
+
```
213
+
{% endtab %}
214
+
{% endtabs %}
142
215
143
216
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