mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 11:50:44 +00:00
Merge pull request #36857 from Shrugs/fix/elasticsearch-template-mapping
Automatic merge from submit-queue fix: elasticsearch template mapping to parse kubernetes.labels **What this PR does / why we need it**: This PR updates the field mappings for the elasticsearch template that ships with the EFK stack implementation. Specifically, elasticsearch cannot parse the `kubernetes.labels` object because it attempts to treat it as a string and produces an error. This update treats `kubernetes.labels` as an object and all of the properties within as a string, allowing accurate indexing and allowing users in kibana to search on `kubernetes.labels.*`. **Release note**: ```release-note Fluentd/Elastisearch add-on: correctly parse and index kubernetes labels ```
This commit is contained in:
commit
d77610fc4d
@ -1,22 +1,35 @@
|
||||
{
|
||||
"template_k8s_logstash" : {
|
||||
"template" : "logstash-*",
|
||||
"settings" : {
|
||||
"index.refresh_interval" : "5s"
|
||||
},
|
||||
"mappings" : {
|
||||
"_default_" : {
|
||||
"dynamic_templates" : [ {
|
||||
"kubernetes_field" : {
|
||||
"path_match" : "kubernetes.*",
|
||||
"mapping" : {
|
||||
"type" : "string",
|
||||
"index" : "not_analyzed"
|
||||
}
|
||||
"template" : "logstash-*",
|
||||
"settings" : {
|
||||
"index.refresh_interval" : "5s"
|
||||
},
|
||||
"mappings" : {
|
||||
"_default_" : {
|
||||
"dynamic_templates" : [ {
|
||||
"kubernetes_labels" : {
|
||||
"path_match" : "kubernetes.labels",
|
||||
"mapping" : {
|
||||
"type" : "object",
|
||||
"dynamic_templates" : [ {
|
||||
"match_mapping_type": "string",
|
||||
"path_match" : "*",
|
||||
"mapping" : {
|
||||
"type" : "string",
|
||||
"index" : "not_analyzed"
|
||||
}
|
||||
} ]
|
||||
}
|
||||
} ]
|
||||
}
|
||||
}
|
||||
}, {
|
||||
"kubernetes_field" : {
|
||||
"match_mapping_type": "string",
|
||||
"path_match" : "kubernetes.*",
|
||||
"mapping" : {
|
||||
"type" : "string",
|
||||
"index" : "not_analyzed"
|
||||
}
|
||||
}
|
||||
} ]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user