# HOW TO PARSE OPTIONAL FIELDS ON LOGSTASH?

**URL:** <https://discuss.elastic.co/t/how-to-parse-optional-fields-on-logstash/374476>\
**Category:** Kibana\
**Tags:** elastic-stack-monitoring\
**Created:** [February 13, 2025, 6:34am UTC](https://discuss.elastic.co/t/how-to-parse-optional-fields-on-logstash/374476 "2025-02-13T06:34:14Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![kriti\_dabas](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kriti_dabas/32/118506_2.png) [@kriti\_dabas](https://discuss.elastic.co/u/kriti_dabas)\
**Post date:** [February 13, 2025, 6:34am UTC](https://discuss.elastic.co/t/how-to-parse-optional-fields-on-logstash/374476/1 "2025-02-13T06:34:14Z")

</div>

```auto
Unable to parse optional fields in dhcp lease logs.
Following is the sample of logs:-

```

```auto

lease 1.1.1.1 {
starts 4 2025/02/13 06:14:46;
ends 6 2025/03/15 06:14:46;
cltt 4 2025/02/13 06:14:46;
binding state active;
next binding state free;
rewind binding state free;
hardware ethernet 72:sd:0l:13:07:d0;
uid "\1\1\1\1\1";
set vendor-class-identifier = "ODFT 5.0";
client-hostname "DESKTOP-V9HOIFB";
}

lease 1.1.1.1 {
starts 2 2024/12/17 10:39:41;
ends 4 2025/01/16 10:39:41;
tstp 4 2025/01/16 10:39:41;
cltt 2 2024/12/17 10:39:41;
binding state active;
next binding state free;
rewind binding state free;
hardware ethernet 72:sd:0l:13:07:d0;
uid "\1\1\1\1\1";
client-hostname "DESKTOP-V9HOIFB";
}

`Fields like tstp/next/rewind/client-hostname/set vendor-class-identifier are optional sometimes they come sometimes they don't.`
```
