Of course you you could (but should not) just subscribe to the /rosout topic and filter the messages by the /rosout/name and look for "goal reached" in /rosout/msg. If you do for what ever reason want to proceed with parsing the output use /rosout_agg instead of plain /rosout. /rosout_agg is published by the rosout node, subscribing directly to /rosout would connect your node to all of the nodes that publish to /rosout, which would be basically all of the running nodes.