# Grok for values with and without '%' eg: 10, 10%

**URL:** <https://discuss.elastic.co/t/grok-for-values-with-and-without-eg-10-10/98293>\
**Category:** Logstash\
**Created:** [August 24, 2017, 9:37pm UTC](https://discuss.elastic.co/t/grok-for-values-with-and-without-eg-10-10/98293 "2017-08-24T21:37:25Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![vreddy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vreddy/32/20776_2.png) [@vreddy](https://discuss.elastic.co/u/vreddy)\
**Post date:** [August 24, 2017, 9:37pm UTC](https://discuss.elastic.co/t/grok-for-values-with-and-without-eg-10-10/98293/1 "2017-08-24T21:37:25Z")

</div>

Hi,

I have tried the following but it did not work:  
"dedupSavings" =\> "(?m)%{NUMBER:dedup\_savings:float}[^%]"

For instance, (.\*[^%]) -\> regex outputs 10 for 10 or 10%. But above one is not. It works fine for data with dedupSavings=10% but not for dedupSavings=10.  
I might be missing something here, any help is appreciated.

---

<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:** [August 25, 2017, 5:13am UTC](https://discuss.elastic.co/t/grok-for-values-with-and-without-eg-10-10/98293/2 "2017-08-25T05:13:53Z")

</div>

`[^%]` means "any character except %" which doesn't seem like what you're looking for. You should probably use `%?` ("zero or one occurrences of %") instead.

---

<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:** [September 22, 2017, 5:14am UTC](https://discuss.elastic.co/t/grok-for-values-with-and-without-eg-10-10/98293/3 "2017-09-22T05:14:00Z")

</div>

Closed on September 22, 2017, 5:14am UTC

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