A script for converting raid configuration log messages to ChangeLog files. ....

hi to all
am new to shell scripting..itz very urgent.

when i excuting the command metastat(raid configuration info) it will display some information.
#metastat
d1:submirror
status: okey
pass:1

d2:submirror
staus:okey

d3:submirror
staus:error

if staus is okey.no problem.once i will get any status is error,it will go to any other file.i want that type of script.
now just i want this error message will send to any anotherfile(our requirement file.u take any file..)
please itz very urgent..
Thankyou.