how to change regexp captured group conditionally

12 views
Skip to first unread message

tagp...@gmail.com

unread,
Feb 21, 2018, 10:59:49 AM2/21/18
to Fluentd Google Group
Hello,
I have a regular experission and it works perfectly.
https://regex101.com/r/wFuL72/5
In this regexp I have a "sevierity" group. it's value should be one of I,E,W,F,....
I would like to map this values in following way:
STATES = {
 
"I"  => "INFO",
 
"E" => "ERROR",
 
"W"  => "WARNING",
 
"D" => "DEBUG",
 
"T"  => "TRACE",
 
"F" => "FATAL"
}

and replace the maped value with regex captured single character one.

Plaes guide me.

Reply all
Reply to author
Forward
0 new messages