You could've done what you did later on:

`streamsplit = msg.match[1].split " "`

Since we are assuming there will be a space between the command type and the <name> parameter.
You can then check if the first substring is equal to "stream" before passing the <name> on or setting it in some global variable. The split() later on can then be omitted, just to avoid redundancy.