Skip to content

Commit e96f4d1

Browse files
committed
pipeline: outputs: elasticsearch: Add documentation for target_index
Signed-off-by: Victor Cabezas <[email protected]>
1 parent 25f9a9c commit e96f4d1

File tree

1 file changed

+20
-2
lines changed

1 file changed

+20
-2
lines changed

pipeline/outputs/elasticsearch.md

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ The **es** output plugin, allows to ingest your records into an [Elasticsearch](
2929
| HTTP\_Passwd | Password for user defined in HTTP\_User | |
3030
| Index | Index name | fluent-bit |
3131
| Type | Type name | \_doc |
32+
| Target_index | When included: destination index will be rendered using this record accessor syntax. If any field in the record accessor expression is not found in the record, the value of `Index` setting is used. |
3233
| Logstash\_Format | Enable Logstash format compatibility. This option takes a boolean value: True/False, On/Off | Off |
3334
| Logstash\_Prefix | When Logstash\_Format is enabled, the Index name is composed using a prefix and the date, e.g: If Logstash\_Prefix is equals to 'mydata' your index will become 'mydata-YYYY.MM.DD'. The last string appended belongs to the date when the data is being generated. | logstash |
3435
| Logstash\_Prefix\_Key | When included: the value of the key in the record will be evaluated as key reference and overrides Logstash\_Prefix for index generation. If the key/value is not found in the record then the Logstash\_Prefix option will act as a fallback. The parameter is expected to be a [record accessor](../../administration/configuring-fluent-bit/classic-mode/record-accessor). | |
@@ -46,7 +47,7 @@ The **es** output plugin, allows to ingest your records into an [Elasticsearch](
4647
| Trace\_Output | Print all elasticsearch API request payloads to stdout \(for diag only\) | Off |
4748
| Trace\_Error | If elasticsearch return an error, print the elasticsearch API request and response \(for diag only\) | Off |
4849
| Current\_Time\_Index | Use current time for index generation instead of message record | Off |
49-
50+
| |
5051
| Suppress\_Type\_Name | When enabled, mapping types is removed and `Type` option is ignored. Types are deprecated in APIs in [v7.0](https://www.elastic.co/guide/en/elasticsearch/reference/current/removal-of-types.html). This options is for v7.0 or later. | Off |
5152
| Workers | Enables dedicated thread(s) for this output. Default value is set since version 1.8.13. For previous versions is 0. | 2 |
5253

@@ -254,4 +255,21 @@ The following snippet demonstrates using the namespace name as extracted by the
254255
# ...
255256
```
256257

257-
For records that do nor have the field `kubernetes.namespace_name`, the default prefix, `logstash` will be used.
258+
For records that do nor have the field `kubernetes.namespace_name`, the default prefix, `logstash` will be used.
259+
260+
### Target_index
261+
262+
The following snippet demonstrates using `destination_index` record value as elasticsearch destination index,
263+
using `fallback` as default index name if `destination_index` value is not present in record.
264+
265+
```text
266+
[OUTPUT]
267+
Name es
268+
Match *
269+
# ...
270+
Index fallback
271+
Target_index fluent-$destination_index
272+
# ...
273+
```
274+
275+
For records that do not have the field `destination__index`, the value of `Index` (`fallback`) will be used.

0 commit comments

Comments
 (0)