Skip to content

Commit 089bdf1

Browse files
committed
small fixes for elasticsearch parameters
1 parent 356398a commit 089bdf1

File tree

3 files changed

+52
-25
lines changed

3 files changed

+52
-25
lines changed

docs/plugins/elasticsearch.md

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,24 @@
1-
# Plugin azure
1+
# Plugin elasticsearch
22
## Variables
33
| Variable name | Default | Applied function |
44
|---|---|---|
55
| pattern | - | |
66
| logLevel | info | |
77
| host | - | |
88
| port | - | |
9-
| schema | - | |
9+
| scheme | scheme | |
1010
| logstashFormat | true | |
1111
| logstashPrefix | logstash | |
1212
| bufferPath | /buffers/elasticsearch | |
13-
| chunkLimit | 2M | |
14-
| queueLimit | 8 | |
1513
| timekey | 1h | |
1614
| timekey_wait | 10m | |
1715
| timekey_use_utc | true | |
16+
| flush_thread_count | 2 | |
17+
| flush_interval | 5s | |
18+
| retry_forever | true | |
19+
| retry_max_interval | 30 | |
20+
| chunkLimit | 2M | |
21+
| queueLimit | 8 | |
1822
## Plugin template
1923
```
2024
<match {{ .pattern }}.**>
@@ -24,10 +28,16 @@
2428
type_name fluentd
2529
host {{ .host }}
2630
port {{ .port }}
27-
scheme {{ .schema }}
28-
logstash_format true
31+
scheme {{ .scheme }}
32+
logstash_format {{ .logstashFormat }}
2933
logstash_prefix {{ .logstashPrefix }}
3034
reconnect_on_error true
35+
{{- if .user }}
36+
user {{ .user }}
37+
{{- end}}
38+
{{- if .password }}
39+
password {{ .password }}
40+
{{- end}}
3141
<buffer tag, time>
3242
@type file
3343
path {{ .bufferPath }}
@@ -36,13 +46,13 @@
3646
timekey_use_utc {{ .timekey_use_utc }}
3747
flush_mode interval
3848
retry_type exponential_backoff
39-
flush_thread_count 2
40-
flush_interval 5s
41-
retry_forever
42-
retry_max_interval 30
49+
flush_thread_count {{ .flush_thread_count }}
50+
flush_interval {{ .flush_interval }}
51+
retry_forever {{ .retry_forever }}
52+
retry_max_interval {{ .retry_max_interval }}
4353
chunk_limit_size {{ .chunkLimit }}
4454
queue_limit_length {{ .queueLimit }}
4555
overflow_action block
4656
</buffer>
47-
</match>`
57+
</match>
4858
```

docs/plugins/s3.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@
2222
aws_sec_key {{ .aws_sec_key }}
2323
s3_bucket {{ .s3_bucket }}
2424
s3_region {{ .s3_region }}
25+
{{- if .s3_endpoint }}
26+
s3_endpoint {{ .s3_endpoint }}
27+
force_path_style true # This prevents AWS SDK from breaking endpoint URL
28+
{{- end }}
2529
store_as gzip_command
2630
2731
path logs/${tag}/%Y/%m/%d/

pkg/resources/plugins/elasticsearch.go

Lines changed: 27 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,22 @@ const ElasticsearchOutput = "elasticsearch"
55

66
// ElasticsearchDefaultValues for Elasticsearch output plugin
77
var ElasticsearchDefaultValues = map[string]string{
8-
"bufferPath": "/buffers/elasticsearch",
9-
"logLevel": "info",
10-
"logstashFormat": "true",
11-
"logstashPrefix": "logstash",
12-
"chunkLimit": "2M",
13-
"queueLimit": "8",
14-
"timekey": "1h",
15-
"timekey_wait": "10m",
16-
"timekey_use_utc": "true",
8+
"bufferPath": "/buffers/elasticsearch",
9+
"logLevel": "info",
10+
"logstashFormat": "true",
11+
"logstashPrefix": "logstash",
12+
"scheme": "scheme",
13+
"chunkLimit": "2M",
14+
"queueLimit": "8",
15+
"timekey": "1h",
16+
"timekey_wait": "10m",
17+
"timekey_use_utc": "true",
18+
"retry_max_interval": "30",
19+
"flush_interval": "5s",
20+
"flush_thread_count": "2",
21+
"retry_forever": "true",
22+
"user": "",
23+
"password": "",
1724
}
1825

1926
// ElasticsearchTemplate for Elasticsearch output plugin
@@ -25,10 +32,16 @@ const ElasticsearchTemplate = `
2532
type_name fluentd
2633
host {{ .host }}
2734
port {{ .port }}
28-
scheme {{ .schema }}
35+
scheme {{ .scheme }}
2936
logstash_format {{ .logstashFormat }}
3037
logstash_prefix {{ .logstashPrefix }}
3138
reconnect_on_error true
39+
{{- if .user }}
40+
user {{ .user }}
41+
{{- end}}
42+
{{- if .password }}
43+
password {{ .password }}
44+
{{- end}}
3245
<buffer tag, time>
3346
@type file
3447
path {{ .bufferPath }}
@@ -37,10 +50,10 @@ const ElasticsearchTemplate = `
3750
timekey_use_utc {{ .timekey_use_utc }}
3851
flush_mode interval
3952
retry_type exponential_backoff
40-
flush_thread_count 2
41-
flush_interval 5s
42-
retry_forever
43-
retry_max_interval 30
53+
flush_thread_count {{ .flush_thread_count }}
54+
flush_interval {{ .flush_interval }}
55+
retry_forever {{ .retry_forever }}
56+
retry_max_interval {{ .retry_max_interval }}
4457
chunk_limit_size {{ .chunkLimit }}
4558
queue_limit_length {{ .queueLimit }}
4659
overflow_action block

0 commit comments

Comments
 (0)