Piping echo into a command just to give it text is something I avoid.
IFS=@ read -r user host <<< "jordi@nas"
grep -c error <<< "$log_text"
<<< passes a string as standard input and adds a trailing newline. read splits on whitespace by default, so IFS=@ in front of it splits on the at sign for that one command. Unlike echo "$x" | read a b, read runs in the current shell, so the variables stay set. It is a bash, zsh and ksh feature and not part of POSIX sh. For several lines, use a here-document with <<'EOF'.
Further reading: Bash manual: Here Strings