Use the --foreground with timeout :
timeout --foreground 12s tail -f access.log | wc -l
According to man timeout :
--foreground when not running timeout directly from a shell prompt, allow COMMAND to read from the TTY and get TTY signals; in this mode, children of COMMAND will not be timed out
source share