# How to convert the apache response time in Logstash?

**URL:** <https://discuss.elastic.co/t/how-to-convert-the-apache-response-time-in-logstash/235513>\
**Category:** Logstash\
**Created:** [June 3, 2020, 10:07am UTC](https://discuss.elastic.co/t/how-to-convert-the-apache-response-time-in-logstash/235513 "2020-06-03T10:07:57Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![marco2005](https://avatars.discourse-cdn.com/v4/letter/m/b5ac83/32.png) [@marco2005](https://discuss.elastic.co/u/marco2005)\
**Post date:** [June 3, 2020, 10:07am UTC](https://discuss.elastic.co/t/how-to-convert-the-apache-response-time-in-logstash/235513/1 "2020-06-03T10:07:57Z")

</div>

I was able to parse the apache log with the response time using the below grok pattern:

```auto
filter {
            grok {
                match => [
                    "message" , "%{COMBINEDAPACHELOG}+%{GREEDYDATA:extra_fields} %{NUMBER:rt_seconds}/%{NUMBER:rt_microseconds}"
                ]
            }
            if ("&" in [request]) {
                grok {
                    match => ["request", "%{DATA:script_name}\?%{GREEDYDATA:script_kv}"]
                }
                kv {
                    source => "script_kv"
                    field_split => "&"
                    value_split => "="
                    remove_char_key => "_"
                    prefix => "query_string_"
                }
                mutate {
                    remove_field => ["request"]
                    remove_field => ["script_kv"]
                }
         }
       mutate {
                convert => ["response", "integer"]
                convert => ["bytes", "integer"]
                convert => ["rt_seconds", "integer"]
                convert => ["rt_microseconds", "integer"]
            }
}

```

When I see the type of the rt\_\*, it still shows as string ? But for response and bytes it shows as a NUMBER. How to fix it ?

---

<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 1, 2020, 10:08am UTC](https://discuss.elastic.co/t/how-to-convert-the-apache-response-time-in-logstash/235513/2 "2020-07-01T10:08:06Z")

</div>

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