What I want is to add this host.name.keyword in previous index pattern.
I understand that I must have messed up something when I did create first set of index and patterns.
how do I add host.name.keyword now to previous pattern?
ok. that make sense. but I don't know how it came up as host.name = keyword, this is using metricbeat template (7.12.0) I must have done something to be like that.
because second example is 7.17.1 metricbeat template.
one more question then
on second pic it shows
host.name = text,keyword. but I am not able to use that on viz it gives me this error
Reason
Text fields are not optimised for operations that require per-document field data like aggregations and sorting, so these operations are disabled by default. Please use a keyword field instead. Alternatively, set fielddata=true on [host.name] in order to load field data by uninverting the inverted index. Note that this can use significant memory.
That means the template is not applied... you did not run setup or you renamed the index to something the template does not match therefore the perdefined mapping is not applied and thus the default mapping IS applied (I show that at the bottom)
Yes this makes perfect sense...
host.name
Actually a multifield (2 fields in 1)
One is host.name is a text field which you can not aggregate on hence the error message above
the Second host.name.keyword is a keyword which you can use to aggregate on.
Do this... this is what is happening and you are seeing...
POST discuss-test/_doc
{
"host.name" : "myhost"
}
GET discuss-test
{
"discuss-test": {
"aliases": {},
"mappings": {
"properties": {
"host": {
"properties": {
"name": {
"type": "text", <!----- host.name of type text
"fields": {
"keyword": {
"type": "keyword", <!--- host.name.keyword of type keyword
"ignore_above": 256
}
}
}
}
}
}
}
...
What it should look like, and will look like with the proper templates / mapping applied
Thanks again @stephenb
I was able to duplicate exactly what I had in production to test cluster.
what I had to do is host.name is not something that comes with metricbeat (fields.yml) hence once I put the default template which is composable index template. I added this
Hostname of the host. It normally contains what the hostname command returns on the host machine.
type: keyword
host.name
Name of the host. It can contain what hostname returns on Unix systems, the fully qualified domain name, or a name specified by the user. The sender decides which value to use.
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.