(check apply)
- [x] read [the contribution guideline](https://github.com/uken/f…luent-plugin-elasticsearch/blob/master/CONTRIBUTING.md)
#### Problem
Indexes are not rolling over and provide the following error e.g:
```
illegal_argument_exception: index name [debug-2020.05.03] does not match pattern '^.*-\d+$'
```
...
#### Steps to replicate
Per documentation I have configured, ILM and made my own policy. For simplicity of testing I set this to roll over on either 1 day or 50kb or 100 documents.
```
PUT _ilm/policy/fluentd-test-policy
{
"policy": {
"phases": {
"hot": {
"min_age": "0ms",
"actions": {
"rollover": {
"max_age": "1d",
"max_size": "50kb",
"max_docs": 100
},
"set_priority": {
"priority": 100
}
}
},
"delete": {
"min_age": "7d",
"actions": {
"delete": {}
}
}
}
}
}
```
I then have applied a simple index template as follows:
```
PUT _template/debug
{
"index_patterns": ["debug*"],
"order": 1,
"settings": {
"number_of_shards": "1",
"number_of_replicas": "0",
"refresh_interval": "60s",
"index.lifecycle.name": "fluentd-test-policy",
"index.lifecycle.rollover_alias": "debug-logs"
},
"aliases" : {
"debug-logs" : { }
}
}
```
My Fluentd.conf file:
```
<match debug.**> <store>
@type elasticsearch
scheme https
log_es_400_reason true
rollover_index true
ssl_version TLSv1_2
host <REMOVED>
port <REMOVED>
user <REMOVED
password <REMOVED>
enable_ilm true
logstash_format true
logstash_prefix debug
index_date_pattern "now/d"
ilm_policy_id fluentd-test-policy
ilm_policy {"policy":{"phases":{"hot":{"min_age":"0ms","actions":{"rollover":{"max_age":"1d","max_size":"50kb","max_docs":100},"set_priority":{"priority":100}}},"delete":{"min_age":"7d","actions":{"delete":{}}}}}}
template_name debug
customize_template {}
deflector_alias debug-logs
id_key _hash
remove_keys _hash
<buffer tag, time>
@type file
path /var/log/fluentd/es-build
timekey 60
flush_mode interval
flush_thread_count 4
flush_interval 10s
slow_flush_log_threshold 45.0
chunk_full_threshold 0.9
queue_limit_length 250m
overflow_action drop_oldest_chunk
# retry_forever
retry_type exponential_backoff
retry_timeout 10m
retry_max_interval 60
</buffer>
reconnect_on_error true
reload_on_failure true
reload_connections false
request_timeout 60s
</store>
</match>
```
#### Expected Behavior or What you need to ask
Rollover index is created and ILM is transitioned as expected
#### Using Fluentd and ES plugin versions
* OS version: Ubuntu 18.04 Bionic
* EC2 Deployment
* Fluentd td-agent 1.10.2
* ES plugin 4.0.7
* td-agent log
```
"/var/log/td-agent/td-agent.log" [readonly] 56095L, 5396648C 53056,1 94%
chunk_full_threshold 0.9
queue_limit_length 250m
overflow_action drop_oldest_chunk
retry_type exponential_backoff
retry_timeout 10m
retry_max_interval 60
</buffer> is not used.
2020-05-03 19:42:10 +0000 [info]: #0 starting fluentd worker pid=9645 ppid=9639 worker=0
2020-05-03 19:42:10 +0000 [debug]: #0 restoring buffer file: path = /var/log/fluentd/es-build/buffer.b5a4c39b9ec67a28754a587f6b1e64e53.log
2020-05-03 19:42:10 +0000 [debug]: #0 buffer started instance=69853234533220 stage_size=16925 queue_size=0
2020-05-03 19:42:10 +0000 [debug]: #0 flush_thread actually running
2020-05-03 19:42:10 +0000 [debug]: #0 enqueue_thread actually running
2020-05-03 19:42:10 +0000 [debug]: #0 flush_thread actually running
2020-05-03 19:42:10 +0000 [debug]: #0 flush_thread actually running
2020-05-03 19:42:10 +0000 [info]: #0 [input_debug_agent] listening dRuby uri="druby://127.0.0.1:24230" object="Fluent::Engine" worker=0
2020-05-03 19:42:10 +0000 [info]: #0 [input_forward] listening port port=24224 bind="0.0.0.0"
2020-05-03 19:42:10 +0000 [info]: #0 fluentd worker is now running worker=0
2020-05-03 19:42:11 +0000 [debug]: #0 Created new chunk chunk_id="5a4c39c49f6849285edb1cc567b3dd04" metadata=#<struct Fluent::Plugin::Buffer::Metadata timekey=1588534920, tag="debug.test", variables=nil, seq=0>
2020-05-03 19:42:11 +0000 [debug]: #0 flush_thread actually running
2020-05-03 19:42:48 +0000 [debug]: #0 Created new chunk chunk_id="5a4c39e863d02a0b6b3b6a72b1efdb14" metadata=#<struct Fluent::Plugin::Buffer::Metadata timekey=1588534920, tag="debug.test", variables=nil, seq=0>
2020-05-03 19:42:58 +0000 [debug]: #0 Created new chunk chunk_id="5a4c39f1ff345c0e3b8ffee320616815" metadata=#<struct Fluent::Plugin::Buffer::Metadata timekey=1588534920, tag="debug.test", variables=nil, seq=0>
2020-05-03 19:43:00 +0000 [debug]: #0 Created new chunk chunk_id="5a4c39f3245bc04ae2756c3a19f8d1be" metadata=#<struct Fluent::Plugin::Buffer::Metadata timekey=1588534980, tag="debug.test", variables=nil, seq=0>
2020-05-03 19:43:10 +0000 [debug]: #0 Created new chunk chunk_id="5a4c39fd715033be53de54a639a41390" metadata=#<struct Fluent::Plugin::Buffer::Metadata timekey=1588534980, tag="debug.test", variables=nil, seq=0>
2020-05-03 19:43:20 +0000 [debug]: #0 Created new chunk chunk_id="5a4c3a06fc90a6dbf72cdbc28d676f3e" metadata=#<struct Fluent::Plugin::Buffer::Metadata timekey=1588534980, tag="debug.test", variables=nil, seq=0>
2020-05-03 19:43:30 +0000 [debug]: #0 Created new chunk chunk_id="5a4c3a1084a6e05402651a2b41454bf4" metadata=#<struct Fluent::Plugin::Buffer::Metadata timekey=1588534980, tag="debug.test", variables=nil, seq=0>
2020-05-03 19:43:40 +0000 [debug]: #0 Created new chunk chunk_id="5a4c3a1a0e8b866593829d5b5354aa75" metadata=#<struct Fluent::Plugin::Buffer::Metadata timekey=1588534980, tag="debug.test", variables=nil, seq=0>
2020-05-03 19:43:50 +0000 [debug]: #0 Created new chunk chunk_id="5a4c3a23990eb6726aa2bfdab46f8118" metadata=#<struct Fluent::Plugin::Buffer::Metadata timekey=1588534980, tag="debug.test", variables=nil, seq=0>
2020-05-03 19:44:00 +0000 [debug]: #0 Created new chunk chunk_id="5a4c3a2c5cf5edd35fdf15d9e0db026f" metadata=#<struct Fluent::Plugin::Buffer::Metadata timekey=1588535040, tag="debug.test", variables=nil, seq=0>
2020-05-03 19:44:10 +0000 [debug]: #0 Created new chunk chunk_id="5a4c3a36ad99ef16f0753cb9968dc758" metadata=#<struct Fluent::Plugin::Buffer::Metadata timekey=1588535040, tag="debug.test", variables=nil, seq=0>
2020-05-03 19:44:20 +0000 [debug]: #0 Created new chunk chunk_id="5a4c3a403787dafc7dd53187f7cfb7bd" metadata=#<struct Fluent::Plugin::Buffer::Metadata timekey=1588535040, tag="debug.test", variables=nil, seq=0>
2020-05-03 19:44:30 +0000 [debug]: #0 Created new chunk chunk_id="5a4c3a49bfa4bf3322b1e3aa8b77b60e" metadata=#<struct Fluent::Plugin::Buffer::Metadata timekey=1588535040, tag="debug.test", variables=nil, seq=0>
2020-05-03 19:44:40 +0000 [debug]: #0 Created new chunk chunk_id="5a4c3a5349cb2df0c233223bd4947091" metadata=#<struct Fluent::Plugin::Buffer::Metadata timekey=1588535040, tag="debug.test", variables=nil, seq=0>
2020-05-03 19:44:50 +0000 [debug]: #0 Created new chunk chunk_id="5a4c3a5cd3358494313c3c6ac76c707b" metadata=#<struct Fluent::Plugin::Buffer::Metadata timekey=1588535040, tag="debug.test", variables=nil, seq=0>
2020-05-03 19:45:00 +0000 [debug]: #0 Created new chunk chunk_id="5a4c3a65958ca98542c8ef652794485e" metadata=#<struct Fluent::Plugin::Buffer::Metadata timekey=1588535100, tag="debug.test", variables=nil, seq=0>
```
* td-agent-gem list
```
*** LOCAL GEMS ***
addressable (2.7.0)
async (1.24.2)
async-http (0.50.8)
async-io (1.27.7)
async-pool (0.2.0)
aws-eventstream (1.1.0)
aws-partitions (1.297.0)
aws-sdk-core (3.94.0)
aws-sdk-kms (1.30.0)
aws-sdk-s3 (1.63.0)
aws-sdk-sqs (1.24.0)
aws-sigv4 (1.1.1)
bigdecimal (default: 1.3.2)
bundler (1.16.6)
concurrent-ruby (1.1.6)
console (1.8.2)
cool.io (1.6.0)
did_you_mean (1.1.0)
digest-crc (0.5.1)
elasticsearch (6.8.1)
elasticsearch-api (6.8.1)
elasticsearch-transport (6.8.1)
excon (0.73.0)
faraday (0.17.3)
ffi (1.12.2)
fluent-config-regexp-type (1.0.0)
fluent-logger (0.8.2)
fluent-plugin-elasticsearch (4.0.7)
fluent-plugin-kafka (0.13.0)
fluent-plugin-prometheus (1.7.3)
fluent-plugin-prometheus_pushgateway (0.0.2)
fluent-plugin-record-modifier (2.1.0)
fluent-plugin-rewrite-tag-filter (2.2.0)
fluent-plugin-s3 (1.3.1)
fluent-plugin-systemd (1.0.2)
fluent-plugin-td (1.1.0)
fluent-plugin-td-monitoring (0.2.4)
fluent-plugin-webhdfs (1.2.4)
fluentd (1.10.2)
hirb (0.7.3)
http_parser.rb (0.6.0)
httpclient (2.8.2.4)
io-console (default: 0.4.6)
ipaddress (0.8.3)
jmespath (1.4.0)
json (default: 2.0.4)
ltsv (0.1.2)
mini_portile2 (2.4.0)
minitest (5.10.1)
mixlib-cli (1.7.0)
mixlib-config (2.2.4)
mixlib-log (1.7.1)
mixlib-shellout (2.2.7)
msgpack (1.3.3)
multi_json (1.14.1)
multipart-post (2.1.1)
net-telnet (0.1.1)
nio4r (2.5.2)
nokogiri (1.10.9)
ohai (6.20.0)
oj (3.8.1)
openssl (default: 2.0.9)
parallel (1.19.1)
power_assert (0.4.1)
prometheus-client (0.9.0)
protocol-hpack (1.4.2)
protocol-http (0.15.1)
protocol-http1 (0.10.3)
protocol-http2 (0.11.6)
psych (default: 2.2.2)
public_suffix (4.0.4)
quantile (0.2.1)
rake (12.3.3, 12.0.0)
rdkafka (0.7.0)
rdoc (default: 5.0.1)
ruby-kafka (1.0.0)
ruby-progressbar (1.10.1)
rubyzip (1.3.0)
serverengine (2.2.1)
sigdump (0.2.4)
strptime (0.2.3)
systemd-journal (1.3.3)
systemu (2.5.2)
td (0.16.8)
td-client (1.0.7)
td-logger (0.3.27)
test-unit (3.2.3)
timers (4.3.0)
tzinfo (2.0.2)
tzinfo-data (1.2019.3)
webhdfs (0.9.0)
xmlrpc (0.2.1)
yajl-ruby (1.4.1)
zip-zip (0.3)
```
* ES version 7.6.2
<img width="856" alt="Screen Shot 2020-05-03 at 2 18 39 PM" src="https://user-images.githubusercontent.com/2912112/80924434-836ac700-8d4e-11ea-83d8-fa678597559b.png">