Skip to content

Commit 9d9fc20

Browse files
committed
pipeline: outputs: es: YAML format Upstream servers configuration
Signed-off-by: Marat Abrarov <[email protected]>
1 parent 1e84867 commit 9d9fc20

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
@@ -160,12 +160,14 @@ pipeline:
160160

161161
### Configuration File with Upstream
162162

163-
In your main configuration file append the following `Input` and `Output` sections:
163+
#### Classic mode Configuration File with Upstream
164+
165+
In your main classic mode configuration file append the following `Input` and `Output` sections:
164166

165167
```text
166168
[INPUT]
167-
Name cpu
168-
Tag cpu
169+
Name dummy
170+
Dummy { "message" : "this is dummy data" }
169171
170172
[OUTPUT]
171173
Name es
@@ -198,6 +200,54 @@ configuration file can be similar to the following:
198200
port 9203
199201
```
200202

203+
#### YAML Configuration File with Upstream
204+
205+
In your main YAML configuration file (fluent-bit.yaml) put the following `Input` and `Output` sections:
206+
207+
```yaml
208+
pipeline:
209+
inputs:
210+
- name: dummy
211+
dummy: "{ \"message\" : \"this is dummy data\" }"
212+
outputs:
213+
- name: es
214+
match: *
215+
index: fluent-bit
216+
type: my_type
217+
upstream: ./upstream.yaml
218+
```
219+
220+
Your Upstream Servers configuration file can use
221+
[classic mode](../../administration/configuring-fluent-bit/classic-mode/upstream-servers.md)
222+
(refer to "Classic mode Configuration File with Upstream" section at this page) or
223+
[YAML format](../../administration/configuring-fluent-bit/yaml/upstream-servers-section.md).
224+
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:
225+
226+
```yaml
227+
pipeline:
228+
inputs:
229+
- name: dummy
230+
dummy: "{ \"message\" : \"this is dummy data\" }"
231+
outputs:
232+
- name: es
233+
match: *
234+
index: fluent-bit
235+
type: my_type
236+
upstream: ./fluent-bit.yaml
237+
upstream_servers:
238+
- name: es-balancing
239+
nodes:
240+
- name: node-1
241+
host: localhost
242+
port: 9201
243+
- name: node-2
244+
host: localhost
245+
port: 9202
246+
- name: node-3
247+
host: localhost
248+
port: 9203
249+
```
250+
201251
## Elasticsearch field names
202252
203253
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)