# Avro data format convert into json format

**URL:** https://discuss.elastic.co/t/avro-data-format-convert-into-json-format/116873
**Category:** Beats
**Created:** [January 24, 2018, 1:26pm UTC](https://discuss.elastic.co/t/avro-data-format-convert-into-json-format/116873 "2018-01-24T13:26:37Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![vamsikrishna](https://avatars.discourse-cdn.com/v4/letter/v/5e9695/32.png) [@vamsikrishna](https://discuss.elastic.co/u/vamsikrishna)
#### Post date: [January 24, 2018, 1:26pm UTC](https://discuss.elastic.co/t/avro-data-format-convert-into-json-format/116873/1 "2018-01-24T13:26:37Z")

</div>

Hiii,

The data comming from kafka by using kafkastream s ,It s avro format then i will try to convert json but it s not work,Please can help me

---

<div class="post-metadata">

### Author: ![andrewkroh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/andrewkroh/32/3784_2.png) [@andrewkroh](https://discuss.elastic.co/u/andrewkroh)
#### Post date: [January 25, 2018, 5:32pm UTC](https://discuss.elastic.co/t/avro-data-format-convert-into-json-format/116873/2 "2018-01-25T17:32:25Z")

</div>

You can pull Avro data from Kafka using Logstash.

```auto
input {
  kafka {
    codec => avro {
        schema_uri => "/tmp/schema.avsc"
    }
  }
}

```

Reference: [https://www.elastic.co/guide/en/logstash/current/plugins-codecs-avro.html](https://www.elastic.co/guide/en/logstash/current/plugins-codecs-avro.html)

---

<div class="post-metadata">

### Author: ![vamsikrishna](https://avatars.discourse-cdn.com/v4/letter/v/5e9695/32.png) [@vamsikrishna](https://discuss.elastic.co/u/vamsikrishna)
#### Post date: [January 25, 2018, 5:48pm UTC](https://discuss.elastic.co/t/avro-data-format-convert-into-json-format/116873/3 "2018-01-25T17:48:04Z")

</div>

Yeah but affter getting the avro data from kafka i need to convert json then again push into kafka,  
i have trying converting json but when i reading binary (avro) data by using GenaricDatumReader it throws ArrayIndexOutOf BoudnceException,

Thank you ,

---

<div class="post-metadata">

### Author: ![andrewkroh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/andrewkroh/32/3784_2.png) [@andrewkroh](https://discuss.elastic.co/u/andrewkroh)
#### Post date: [January 25, 2018, 7:48pm UTC](https://discuss.elastic.co/t/avro-data-format-convert-into-json-format/116873/4 "2018-01-25T19:48:44Z")

</div>

> [@vamsikrishna](#):
>
> i have trying converting json but when i reading binary (avro) data by using GenaricDatumReader it throws ArrayIndexOutOf BoudnceException,

Please clarify where you are seeing this error. Is this an error you are seeing with Logstash?

> [@vamsikrishna](#):
>
> Please can help me

What specifically do you want help with?

---

<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: [February 21, 2018, 1:27pm UTC](https://discuss.elastic.co/t/avro-data-format-convert-into-json-format/116873/5 "2018-02-21T13:27:01Z")

</div>

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