# Converting filebeat.template.json to fields.yml

**URL:** https://discuss.elastic.co/t/converting-filebeat-template-json-to-fields-yml/157850
**Category:** Beats
**Tags:** filebeat
**Created:** [November 22, 2018, 10:08am UTC](https://discuss.elastic.co/t/converting-filebeat-template-json-to-fields-yml/157850 "2018-11-22T10:08:31Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Martin\_H\_Andersen](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/martin_h_andersen/32/37348_2.png) [@Martin\_H\_Andersen](https://discuss.elastic.co/u/Martin_H_Andersen)
#### Post date: [November 22, 2018, 10:08am UTC](https://discuss.elastic.co/t/converting-filebeat-template-json-to-fields-yml/157850/1 "2018-11-22T10:08:32Z")

</div>

I am in the process of upgrading from filebeat 5 alpha 4 (-: to latest 6.5.1

How do I convert filebeat.template.json to fields.yml? Whats the syntax for the first part of the document with mappings and dynamic\_templates?

```
{

```

"mappings": {  
"_default_": {  
"\_all": {  
"norms": false  
},  
"dynamic\_templates": [  
{  
"fields": {  
"mapping": {  
"ignore\_above": 1024,  
"type": "keyword"  
},  
"match\_mapping\_type": "string",  
"path\_match": "fields._"  
}  
}  
],  
"properties": {  
"@timestamp": {  
"type": "date"  
},  
"beat": {  
"properties": {  
"hostname": {  
"ignore\_above": 1024,  
"type": "keyword"  
},  
"name": {  
"ignore\_above": 1024,  
"type": "keyword"  
}  
}  
},  
"input\_type": {  
"ignore\_above": 1024,  
"type": "keyword"  
},  
"message": {  
"norms": false,  
"type": "text"  
},  
"offset": {  
"type": "long"  
},  
"source": {  
"ignore\_above": 1024,  
"type": "keyword"  
},  
"tags": {  
"ignore\_above": 1024,  
"type": "keyword"  
},  
"type": {  
"ignore\_above": 1024,  
"type": "keyword"  
}  
}  
}  
},  
"order": 0,  
"settings": {  
"index.refresh\_interval": "5s"  
},  
"template": "filebeat-_"  
}

---

<div class="post-metadata">

### Author: ![pierhugues](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pierhugues/32/48383_2.png) [@pierhugues](https://discuss.elastic.co/u/pierhugues)
#### Post date: [November 22, 2018, 1:32pm UTC](https://discuss.elastic.co/t/converting-filebeat-template-json-to-fields-yml/157850/2 "2018-11-22T13:32:38Z")

</div>

@Martin_H_Andersen I think the command I've referenced in your other post will help: `{beatname} export template`

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [December 20, 2018, 1:32pm UTC](https://discuss.elastic.co/t/converting-filebeat-template-json-to-fields-yml/157850/3 "2018-12-20T13:32:40Z")

</div>

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