# Setting missing field to default value based on a master template

**URL:** <https://discuss.elastic.co/t/setting-missing-field-to-default-value-based-on-a-master-template/39317>\
**Category:** Elasticsearch\
**Created:** [January 15, 2016, 10:32am UTC](https://discuss.elastic.co/t/setting-missing-field-to-default-value-based-on-a-master-template/39317 "2016-01-15T10:32:59Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![gringo](https://avatars.discourse-cdn.com/v4/letter/g/f19dbf/32.png) [@gringo](https://discuss.elastic.co/u/gringo)\
**Post date:** [January 15, 2016, 10:32am UTC](https://discuss.elastic.co/t/setting-missing-field-to-default-value-based-on-a-master-template/39317/1 "2016-01-15T10:32:59Z")

</div>

Setting missing field to default value based on a master template

I will put my example in non elasticsearh language.

I have two tables table\_a and table\_b  
table\_a  
Field1 Field2

table\_b  
field, field3

How do I make it such that after receiving data from Logstash, I can receive the following  
table\_c  
Field1 Field2, Field3  
Field 2 should contain a null or empty value

---

<div class="post-metadata">

**Author:** ![gringo](https://avatars.discourse-cdn.com/v4/letter/g/f19dbf/32.png) [@gringo](https://discuss.elastic.co/u/gringo)\
**Post date:** [January 15, 2016, 10:43am UTC](https://discuss.elastic.co/t/setting-missing-field-to-default-value-based-on-a-master-template/39317/2 "2016-01-15T10:43:47Z")

</div>

I heard that I can use a template to ensure non-existing field to be created in elsticsearch as field with empty value. Should I do this? How do I do this?

---

<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:** [July 5, 2017, 11:24pm UTC](https://discuss.elastic.co/t/setting-missing-field-to-default-value-based-on-a-master-template/39317/3 "2017-07-05T23:24:09Z")

</div>


