# Trouble with Greedydata being a bit too greedy

**URL:** <https://discuss.elastic.co/t/trouble-with-greedydata-being-a-bit-too-greedy/76799>\
**Category:** Logstash\
**Created:** [February 28, 2017, 2:48pm UTC](https://discuss.elastic.co/t/trouble-with-greedydata-being-a-bit-too-greedy/76799 "2017-02-28T14:48:25Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mark\_Dolan](https://avatars.discourse-cdn.com/v4/letter/m/bbce88/32.png) [@Mark\_Dolan](https://discuss.elastic.co/u/Mark_Dolan)\
**Post date:** [February 28, 2017, 2:48pm UTC](https://discuss.elastic.co/t/trouble-with-greedydata-being-a-bit-too-greedy/76799/1 "2017-02-28T14:48:25Z")

</div>

I have some log lines that sometimes have a description appended, in the "Details: bla bla bla" string.

The first and third lines have it here:

```
Naam: St Nationaal Epilepsie Fon ds/ de Macht Vh Kleine Machtiging: MBOA-652563-1 Details: Incasso januari donatie IBAN: NL83INGB0000222111 Kenmerk: 5920010020375704                       
Naam: LE EITHNE           
Naam: DOMINOS NL BY ADYEN Details: 4314566010481582 0 030001485229518 Dominos Pizza Kenmerk: 27-02-2016 20:24 003000 1485229518                      
Naam: Clark Kent 121 Fake street, bla bla black sheep, north pole

```

I want to extract the Details into its own field using a capture group with an optional ()?.

```
CREDITOR_NAME %{GREEDYDATA}
DESCRIPTION %{GREEDYDATA}
LOGLINE Naam: %{CREDITOR_NAME:CreditorName}%{SPACE}(Details: %{DESCRIPTION:Description})?

```

If I make it optional however it doesn't work, the previous **CreditorName** eats all the remainder of the line. If I make it mandatory it only works for those lines that have Details, the other fail.

I've tried a bunch of variations, including using non-greedy DATA but nothing seems to work.

Any pointers would be greatly appreciated!

---

<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 28, 2017, 2:48pm UTC](https://discuss.elastic.co/t/trouble-with-greedydata-being-a-bit-too-greedy/76799/2 "2017-03-28T14:48:40Z")

</div>

Closed on March 28, 2017, 2:48pm UTC

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