% grep -B 2 pattern *.log > outfile