uken / fluent-plugin-elasticsearch

Apache License 2.0
891 stars 310 forks source link

failed to push msg to new index after index rollover. #907

Open astzyj opened 3 years ago

astzyj commented 3 years ago

(check apply)

Problem

I have set ILM in ES successfully. The index rolled over correctly.

But fluentd failed to push the msg to the latest index, instead it keep push msg to the first index.

Steps to replicate

I have index template:

{
  "template-daily" : {
    "order" : 0,
    "index_patterns" : [
      "daily-*"
    ],
    "settings" : {
      "index" : {
        "lifecycle" : {
          "name" : "daily",
          "rollover_alias" : "rollover-alias-daily"
        }
      }
    },
    "mappings" : {
      "_meta" : { },
      "_source" : { },
      "properties" : { }
    },
    "aliases" : {
      "template-alias-daily" : { }
    }
  }
}

fluentd config:

...
index_name: daily-0001
rollover_index true
deflector_alias rollover-alias-daily

Provide example config and message

Expected Behavior or What you need to ask

I suppose I did not configure the fluentd correctly. Hope there is a sample for the situation

Using Fluentd and ES plugin versions

K8s: fluentd --version: fluentd 1.12.0 fluent-gem list: fluent-plugin-elasticsearch (5.0.5)