mtail icon indicating copy to clipboard operation
mtail copied to clipboard

Can't chain two matches in same expression because they define the same caprefs

Open jaqx0r opened this issue 7 years ago • 0 comments

Expressions like:

getfilename() =~ "abc.log" && /expression/ {

are illegale bcause =~ abc.log and expression both cause capture group 0 to be inserted into the current scope, throwing a compile error.

To work around it, put the expression in an inner block like so:

getfilename)( =~ "abc.log" {
  /expression/ {
...

jaqx0r avatar Nov 08 '18 10:11 jaqx0r