Hi all,
My sample file is something like this,
ORA-00206: Message 206 not found; product=RDBMS; facility=ORA
ORA-00202: Message 202 not found; product=RDBMS; facility=ORA
ORA-27063: Message 27063 not found; product=RDBMS; facility=ORA
ORA-00206: Message 206 not found; product=RDBMS; facility=ORA
ORA-27063: Message 27063 not found; product=RDBMS; facility=ORA
ORA-00221: Message 221 not found; product=RDBMS; facility=ORA
I want to filter "ORA" codes (Ex: ORA-00206,ORA-00202..) and the other part in that line seperately.Then put ORA code part in to mail subject and other part in the mail subject and send mail for each line seperately.I want to do this for that file every hour.I have write script for that(ecept the every one hour part), with that I can do put the ORA code part to subject line but can't put the other part to the body of the mail.Please go thorough with my code and help me to do this.
awk '/ORA/ { print $0 }' awk1.log > new
a=0
while read LINE
do a=$(($a+1));
awk '/ORA-/ { print $0 }' new | cut -c -10 > new1
awk '/ORA-/ { print $0 }' new | cut -d ":" -f 2- new > new2
mail -s $LINE -r sj@xxxx.com sj@xxxx.com < /home/sss/new2
echo $LINE;
done < new
echo "Final line count is: $a";
*** awk1.log is my original file and I grep only ORA line to 'new' file,then grep only ORA codes to 'new1' and other part to 'new2'.
*** I need grep code to grep awk1.log to 'new' every one hour.