# Ingest pipeline errors and "on\_failure"

**URL:** <https://discuss.elastic.co/t/ingest-pipeline-errors-and-on-failure/75315>\
**Category:** Elasticsearch\
**Created:** [February 16, 2017, 11:05am UTC](https://discuss.elastic.co/t/ingest-pipeline-errors-and-on-failure/75315 "2017-02-16T11:05:44Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![John16](https://avatars.discourse-cdn.com/v4/letter/j/ea666f/32.png) [@John16](https://discuss.elastic.co/u/John16)\
**Post date:** [February 18, 2017, 9:26am UTC](https://discuss.elastic.co/t/ingest-pipeline-errors-and-on-failure/75315/3 "2017-02-18T09:26:18Z")

</div>

Well, it does not work actually.  
I get an exception:

`2017/02/18 15:13:35.580963 client.go:432: WARN Can not index event (status=400): {"type":"mapper_parsing_exception","reason":"failed to parse [ip]","caused_by":{"type":"illegal_argument_exception","reason":"'-' is not an IP string literal."}}`

But if I change the type for `ip` field to `keyword`, I see in the imported log line:  
`"ip": "-",`

So the value is indeed `-`, but for some reason script does not work.

I also tried to change `null` in your script to `ctx.duration`, just to be sure that part of code is really executed, and then I see that the value of `ctx.duration` is correctly assigned to `ip` field. So `null` is the root of the problem: it does not work for some reason.

---

_[View the full topic](https://discuss.elastic.co/t/ingest-pipeline-errors-and-on-failure/75315)._
