Hello John,
Thanks for reaching out.
Apologies for the late response.
To store certain fields as numbers instead of strings, you can use the 'type' option in the mapping.
By default, the Wazuh indexer analyzes values from existing alerts as string data types. To change the default data type from string to double, do the following:
Wazuh server
1. Add the custom fields in the Wazuh template.
Find the data section in the /etc/filebeat/wazuh-template.json file, and add the highlighted custom fields to the data properties section:
{
"order": 0,
"index_patterns": [
"wazuh-alerts-4.x-*",
"wazuh-archives-4.x-*"
],
"settings": {
...
},
"mappings": {
"dynamic_templates": [
{
...
"data": {
"properties": {
"alertCount": {
"type": "double"
},
"elapsedMs": {
"type": "double"
},
"audit": {
"properties": {
"acct": {
"type": "keyword"
2. To apply the changes to the Wazuh template, run the command below:
sudo filebeat setup -index-management
An expected output is shown below:
Output
ILM policy and write alias loading not enabled.
Index setup finished.
Note that this change would only apply to any newly created index as modifying existing fields is not permitted in the Wazuh indexer. Once an index is created with some data fields, any changes to the existing fields on the live index are not allowed. Regardless, there is a walkaround; re-indexing.
To apply the re-index, kindly follow the indexing step used in this blog as a guide;
I hope this helps. Let me know if you have further questions.
Regards,
Kasim Mustapha