Get lines that contain the same pattern twice or X times(source):
grep -E "(string.*){2}" file.log
Get lines that contain the same pattern twice or X times(source):
grep -E "(string.*){2}" file.log
tail -f out | grep --line-buffered "text"
Or:
tail -f out | stdbuf -i0 -o0 -e0 grep "text"