Using regex in UI for Log Format field in order to filter log content


#1

Is it possible to embed a VCL regex into the “Log Format” field in the UI in order to strip out content from a field.

For example, can I create an entry such as

“%t”,"%{req.http.Cookie}V","%{resp.http.Set-Cookie}V","%{regsub(req.postbody, "da_password_field=.* “,“PASSWD”)}V”

It passed the validation and looked fine in the VCL, but I stopped getting content into my S3 logs and before I stressfully debug this I wanted to verify that it is kosher to embed the regex like this without doing Custom VCL for logging.


#2

Based on some testing, it looks like this works. In case anyone else stumbles across this they will have some validation that this works if you have the proper syntax.