You just need to create an index template in Elasticsearch and set the index_pattern of the template to match the names that you are using in logstash.
For example, using the index_pattern of test.* will match any index created which name starts with test.
Create an Index Template with an Index Pattern that matches the Index name defined in your Logstash pipeline config.
Make an Index Lifecycle Management Policy via Kibana GUI: Settings -> Elasticsearch -> Index Lifecycle Policies: Create Policy. Configure however you want.
Go back to the main Index Policy Menu, and click "Actions" next to the Index Policy you just made.
Click "Add policy to index template" and then select the index template we created in step 1.
Done. Any new indices created by Logstash that match the index pattern in your index template will automatically have the lifecycle policy we made applied to them.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.