# Http output "Mapping" setting sends all properties as strings

**URL:** https://discuss.elastic.co/t/http-output-mapping-setting-sends-all-properties-as-strings/378309
**Category:** Logstash
**Created:** [May 19, 2025, 5:04pm UTC](https://discuss.elastic.co/t/http-output-mapping-setting-sends-all-properties-as-strings/378309 "2025-05-19T17:04:14Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![skers95](https://avatars.discourse-cdn.com/v4/letter/s/439d5e/32.png) [@skers95](https://discuss.elastic.co/u/skers95)
#### Post date: [May 19, 2025, 5:04pm UTC](https://discuss.elastic.co/t/http-output-mapping-setting-sends-all-properties-as-strings/378309/1 "2025-05-19T17:04:14Z")

</div>

Hello,

I'm on Logstash v7.17, using 'http output' plugin to send logs to third party API.

> **[Http output plugin | Logstash Reference \[7.17\] | Elastic](https://www.elastic.co/guide/en/logstash/7.17/plugins-outputs-http.html#plugins-outputs-http-mapping)**

Per third party API spec and hard requirement, "zip" POST property must be a number, otherwise API rejects it.

When I use "mapping" setting (example below), every property, including "zip", which is hardcoded as an int, still gets sent as a string.

Is there any way to send it as a number (int or float)?

```auto
output {
    http {
        url => "url.com"
        http_method => "post"
        format => "json_batch"
        codec => "json"
      
        mapping => {
            "name" => "Test User"
            "address" => "1234 Some Street"
            "zip" => 50001
        }
    }
}

```

---

<div class="post-metadata">

### Author: ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)
#### Post date: [May 19, 2025, 5:18pm UTC](https://discuss.elastic.co/t/http-output-mapping-setting-sends-all-properties-as-strings/378309/2 "2025-05-19T17:18:03Z")

</div>

> [@skers95](#):
>
> Is there any way to send it as a number (int or float)?

I don't think so. There is an [open issue](https://github.com/logstash-plugins/logstash-output-http/issues/136) about this and [another](https://github.com/logstash-plugins/logstash-output-http/issues/134) that I think says the same for booleans.

I suspect the problem will be something like [this](https://github.com/guyboertje/jrjackson/blob/8379708e06579d9b76cd3567aed0493e6a60b89b/lib/jrjackson/jrjackson.rb#L67). logstash uses JrJackson but I haven't followed through the dependencies to be certain that that is the exact code in play.

You may be able to work around it using something like

```
codec => plain
content_type => "application/json"
message => '{ "name": "%{name}", "address": "%{address}", "zip": %{zip} }'

```

---

<div class="post-metadata">

### Author: ![skers95](https://avatars.discourse-cdn.com/v4/letter/s/439d5e/32.png) [@skers95](https://discuss.elastic.co/u/skers95)
#### Post date: [May 19, 2025, 8:28pm UTC](https://discuss.elastic.co/t/http-output-mapping-setting-sends-all-properties-as-strings/378309/3 "2025-05-19T20:28:33Z")

</div>

Thank you for the suggestion and sending me in the right direction. Only needed to set `format` to `message` and now able to dictate the type using `message` option instead of `mapping` (as shown above). 🙏

> **[Http output plugin | Logstash Reference \[7.17\] | Elastic](https://www.elastic.co/guide/en/logstash/7.17/plugins-outputs-http.html#plugins-outputs-http-format)**

```auto
If message, then the body will be the result of formatting the event according to message

```
