Would it be possible to simply fix the data type of that field?
Would it be possible to delete the field or delete the metrics and start again from scratch? (since I am in a testing environment and the information is not relevant)
Although I would like to know how to solve it properly for when the environment is production
The error message indicates that you have one of the index starting with metrics- which has a wrong mapping.
So you need to find first what is this index.
You can do that by comparing all the mappings (which might be a very manual task though). You can run the following command in the Dev Console:
GET /metrics-*/_mapping/field/host.ip
Once you know, you can:
Remove the wrong index (but this will remove its data)
Reindex the wrong index with the right mapping to a new index named like metrics-xxx-fixed and then remove the wrong index
But you also need to understand who or which tool created this wrong index. Was that a manual test you did? A bug?...
No. "Simply" would mean to reindex. Which is what I suggested and what you did somehow.
Hello! Thank you very much for the quick response,
About finding the conflicting index, sorry, I knew which but I forgot to mention it. Although I didn't really know how to use this information either, Kibana's own interface shows it here:
About the tool that created the wrong index, I don't know. From what I see in the image, I guess that it was the mysql integration.
I have a policy in one agent with these two integrations ( System Integration and MySQL Integration), and it was yesterday when I added the mysql one and when I saw the error.
But about reindexing, what I did was reindex all those indexes that started with "metrics-", right? So what should I do in this specific case is this?
Unfortunately it hasn't worked, the console does not warn if the task has finished or not, I cannot find the new index either in "Index Management" or in "dataView/metrics-*"
index [.ds-metrics-mysql.performance-default-2024.01.11-000001] is the write index for data stream [metrics-mysql.performance-default] and cannot be deleted"
On the other hand, maybe I'm not understanding something, the exact name is told to me by the conflicting field, anyway I used the command you suggested:
GET /_data_stream/
And I have obtained this (which matches the name seen in the first screenshot of the post)
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.