# Occasional mapping failure for numeric field

**URL:** <https://discuss.elastic.co/t/occasional-mapping-failure-for-numeric-field/108358>\
**Category:** Logstash\
**Created:** [November 20, 2017, 10:19am UTC](https://discuss.elastic.co/t/occasional-mapping-failure-for-numeric-field/108358 "2017-11-20T10:19:43Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Matthew\_Field](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/matthew_field/32/26599_2.png) [@Matthew\_Field](https://discuss.elastic.co/u/Matthew_Field)\
**Post date:** [November 20, 2017, 10:19am UTC](https://discuss.elastic.co/t/occasional-mapping-failure-for-numeric-field/108358/1 "2017-11-20T10:19:43Z")

</div>

I am getting occasional mapping errors like this:

"type"=\>"mapper\_parsing\_exception", "reason"=\>"failed to parse", "caused\_by"=\>{"type"=\>"number\_format\_exception", "reason"=\>"For input string: "%{[doc][geoip][latitude]}""}}

The mapping is numeric type, and I get hundreds of thousands of good documents through, while maybe 10 documents fail each hour. How can i visualise or send to an alternative index the 10 documents that are failing?

I imagine i should use an "if" on the output, but I cant find a statement which works.

I would like something like

if [doc][geoip][latitude] is not a number datatype {  
send to different index  
}

But i cant find a way to do if " is not a number"

Thanks!

---

<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 18, 2017, 10:20am UTC](https://discuss.elastic.co/t/occasional-mapping-failure-for-numeric-field/108358/2 "2017-12-18T10:20:03Z")

</div>

Closed on December 18, 2017, 10:20am UTC

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