Created a inital write index with name " wazuh-alerts-000001"
I am seeing index getting as large as 90G for single day and the below error in rollover
java.lang.IllegalArgumentException: index.lifecycle.rollover_alias [wazuh-alerts] does not point to index [wazuh-alerts-4.x-2021.12.13]
at org.elasticsearch.xpack.core.ilm.WaitForRolloverReadyStep.evaluateCondition(WaitForRolloverReadyStep.java:114)
at org.elasticsearch.xpack.ilm.IndexLifecycleRunner.runPeriodicStep(IndexLifecycleRunner.java:174)
at org.elasticsearch.xpack.ilm.IndexLifecycleService.triggerPolicies(IndexLifecycleService.java:327)
at org.elasticsearch.xpack.ilm.IndexLifecycleService.triggered(IndexLifecycleService.java:265)
at org.elasticsearch.xpack.core.scheduler.SchedulerEngine.notifyListeners(SchedulerEngine.java:183)
at org.elasticsearch.xpack.core.scheduler.SchedulerEngine$ActiveSchedule.run(SchedulerEngine.java:216)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630)
Then what you are using to index should point to the write alias wazuh-alerts instead looks like you are writing directly to the concrete index wazuh-alerts-4.x-2021.12.13
I have tried creating a write index again with name "wazuh-alerts-4.x-2021.12.13-000001" and on rollover i see its trying to rollover the write index itself rather than my main index in question wazuh-alerts-4.x-2021.12.15.
Also I just noticed this.
Get rid of all this.. You're putting the template in by hand in the dev tools I don't know what's in all these but you're probably overriding and that's causing those weird templates.
Not sure I quite understand ... No you should not increment that should happen automatically.
If you are saying the you need to go to ....000002 then you need to set the old index to "is_write_index": false and create a new managed index.
Once you set it via Dev Tools or UI.. you don't need this.
I would set.
setup.ilm.overwrite: false
Also ... I would think it would be
setup.ilm.enabled: false
If the policy is set in the template you don't need to set it here.
Seems like you are setting all sorts of settings.....
BTW Also this is why we really have people just start with the defaults (filebeat index) get used to it all .. get it working with the defaults and THEN change to custom index names etc.. etc..
If you are following some other tutorial...perhaps take another read...
Perhaps but I don't think so ... that is against and old version.
I configure custom indexes with ILM with filebeat every day...
The Problem is ... It is hard from me to follow everything you are doing (or not doing)... we just set up 8 custom indices with ILM yesterday for a customer using filebeat it is running today and rolling over just fine.
The basic Steps:
Create and ILM Policy
Create a Template with the index patterns, the ILM policy and the rollover alias.
Create the initial managed index
Put the minimal required config in filebeat (This is where people struggle)
Run Filebeat.
AND you can always just use the defaults and get it running
Example here is a complete filebeat where we setup the ILM manually notice how little is there
filebeat.config:
modules:
path: ${path.config}/modules.d/*.yml
reload.enabled: false
filebeat.inputs:
- type: aws-s3
enabled: true
queue_url:
tags: [forwarded, custom-logs]
index: "custom-logs-writer-alias" <!---- KEY as we set it up all manually with the template, ILM etc
api_timeout: 6m
visibility_timeout: 12m
pipeline: custom-logs
setup.ilm.enabled: false <!---- KEY as we set it up all manually with the template, ILM etc
output.elasticsearch:
hosts: ["http://localhost:9200"]
I think part of problem is i am forced to use wazuh template rather than stock filebeat. Will try to investigate more and if i find something will post it here
The above I just posted used a custom template... you are close... don't give up... you are over configuring filebeat and it is conflicting with what you setup with the Template, ILM, and Initial Managed Index with the Writer Alias
Create and ILM policy
Just load the Wazuh Template... and add that policy to it.
Create the initial managed index
Then use minimal filebeat like above.
the setup.ilm.enabled: false
Seems counter intuitive.. what this says is filebeat don't manage the ILM I have set it up manually
problem with the other tutorials they often age out... or are not the most simple way...
You will get it!
Look carefully at that minimal... that is all you should need really need ... 2 settings
setup.ilm.enabled: false
and set the index to the write alias (Elasticsearch side will manage the rest) either on the inputs section or output.elasticsearch section
2021-12-16T12:59:56.801-0500 INFO instance/beat.go:645 Home path: [/usr/share/filebeat] Config path: [/etc/filebeat] Data path: [/var/lib/filebeat] Logs path: [/var/log/filebeat]
2021-12-16T12:59:56.802-0500 DEBUG [beat] instance/beat.go:697 Beat metadata path: /var/lib/filebeat/meta.json
2021-12-16T12:59:56.802-0500 INFO instance/beat.go:653 Beat ID: 9e4203d0-9719-48b9-8970-d4f876665e6f
2021-12-16T12:59:56.802-0500 INFO instance/beat.go:373 filebeat stopped.
2021-12-16T12:59:56.806-0500 ERROR instance/beat.go:956 Exiting: setup.template.name and setup.template.pattern have to be set if index name is modified
Yes tiny policies are not going to work the way you think...
1m / 20 mb is not really valid it will roll over but tiny fast / will not be exact.. it will rollover when it gets to it... background task. That will work right at scale of GBs / Day
BUT it looks like you did not create the initial managed index correct it should be pattern
wazuh-alerts-4.x-yyyy.mm.dd-000001
Stop filebeat
Delete all the indices
Go to Kibana Dev Tools and do the following
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.