Index split

91 views
Skip to first unread message

ismailctest C

unread,
Mar 8, 2023, 4:42:28 AM3/8/23
to Wazuh mailing list
Hi,
Is there any option to split index files?

Eg: We are getting the logs from 10 servers, one server logs to inject to new index file. Remaining all  to be injected to default index file.

Miguel Casares

unread,
Mar 8, 2023, 6:40:19 AM3/8/23
to Wazuh mailing list
Hello Ismail,

You can use the Split Index to accomplish this for the indices already indexed in your system. For instance:
POST /my-index-000001/_split/split-my-index-000001 { "settings": { "index.number_of_shards": 2 }

For the new logs, I would recommend editing the indexing pipeline:
/usr/share/filebeat/module/wazuh/alerts/ingest/pipeline.json  :


Then, you can create a filter based on the field on the Wazuh alerts. For instance
{ "date_index_name": { "if": "ctx.agent?.groups == 'groupa'", "field": "timestamp", "date_rounding": "d", "index_name_prefix": "{{fields.index_prefix}}groupa-", "index_name_format": "yyyy.MM.dd", "ignore_failure": true } },

Then, you need to reload the pipeline:
filebeat setup --pipelines

Once completed, you may need to create the new index pattern.

You may find more information here:

I hope that helps. Let me know if you need anything else.

Regards,

Miguel


Reply all
Reply to author
Forward
0 new messages