# Optional field does not work

**URL:** <https://discuss.elastic.co/t/optional-field-does-not-work/118096>\
**Category:** Logstash\
**Created:** [February 1, 2018, 7:52pm UTC](https://discuss.elastic.co/t/optional-field-does-not-work/118096 "2018-02-01T19:52:43Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![robertchen117](https://avatars.discourse-cdn.com/v4/letter/r/edb3f5/32.png) [@robertchen117](https://discuss.elastic.co/u/robertchen117)\
**Post date:** [February 1, 2018, 7:52pm UTC](https://discuss.elastic.co/t/optional-field-does-not-work/118096/1 "2018-02-01T19:52:44Z")

</div>

2018-01-23 11:13:05,965 [ajp-nio-8009-exec-4] INFO com.paymentus.rotp.rt.SessionManager - Request[26788], [Path: /rotp/abcd, RCID: 8065666700, USR: Consumer, GID: 0, CID: 805454546700, SID: 55EC7FA9E622B9233FBC0A687DC40375.uat\_be-kkp07]

%{TIMESTAMP\_ISO8601:timestamp}%{SPACE}[%{NOTSPACE:worker}]%{SPACE}%{WORD:level}\s+%{NOTSPACE:javaclass}(._)((?:Path:\s+(?([^,]_))),\s+)?

the Path: /rotp/abcd may exist or not. I tried to use ((?:Path:\s+(?([^,]\*))),\s+)? for optional field, but it does not work, anyone know how to do it? Thanks.

---

<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:** [March 1, 2018, 7:53pm UTC](https://discuss.elastic.co/t/optional-field-does-not-work/118096/2 "2018-03-01T19:53:11Z")

</div>

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