Hello David,
I am glad it was helpful for you.
First of all, I would like to share with you some information on how to create Visualizations and Dashboards: https://opster.com/guides/opensearch/opensearch-basics/opensearch-dashboards-visualizations-notebooks-operational/
Answering your questions:
Can i check / where can i check, if the data is now stored in “long” data type instead of “string” data type?
You can check that in the Menu > Stack Management > Index Patterns, or you can see it in the Discover section by checking in the left of the field name, it will have an icon that represents the data type, if you place the mouse cursor over it, it will tell you the type (if the icon is a # then the type is numerical).
And how do I create the dashboard to show this metrics
What you need to create is a visualization, you can go to Menu > Visualizations and create the one you need between all the types available.
I hope this information could be helpful for you also.
Kind Regards.
Hello David,
That is because you already have data ingested with the previous types. To bypass this you can either change the mapping of the value (sometimes that is not possible) or reindexing the data in elasticsearch:
PUT /wazuh-alerts-*/_mapping
{
"properties": {
"data": {
"properties": {
"winCounter": {
"properties": {
"CookedValue": {
"type": "long"
},
"RawValue": {
"type": "long"
}
}
}
}
}
}
}
If this does not work, please try reindexing the data:
You need to do this with every index that has the data regarding the win counters, since the indices are daily, you need to reindex all the indices from the date you were ingesting the win counter data.
Run the following command
POST _reindex?wait_for_completion=false
{
"source": {
"index": "wazuh-alerts-x.y-YYYY.MM.DD"
},
"dest": {
"index": "wazuh-alerts-x.y-YYYY.MM.DD-new"
}
}
You will get this result:
{
"task" : "<task_id>"
}
Check the task status:
GET _tasks/<task_id>
Wait for the result to throw this line:
"completed" : true,
Delete the original index
DELETE wazuh-alerts-x.y-YYYY.MM.DD
Check if you receive this result:
{
"acknowledged" : true
}
Run the following command
POST _reindex?wait_for_completion=false
{
"source": {
"index": "wazuh-alerts-x.y-YYYY.MM.DD-new"
},
"dest": {
"index": "wazuh-alerts-x.y-YYYY.MM.DD"
}
}
Check the task status:
GET _tasks/<task_id>
Wait for the result to throw this line:
"completed" : true,
Delete the intermediate index
DELETE wazuh-alerts-x.y-YYYY.MM.DD-new
Check if you receive this result:
{
"acknowledged" : true
}
Once you do that, all the values on the indices will have the new types, and going to the Index Patterns, you will be able to refresh it and see the new types reflected.
Please let me know if this solves your issues.