Skip to content

Commit 02dbd5d

Browse files
committed
pipeline: outputs: es: YAML format Upstream servers configuration
Signed-off-by: Marat Abrarov <abrarov@gmail.com>
1 parent a9c747f commit 02dbd5d

File tree

1 file changed

+53
-3
lines changed

1 file changed

+53
-3
lines changed

pipeline/outputs/elasticsearch.md

Lines changed: 53 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -165,12 +165,14 @@ pipeline:
165165

166166
### Configuration File with Upstream
167167

168-
In your main configuration file append the following `Input` and `Output` sections:
168+
#### Classic mode Configuration File with Upstream
169+
170+
In your main classic mode configuration file append the following `Input` and `Output` sections:
169171

170172
```text
171173
[INPUT]
172-
Name cpu
173-
Tag cpu
174+
Name dummy
175+
Dummy { "message" : "this is dummy data" }
174176
175177
[OUTPUT]
176178
Name es
@@ -203,6 +205,54 @@ configuration file can be similar to the following:
203205
port 9203
204206
```
205207

208+
#### YAML Configuration File with Upstream
209+
210+
In your main YAML configuration file (fluent-bit.yaml) put the following `Input` and `Output` sections:
211+
212+
```yaml
213+
pipeline:
214+
inputs:
215+
- name: dummy
216+
dummy: "{ \"message\" : \"this is dummy data\" }"
217+
outputs:
218+
- name: es
219+
match: *
220+
index: fluent-bit
221+
type: my_type
222+
upstream: ./upstream.yaml
223+
```
224+
225+
Your Upstream Servers configuration file can use
226+
[classic mode](../../administration/configuring-fluent-bit/classic-mode/upstream-servers.md)
227+
(refer to "Classic mode Configuration File with Upstream" section at this page) or
228+
[YAML format](../../administration/configuring-fluent-bit/yaml/upstream-servers-section.md).
229+
If Upstream Servers configuration uses YAML format, then it can be placed in the same file as main configuration (e.g. in fluent-bit.yaml), like:
230+
231+
```yaml
232+
pipeline:
233+
inputs:
234+
- name: dummy
235+
dummy: "{ \"message\" : \"this is dummy data\" }"
236+
outputs:
237+
- name: es
238+
match: *
239+
index: fluent-bit
240+
type: my_type
241+
upstream: ./fluent-bit.yaml
242+
upstream_servers:
243+
- name: es-balancing
244+
nodes:
245+
- name: node-1
246+
host: localhost
247+
port: 9201
248+
- name: node-2
249+
host: localhost
250+
port: 9202
251+
- name: node-3
252+
host: localhost
253+
port: 9203
254+
```
255+
206256
## Elasticsearch field names
207257
208258
Some input plugins can generate messages where the field names contains dots (`.`). For Elasticsearch 2.0, this isn't allowed. The current `es` plugin replaces a dot with an underscore (`_`):

0 commit comments

Comments
 (0)