# How to manually insert NONE value to elasticsearch index field using Logstash?

**URL:** <https://discuss.elastic.co/t/how-to-manually-insert-none-value-to-elasticsearch-index-field-using-logstash/76954>\
**Category:** Logstash\
**Created:** [March 1, 2017, 9:23am UTC](https://discuss.elastic.co/t/how-to-manually-insert-none-value-to-elasticsearch-index-field-using-logstash/76954 "2017-03-01T09:23:47Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![elasticheart](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/elasticheart/32/65189_2.png) [@elasticheart](https://discuss.elastic.co/u/elasticheart)\
**Post date:** [March 1, 2017, 9:23am UTC](https://discuss.elastic.co/t/how-to-manually-insert-none-value-to-elasticsearch-index-field-using-logstash/76954/1 "2017-03-01T09:23:47Z")

</div>

Hi,

I have logfiles which contain numeric data, and I have manually created the map accordingly, specifying the `number` fields. But the problem is that in case if there is no data for field, log files will be generated with a `-` hyphen for fields having no data. This creates error since `-` cannot be inserted into a numeric field. To solve this, I replace the `-`s with `0`s like below;

```
if [fieldA] == "-" {
	mutate {
		replace => ["fieldA", "0"]
	}
}

```

even if i replace `"0"` with `""`, the field inserted is not NONE. How can I set logstash like I want to insert `NONE` to field if the log entry has `-`?

Thank you.

---

<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:** [March 29, 2017, 9:24am UTC](https://discuss.elastic.co/t/how-to-manually-insert-none-value-to-elasticsearch-index-field-using-logstash/76954/2 "2017-03-29T09:24:00Z")

</div>

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