Skip to content

Commit da614db

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

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
@@ -159,12 +159,14 @@ pipeline:
159159

160160
### Configuration File with Upstream
161161

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

164166
```text
165167
[INPUT]
166-
Name cpu
167-
Tag cpu
168+
Name dummy
169+
Dummy { "message" : "this is dummy data" }
168170
169171
[OUTPUT]
170172
Name es
@@ -197,6 +199,54 @@ configuration file can be similar to the following:
197199
port 9203
198200
```
199201

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