# Logstash error when converting field \[http\]\[response\]\[status\_code\] into integer

**URL:** <https://discuss.elastic.co/t/logstash-error-when-converting-field-http-response-status-code-into-integer/276456>\
**Category:** Logstash\
**Created:** [June 20, 2021, 7:55am UTC](https://discuss.elastic.co/t/logstash-error-when-converting-field-http-response-status-code-into-integer/276456 "2021-06-20T07:55:47Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![bertr](https://avatars.discourse-cdn.com/v4/letter/b/e495f1/32.png) [@bertr](https://discuss.elastic.co/u/bertr)\
**Post date:** [June 20, 2021, 7:55am UTC](https://discuss.elastic.co/t/logstash-error-when-converting-field-http-response-status-code-into-integer/276456/1 "2021-06-20T07:55:48Z")

</div>

Tried this with logtsash 7.10.2 and 7.12.1:

The following code results in "(TypeError) no implicit conversion of nil into Integer":

```auto
mutate { add_field => { "[http][response][status_code]" => "200" } } <== this statement is OK
mutate { convert => { "[http][response][status_code]" => "integer" } } <== this statement fails

```

but if you rename the field to something else it works:

```auto
mutate { add_field => { "[http][response][status_co]" => "200" } } 
mutate { convert => { "[http][response][status_co]" => "integer" } }

```

So, it looks as if logstash gets confused with field named as [http][response][status\_code]

---

<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 18, 2021, 7:55am UTC](https://discuss.elastic.co/t/logstash-error-when-converting-field-http-response-status-code-into-integer/276456/2 "2021-07-18T07:55:55Z")

</div>

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