Shard creation when using index pattern

How are shards created/allocated when we are using an index pattern such that each day's log is written to a separate index (eg my_index_emailf_log-* , my_index_emailf_log-dd-mm-yyyy .)

Suppose we have specified 1 primary shard and 1 replica shard for that index pattern,
will a separate primary shard and separate replica shard gets created daily for each index that gets created daily with the name for eg my_index_emailf_log-31-10-2021?

regards
shini

Whatever the shard and replica setting are in the index template each new index that matches the pattern in the template will be created with the defined setting from the template and thus will have the defined number of Primary and Replica shards.

So yes each daily index will have the defined Primary and Replica shads, in your example 1 Primary and 1 Replica

in that case there will be lots of shards created as days pass by. Is it an issue ?. Is it the correct way to do? or should i create a monthly index?
thanks and regards
shini

It could be an issue but that depends on the number of indices and the size of your nodes etc , that is why ILM policies can be defined as sized based instead of time based, but monthly can work as well.

For more info on sizing shards perhaps take a look here

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.