Scenario
I am using filebeat to collect logs from 2 different sources.
It is going to 2 different indexes. Thus in the filebeat.yml the following are added to the Elasticsearch output:
My intentions (using the above example) is to save any logs from IIS to indices starting with “iis-”, while the defaults go to indices starting with “logs-”.
My question is: I want to use different ILM policies for different indices (the retention period will be different), how to I associated the ILM policy name to each index?
I am just using ILM just for deleting indices after a certain period.
The behavior is based on version 7.4.2
I have thought about using the template but I have problem loading the initial template.
Let me explain, when you setup a filebeat agent using IIS module and specified the template and index name and having only one elasticsearch.output as follow:
ElasticSearch will automatically create a template called “baa-7.4.2”.
Question here is how I load this manually? This is first required to allow me to add the ILM policy name.
In other observations
I have updated from version 7.3.2 to 7.4.2, the following behaved differently.
In a multiple elastic outputs scenario as follows:
Since we use Logstash, I don't use the beats setup after initial setup. (I don't what to give the access necessary to manage templates to things that are just sending logs)
My method.... I setup the default template for each version, like "filebeat-7.4.0", by default, it has Order:1. We name our indices so that they match this index pattern, with suffixes to separate as needed, for example "filebeat-7.4.0-thing1-campus1".
If I needed a template "baa-7.4.0-*", I would just GET the default template, edit it, and POST it back using devtools or curl, but I keep the ILM part out of these templates as below.
I can create a template for index patterns "filebeat*thing1" to add mappings and I use order: 100 to trump any future field name conflicts from Elastic. This template doesn't repeat anything from the default template.
I can also create a template for index patterns "*-campus1" to add ILM options for those with order:150.
The beats setup changes from 6.x to 7.x are confusing. I'm not using 7.4.2 yet, so maybe they get more confusing. That and using Lostash are reasons why I just did it myself :-).
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.