private Func <LogEvent, bool>?PerformMessageLikeFilter(string filterExpression) { var filterSearch = $"@Message like '%{SerilogExpression.EscapeLikeExpressionContent(filterExpression)}%'"; if (SerilogExpression.TryCompile(filterSearch, out CompiledExpression? compiled, out var error)) { // `compiled` is a function that can be executed against `LogEvent`s: return(evt => { LogEventPropertyValue?result = compiled(evt); return ExpressionResult.IsTrue(result); }); } return(null); }