# Logstash http output to Kafka-REST-Proxy

**URL:** <https://discuss.elastic.co/t/logstash-http-output-to-kafka-rest-proxy/64930>\
**Category:** Logstash\
**Created:** [November 3, 2016, 6:10pm UTC](https://discuss.elastic.co/t/logstash-http-output-to-kafka-rest-proxy/64930 "2016-11-03T18:10:57Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Olivier\_Girardot](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/olivier_girardot/32/2440_2.png) [@Olivier\_Girardot](https://discuss.elastic.co/u/Olivier_Girardot)\
**Post date:** [November 3, 2016, 6:10pm UTC](https://discuss.elastic.co/t/logstash-http-output-to-kafka-rest-proxy/64930/1 "2016-11-03T18:10:57Z")

</div>

Hi everyone,  
I know there's a kafka output plugin for logstash but I'd like to use Confluent's REST proxy to push it to kafka. But according to the documentation [http://docs.confluent.io/3.0.0/kafka-rest/docs/intro.html#produce-and-consume-json-messages](http://docs.confluent.io/3.0.0/kafka-rest/docs/intro.html#produce-and-consume-json-messages) I'd need to wrap the json messages like that :

```auto
{
   records: [ {
     value: {<-- my json document here ---> }
, ...]
} 

```

Is there any filter that would allow me to do so ? or do I need to write another plugin ?  
The "mapping" part of the http output plugin would seem to be useful for that, but I did not find that many examples on how to use it to take "all of the document" and put it inside records[].value.

Thank you for your time.

---

<div class="post-metadata">

**Author:** ![jsvd](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jsvd/32/6203_2.png) [@jsvd](https://discuss.elastic.co/u/jsvd)\
**Post date:** [November 4, 2016, 2:32pm UTC](https://discuss.elastic.co/t/logstash-http-output-to-kafka-rest-proxy/64930/2 "2016-11-04T14:32:54Z")

</div>

do you need to embed the json document or the data structure, into a nested object and then serialize the whole object?

do you actually need like you say:

```auto
{
   records: [ {
     value: {<-- my json document here ---> }
, ...]
}

```

OR

```auto
{
   records: [ {
     value: {<-- nested object here ---> }
, ...]
}

```

And then convert the whole thing to JSON? My question with the first option is that, if the value already has a json document, it will be escaped again, and I assume you simple want to nest an object into a `{ records: [{ value: object }] }` structure?

---

<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 6, 2017, 4:31am UTC](https://discuss.elastic.co/t/logstash-http-output-to-kafka-rest-proxy/64930/3 "2017-07-06T04:31:03Z")

</div>


