Find all files ending with .log in the current directory, take the first random number of lines from the result and search for the word "ERROR" in those lines.
find ~ -name '*.log' | head -n $(awk 'BEGIN {srand(); print int(rand()*1000)}') | xargs grep 'ERROR'