# Oracle listener regexp/grok pattern help

**URL:** <https://discuss.elastic.co/t/oracle-listener-regexp-grok-pattern-help/67886>\
**Category:** Logstash\
**Created:** [December 2, 2016, 5:45pm UTC](https://discuss.elastic.co/t/oracle-listener-regexp-grok-pattern-help/67886 "2016-12-02T17:45:43Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![FrankC](https://avatars.discourse-cdn.com/v4/letter/f/ed655f/32.png) [@FrankC](https://discuss.elastic.co/u/FrankC)\
**Post date:** [December 2, 2016, 5:45pm UTC](https://discuss.elastic.co/t/oracle-listener-regexp-grok-pattern-help/67886/1 "2016-12-02T17:45:43Z")

</div>

Hi,

1. I need to get oracle listener logs loaded using LS. I was able to extract the timestamp and replace the LS @timestamp successfully as well as some other info.  
I am fairly new to regexp/grok, but came across this pattern. It appears to be working as it creates program, user, ip\_client fields in ES, but I want to better understand how this works.

Mock-up of a listener event:  
02-DEC-2016 01:01:01 \* (CONNECT\_DATA=(SID=xyz)(CID=(PROGRAM=someprogram)(HOST=somehost)(USER=someone))) \* (ADDRESS=(PROTOCOL=tcp)(HOST=0.0.0.0)(PORT=000)) \* establish \* somehost \* 0

grok {  
match =\> ["lsnr\_message","^._PROGRAM=(?._?))._USER=(?._?)).\*ADDRESS._HOST=(?\<ip\_client\>%{IP})._$"]  
}

1. One thing I noticed during testing is that sometimes I see (PROGRAM=). I get a grok parse failure. Is there a way to modify this pattern to have it as optional?

Frank

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [December 7, 2016, 6:40am UTC](https://discuss.elastic.co/t/oracle-listener-regexp-grok-pattern-help/67886/2 "2016-12-07T06:40:54Z")

</div>

Please mark your grok expression as preformatted text so it isn't mangled. If you read your expression as posted above you'll notice that there are pieces missing.

---

<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:** [January 4, 2017, 6:41am UTC](https://discuss.elastic.co/t/oracle-listener-regexp-grok-pattern-help/67886/3 "2017-01-04T06:41:43Z")

</div>

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