logstash-filter-translate icon indicating copy to clipboard operation
logstash-filter-translate copied to clipboard

Add feature to treat source as regexp

Open jsvd opened this issue 9 years ago • 2 comments

currently is possible to use :regex => true to treat dictionary keys as regexp, but would be nice to have the opposite: use contents of source as regexp that will match against exact dictionary keys

jsvd avatar Dec 23 '15 15:12 jsvd

@jsvd got an example use case in mind?

jordansissel avatar Dec 28 '15 20:12 jordansissel

the use case came from a user that had a dictionary of postal codes to locations but sometimes the data from events wasn't very precise and the idea was to match the closest.

Example

dictionary:

10LX145: Lisbon
15OP141: Porto

an event arrives with field: "pcode" => "10LX14"

There's no way to match the code 10LX14 with 10LX145

with this feature /10LX14/ would match 10LX145

jsvd avatar Dec 29 '15 16:12 jsvd