You have to clear the expect buffer after your commands if you don't want
their output. e.g.
send -- "$passwd\r"
expect -re "$passwd.*"prompt regex here" $"
set count 20 ....
send "readlog\r";
expect "readlog\r\n";
expect -re "output regex here"
You have to be careful with the regexs. Remember they are greedy by
default, which can sometimes match more than you want. Use the
'exp_internal 1' command at your regex; I find it useful to debug regex's.