I am trying to set up a flume agent that is able to recognize two specific codes for currency: EUR or USD. I also need to keep (but not identify) any other string.
I am following a very good example. My configuration is as follows:
a.sources.s.interceptors = i
a.sources.s.interceptors.i.type = regex_extractor
a.sources.s.interceptors.i.regex = ^(EUR)|^(USD)|^(?!EUR|USD).*
a.sources.s.interceptors.i.excludeEvents = false
a.sources.s.interceptors.i.serializers = t
a.sources.s.interceptors.i.serializers.t.name = currency
a.sources.s.selector.type = multiplexing
a.sources.s.selector.header = currency
a.sources.s.selector.mapping.EUR = EUR_cnl
a.sources.s.selector.mapping.USD = USD_cnl
a.sources.s.selector.mapping.GNL = GNL_cnl
My problem is that the RegEX seems only to work for EUR or whichever is first. In fact, I am not sure if my mapping is correct for the "catch the rest" option.
Any suggestion is welcome.
Thank you.