HttpStatus conversion to integer

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.


Pattern :  req_time=%{DATA:requesttime}

Conversion:

{
        "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


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

but also this solution does not work

Any advice?
best regards

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

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

Can you provide a sample document?

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"

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