# Parse customer name

**URL:** <https://discuss.elastic.co/t/parse-customer-name/203556>\
**Category:** Logstash\
**Created:** [October 15, 2019, 3:41am UTC](https://discuss.elastic.co/t/parse-customer-name/203556 "2019-10-15T03:41:32Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![sud0](https://avatars.discourse-cdn.com/v4/letter/s/e5b9ba/32.png) [@sud0](https://discuss.elastic.co/u/sud0)\
**Post date:** [October 15, 2019, 3:41am UTC](https://discuss.elastic.co/t/parse-customer-name/203556/1 "2019-10-15T03:41:33Z")

</div>

Hi.

I need to parse the customer name, but there are cases when the customer name has one, two or even three words.

Example 1: Customer name with 3 words

`INFO 2019-10-15 16:34:41,964 transaction.TransactionDocumentPersisterImpl - Transaction chassisCheckPlusRedbook bda19842 | id: 1938978 timestamp: 2019-10-15T16:34:41.000+13:00 user: Luke test name (13756439) request address: 8.8.8.8 login id: 193897`

Example 2: Customer name with 2 words

`INFO 2019-10-15 16:34:41,964 transaction.TransactionDocumentPersisterImpl - Transaction chassisCheckPlusRedbook bda19842 | id: 1938978 timestamp: 2019-10-15T16:34:41.000+13:00 user: Luke test (13756439) request address: 8.8.8.8 login id: 193897`

Using the option `NOTSPACE` works.. but only for the times specified.

`timestamp: %{TIMESTAMP_ISO8601:timestamp} user: %{NOTSPACE:customer} %{NOTSPACE:customer} %{NOTSPACE:customer} \(%{NUMBER:customer-id:int}\)`

The above string will only work when the customer name has 3 words.

How can I have something smart enough that, everything between `user:` and `\(%{NUMBER:customer-id:int}\)` is the customer name?

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [October 15, 2019, 2:17pm UTC](https://discuss.elastic.co/t/parse-customer-name/203556/2 "2019-10-15T14:17:51Z")

</div>

You could use

```
(?<customer>[a-zA-Z]+)
```

---

<div class="post-metadata">

**Author:** ![sud0](https://avatars.discourse-cdn.com/v4/letter/s/e5b9ba/32.png) [@sud0](https://discuss.elastic.co/u/sud0)\
**Post date:** [October 15, 2019, 9:26pm UTC](https://discuss.elastic.co/t/parse-customer-name/203556/3 "2019-10-15T21:26:59Z")

</div>

> [@Badger](#):
>
> (?[a-zA-Z]+)

That works! Thank you

---

<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:** [November 12, 2019, 9:27pm UTC](https://discuss.elastic.co/t/parse-customer-name/203556/4 "2019-11-12T21:27:05Z")

</div>

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