I'm trying to use PaperTrail's filter logs tool to filter out specific paths using RegEx. My log string could look like one of the below:
Should NOT pass and NOT be logged
Sep 03 10:12:40 lastmingear heroku/router: at=info method=GET path="/orders/SOME_ID?key=USER_KEY" host=www.lastmingear.com...
Should PASS, and BE logged
Sep 03 10:12:40 lastmingear heroku/router: at=info method=GET path="/orders/SOME_ID?key=USER_KEY&log=true" host=www.lastmingear.com...
The only difference is that the path where I want it to BE logged has an additional params log=true
. So the RegEx statement should read verbally, like:
IF a
key=USER_KEY
is provided, then do NOT pass into logs UNLESS there is also alog=true