How to get the before and after logs lines for a search pattern string similar to grep -A -B

I would like to check whether logql supports similar to grep functionality of grep -A10 -B10 “String pattern”
Because if i search for a “Error” keyword in logs i get to see just error matching lines but to debug and troubleshoot i want to see before and after log lines of matching keyword.
Is there a workaround to do this?