# Extract only the variables from parentheses but the location is not the same

**URL:** <https://discuss.elastic.co/t/extract-only-the-variables-from-parentheses-but-the-location-is-not-the-same/177203>\
**Category:** Logstash\
**Created:** [April 17, 2019, 6:52am UTC](https://discuss.elastic.co/t/extract-only-the-variables-from-parentheses-but-the-location-is-not-the-same/177203 "2019-04-17T06:52:49Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![SilviuSS](https://avatars.discourse-cdn.com/v4/letter/s/e274bd/32.png) [@SilviuSS](https://discuss.elastic.co/u/SilviuSS)\
**Post date:** [April 17, 2019, 6:52am UTC](https://discuss.elastic.co/t/extract-only-the-variables-from-parentheses-but-the-location-is-not-the-same/177203/1 "2019-04-17T06:52:49Z")

</div>

i have a problem when I want to extract a variables from parentheses.  
my example : transactionIdentifier=0/0(016)0009/019953  
from that information i need to create a new field and contain just the information that exist in parentheses, but I don't know how to do  
the problem is i can't know at what line the information from parentheses will be start  
that entry can be in different format like  
transactionIdentifier=10/0(016)0009/019953 or  
transactionIdentifier=110/10(016)0009/019953 or  
transactionIdentifier=0/50(0016)0009/019953

---

<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:** [April 17, 2019, 12:50pm UTC](https://discuss.elastic.co/t/extract-only-the-variables-from-parentheses-but-the-location-is-not-the-same/177203/2 "2019-04-17T12:50:00Z")

</div>

For text with variable delimiters a dissect filter is a good match...

```
dissect { mapping => { "message" => "%{}(%{someField})%{}" } }
```

---

<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:** [May 15, 2019, 1:02pm UTC](https://discuss.elastic.co/t/extract-only-the-variables-from-parentheses-but-the-location-is-not-the-same/177203/3 "2019-05-15T13:02:11Z")

</div>

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