# Logstash-codec-avro parsing wrong values

**URL:** https://discuss.elastic.co/t/logstash-codec-avro-parsing-wrong-values/190246
**Category:** Logstash
**Created:** [July 12, 2019, 1:25pm UTC](https://discuss.elastic.co/t/logstash-codec-avro-parsing-wrong-values/190246 "2019-07-12T13:25:04Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Stepan\_Urban](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stepan_urban/32/46350_2.png) [@Stepan\_Urban](https://discuss.elastic.co/u/Stepan_Urban)
#### Post date: [July 12, 2019, 1:25pm UTC](https://discuss.elastic.co/t/logstash-codec-avro-parsing-wrong-values/190246/1 "2019-07-12T13:25:04Z")

</div>

Hi,  
I'm writing AVRO data to Kafka and then using logstash to put them into Elasticsearch. But all float values printed by logstash are wrong. To Kafka I'm sending following record

```
ProducerRecord(topic=weather, partition=0, headers=RecordHeaders(headers = [], isReadOnly = true), key=BN, value={"Temperature": 20.49, "Humidity": 56.0, "Pressure": 1011.0, "Wind": 1.0, "Cloudiness": 75.0}, timestamp=1562936770006)

```

In Kafka it is stored properly but logstash console output is

```
{
   "@version" => "1",
   "Pressure" => 23.718717575073242,
 "Cloudiness" => -0.09371757507324219,
       "Wind" => 56.0,
 "@timestamp" => 2019-07-12T13:06:10.012Z,
"Temperature" => 0.0,
"Humidity" => -0.09371758997440338
}

```

My logstash file is

```
input {
kafka {
codec => avro {
    	schema_uri => "./weather.avsc"
	}
    bootstrap_servers => "localhost:9092"
    topics => ["weather"]
}
}

output {
elasticsearch {
  hosts => ["localhost:9200"]
  index => "weather"
  workers => 1
}
stdout {}
}

```

and my schema weather.avsc

```
{
"namespace": "weather",
"type": "record",
"name": "WeatherMessage",
"fields": [
	{
		"name": "Temperature",
		"type": "float"
	},
	{
		"name": "Humidity",
		"type": "float"
	},
	{
		"name": "Pressure",
		"type": "float"
	},
	{
		"name": "Wind",
		"type": "float"
	},
	{
		"name": "Cloudiness",
		"type": "float"
	}
]
}

```

I'm using logstash 7.2. and io.confluent:kafka-avro-serializer:3.3.3 and 'org.apache.avro', name: 'avro-tools', version: '1.9.0'  
Can you please give me some hits whats wrong and how to repair 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: [August 9, 2019, 1:25pm UTC](https://discuss.elastic.co/t/logstash-codec-avro-parsing-wrong-values/190246/2 "2019-08-09T13:25:06Z")

</div>

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