# HttpStatus conversion to integer

**URL:** <https://discuss.elastic.co/t/httpstatus-conversion-to-integer/244137>\
**Category:** Kibana\
**Created:** [August 7, 2020, 8:28am UTC](https://discuss.elastic.co/t/httpstatus-conversion-to-integer/244137 "2020-08-07T08:28:09Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![graimato](https://avatars.discourse-cdn.com/v4/letter/g/9e8a1a/32.png) [@graimato](https://discuss.elastic.co/u/graimato)\
**Post date:** [August 7, 2020, 8:28am UTC](https://discuss.elastic.co/t/httpstatus-conversion-to-integer/244137/1 "2020-08-07T08:28:09Z")

</div>

Dear All,  
I created a custom filebeat 7.8.x module to load log data into Elastic .  
I created a pipeline to manage logs.  
I was able to convert datetime convert DATA into float  
But I'm trying to convert httpStatusCode into Integer but I always receive data in string format.

```auto

Pattern : req_time=%{DATA:requesttime}

```

Conversion:

```auto
{
        "convert" : {
          "field" : "requesttime",
          "type" : "float",
          "on_failure" : [
            {
                "set" : {
                   "field" : "requesttime",
                   "value": -1
                 }
            }
          ]
        }
}

```

the same approach works for other three fields.  
I tried also to convert directly in to the pattern

```auto

Pattern : req_time=%{NUMBER:requesttime:float}

```

but also this solution does not work

Any advice?  
best regards

---

<div class="post-metadata">

**Author:** ![Nathan\_Reese](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nathan_reese/32/84829_2.png) [@Nathan\_Reese](https://discuss.elastic.co/u/Nathan_Reese)\
**Post date:** [August 12, 2020, 2:55pm UTC](https://discuss.elastic.co/t/httpstatus-conversion-to-integer/244137/2 "2020-08-12T14:55:24Z")

</div>

Are these logstash configurations or ingest node configurations? Where does this `convert` function get run? Maybe ask in `logstash` or`elasticsearch` channels?

---

<div class="post-metadata">

**Author:** ![graimato](https://avatars.discourse-cdn.com/v4/letter/g/9e8a1a/32.png) [@graimato](https://discuss.elastic.co/u/graimato)\
**Post date:** [August 17, 2020, 6:28am UTC](https://discuss.elastic.co/t/httpstatus-conversion-to-integer/244137/3 "2020-08-17T06:28:01Z")

</div>

Hello  
this configuration is ingest node configuration, the conversion is into pipeline, that manage logs

---

<div class="post-metadata">

**Author:** ![Nathan\_Reese](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nathan_reese/32/84829_2.png) [@Nathan\_Reese](https://discuss.elastic.co/u/Nathan_Reese)\
**Post date:** [August 17, 2020, 11:35am UTC](https://discuss.elastic.co/t/httpstatus-conversion-to-integer/244137/4 "2020-08-17T11:35:22Z")

</div>

Can you provide a sample document?

---

<div class="post-metadata">

**Author:** ![graimato](https://avatars.discourse-cdn.com/v4/letter/g/9e8a1a/32.png) [@graimato](https://discuss.elastic.co/u/graimato)\
**Post date:** [September 11, 2020, 10:55am UTC](https://discuss.elastic.co/t/httpstatus-conversion-to-integer/244137/5 "2020-09-11T10:55:23Z")

</div>

Sorry for delay

`192.168.1.1 - [11/Sep/2020:12:16:44 +0200] "POST /room/v1/lesson?year=2020 HTTP/2.0" 200 485 "http://localhost/room/v1/search/cds;cod=0205F;DT=P0002%7C1" "Mozilla/5.0 (Linux; Android 10; SM-G973F Build/QP1A.190711.020; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/85.0.4183.101 Mobile Safari/537.36" req_time="0.011" "webapi_rooms" ua="192.168.211.105:443" us="200" uct="0.000" urt="0.008" uqt="0.000"`

---

<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:** [October 9, 2020, 10:55am UTC](https://discuss.elastic.co/t/httpstatus-conversion-to-integer/244137/6 "2020-10-09T10:55:34Z")

</div>

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