Beats 6.2 dynamic templates using fields.yml

Hello,

Is there a way to set dynamic templates using fields.yml?

Is there a change for dynamic templates in 6.2? Before on Beats 5.5 both text and keyword are assigned when there's a string.

I want to set the default dynamic template as shown below for all indices. I tried to use PUT in Kibana dev tools but it's unsuccessful.

PUT my_index
{
  "mappings": {
	"_doc": {
	  "dynamic_templates": [
		{
		  "strings": {
			"match_mapping_type": "string",
			"mapping": {
			  "type": "text",
			  "fields": {
				"keyword": {
				  "type":  "keyword",
				}
			  }
			}
		  }
		}
	  ]
	}
  }
}

For now the dynamic template is this; I don't want this:

    "dynamic_templates": [
      {
        "strings_as_keyword": {
          "match_mapping_type": "string",
          "mapping": {
            "ignore_above": 1024,
            "type": "keyword"
          }
        }
      }

Thank you.

Hi,

With what beat do you need this? Do you want it for specific fields or for all string fields?

Hello,

I need this for filebeat 6.2.2. I want all strings to have the dynamic template with text and keyword type.

  "dynamic_templates": [
	{
	  "strings": {
		"match_mapping_type": "string",
		"mapping": {
		  "type": "text",
		  "fields": {
			"keyword": {
			  "type":  "keyword",
			}
		  }
		}
	  }
	}
  ]

Thank you.

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