# Is it possible to control which field to index in Logstash?

**URL:** https://discuss.elastic.co/t/is-it-possible-to-control-which-field-to-index-in-logstash/234546
**Category:** Logstash
**Created:** [May 27, 2020, 1:27pm UTC](https://discuss.elastic.co/t/is-it-possible-to-control-which-field-to-index-in-logstash/234546 "2020-05-27T13:27:09Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![tomeri](https://avatars.discourse-cdn.com/v4/letter/t/71c47a/32.png) [@tomeri](https://discuss.elastic.co/u/tomeri)
#### Post date: [May 27, 2020, 1:27pm UTC](https://discuss.elastic.co/t/is-it-possible-to-control-which-field-to-index-in-logstash/234546/1 "2020-05-27T13:27:09Z")

</div>

Hi,

I'm trying to apply some naming validation to each field that passes through Logstash, to match some predefined naming convention using regex.  
Assuming that I can distinguish within Logstash which field is eligible to be indexed or not, is it possible to somehow hint elasticsearch to not index them? without changing the field's name.

Thanks,

---

<div class="post-metadata">

### Author: ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)
#### Post date: [May 27, 2020, 2:16pm UTC](https://discuss.elastic.co/t/is-it-possible-to-control-which-field-to-index-in-logstash/234546/2 "2020-05-27T14:16:21Z")

</div>

Typically, if you send a field to elasticsearch then it will get indexed. If you do not want to index the field either remove it from the event, or disable [dynamic mapping](https://www.elastic.co/guide/en/elasticsearch/reference/current/dynamic-mapping.html), and create all your fields using a template in elasticsearch.

---

<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: [June 24, 2020, 2:16pm UTC](https://discuss.elastic.co/t/is-it-possible-to-control-which-field-to-index-in-logstash/234546/3 "2020-06-24T14:16:21Z")

</div>

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