Finds occurrences of SEARCHTERM in data.log and gives you the ten characters on either side. Like grep’s -B and -A but for characters instead of lines.
-B
-A
rg -oN '.{0,10}SEARCHTERM.{0,10}' data.log
-o, –only-matching
-N, –no-line-number