str='Connected clients: 42 4 ACTIVE CLIENTS IN LAST 20 SECONDS' set -- $str clients=$3 active=$4
If it's two lines, great.
str1='Connected clients: 42' str2='4 ACTIVE CLIENTS IN LAST 20 SECONDS' set -- $str1 clients=$3 set -- $str2 active=$1
Reading two lines from a file can be done using
{ read str1; read str2; } < file
Alternatively, read and write to AWK and split the results into Bash.
eval "$(awk '/^Connected clients: / { print "clients=" $3 } /[0-9]+ ACTIVE CLIENTS/ { print "active=" $1 } ' filename)"
source share