Commit d77610fc authored by Kubernetes Submit Queue's avatar Kubernetes Submit Queue Committed by GitHub

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 ```
parents 00aae980 00f6592d
{ {
"template_k8s_logstash" : { "template" : "logstash-*",
"template" : "logstash-*", "settings" : {
"settings" : { "index.refresh_interval" : "5s"
"index.refresh_interval" : "5s" },
}, "mappings" : {
"mappings" : { "_default_" : {
"_default_" : { "dynamic_templates" : [ {
"dynamic_templates" : [ { "kubernetes_labels" : {
"kubernetes_field" : { "path_match" : "kubernetes.labels",
"path_match" : "kubernetes.*", "mapping" : {
"mapping" : { "type" : "object",
"type" : "string", "dynamic_templates" : [ {
"index" : "not_analyzed" "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"
}
}
} ]
} }
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment