Path_match object name Dynamic templates

Hello,

I created the following dynamic template to apply a custom mapping on the "kubernetes" object and it's subobjects and fields:

It should match these:
kubernetes.container.name
kubernetes.pod.name
kubernetes.pod.id
kubernetes.namespace
{
"kubernetes_object": {
"path_match": "kubernetes*",
"mapping": {
"dynamic": true
}
}
}
The problem is, it also matches fields like :thinking:

kuberneteser.container.name

kubernetesaaaaa.container.name

How can I match kubernetes. exactly? I tried various syntaxes but had no luck

how about this (unless I misunderstood you).

PUT my_index
{
  "mappings": {
    "dynamic_templates": [
      {
        "kubernetes": {
          "path_match":   "kubernetes.*",
          "mapping": {
            "type":       "keyword"
          }
        }
      }
    ]
  }
}

PUT my_index/_doc/1
{
  "kuebernetes": {
    "foo": "bar"
  },
  "kuebernetesaaaa": true
}

GET my_index/_mapping

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.