# Logstash crashes when kafka producer sends less fields than excepted

**URL:** <https://discuss.elastic.co/t/logstash-crashes-when-kafka-producer-sends-less-fields-than-excepted/299475>\
**Category:** Logstash\
**Created:** [March 11, 2022, 3:48pm UTC](https://discuss.elastic.co/t/logstash-crashes-when-kafka-producer-sends-less-fields-than-excepted/299475 "2022-03-11T15:48:15Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![guriv](https://avatars.discourse-cdn.com/v4/letter/g/f08c70/32.png) [@guriv](https://discuss.elastic.co/u/guriv)\
**Post date:** [March 11, 2022, 3:48pm UTC](https://discuss.elastic.co/t/logstash-crashes-when-kafka-producer-sends-less-fields-than-excepted/299475/1 "2022-03-11T15:48:15Z")

</div>

Hello  
we are using logstash-kafka-integration plugin to read messages from a kafka topic using avro encoding  
If my logstash consumer refers to a schema registry file that defines 2 optional fields but receive a message containing only one of these optional fields, logstash crashes  
I would expect logstash to ignore the missing field (or, at least put null value in Elasticsearch)  
Am i mis-understaning something ?

You will find a really simple example here :

Producer schema registry file

```auto
{
  "namespace": "fr.myorg.kafka.test",
  "type": "record",
  "name": "BasicTrace",
  "fields": [
    { "name": "id", "type": "string"}
  ]
}

```

Consumer schema registry file (logstash)

```auto
{
  "namespace": "fr.myorg.kafka.test",
  "type": "record",
  "name": "BasicTrace",
  "fields": [
    { "name": "id", "type": "string"},
    {"name": "testOpt", "type": ["null", "string"], "default":null}
  ]
}

```

---

<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:** [April 8, 2022, 3:48pm UTC](https://discuss.elastic.co/t/logstash-crashes-when-kafka-producer-sends-less-fields-than-excepted/299475/2 "2022-04-08T15:48:36Z")

</div>

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