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


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.

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

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