Grep yesterday logs from weblogic logs

Hi,

I am trying to write a script which would go search and get the info from the logs based on yesterday timestamp and write yesterday logs in new file. The log file format is as follows:
""""""""""""""""""""""""""
ontent&paf_ps=_st_800005%3Dnormal%26_ac_800005%3Dac%26_pid%3D800005%26_md_800005%3Dview&prefixBoUrl=/WinVision/action/readMessageFromSearch.do&expanded-path=messages&idMessage=2740"
**** debug Tue Nov 04 11:09:02 MET 2008 1225793342478 /atosorigin/api12portlet/API12ProxyProvider url found : /WinVision/webvision-views/images/star.gif"
**** debug Tue Nov 04 11:09:02 MET 2008 1225793342479 /atosorigin/api12portlet/API12ProxyProvider url Ignored
**** debug Tue Nov 04 11:09:02 MET 2008 1225793342479 /atosorigin/api12portlet/API12ProxyProvider url found : /WinVision/webvision-views/images/star.gif"
**** debug Tue Nov 04 11:09:02 MET 2008 1225793342479 /atosorigin/api12portlet/API12ProxyProvider url Ignored
**** debug Tue Nov 04 11:09:02 MET 2008 1225793342479 /atosorigin/api12portlet/API12ProxyProvider url found : /WinVision/webvision-views/images/star.gif"
**** debug Tue Nov 04 11:09:02 MET 2008 1225793342479 /atosorigin/api12portlet/API12ProxyProvider url Ignored
**** debug Tue Nov 04 11:09:02 MET 2008 1225793342479 /atosorigin/api12portlet/API12ProxyProvider url found : /WinVision/webvision-views/images/star.gif"
**** debug Tue Nov 04 11:09:02 MET 2008 1225793342480 /atosorigin/api12portlet/API12ProxyProvider url Ignored
**** debug Tue Nov 04 11:09:02 MET 2008 1225793342480 /atosorigin/api12portlet/API12ProxyProvider url found : /WinVision/action/readMessageFromSearch.do?expanded-path=messages&idMessage=2740"
**** debug Tue Nov 04 11:09:02 MET 2008 1225793342481 /atosorigin/api12portlet/API12ProxyProvider modified url : /winportal/MSS/home?paf_portalId=default&paf_communityId=100001&paf_pageId=400001&paf_dm=shared&paf_gear_id=800005&paf_gm=content&paf_ps=_st_800005%3Dnormal%26_ac_800005%3Dac%26_pid%3D800005%26_md_800005%3Dview&prefixBoUrl=/WinVision/action/readMessageFromSearch.do&expanded-path=messages&idMessage=2740"
**** debug Tue Nov 04 11:09:02 MET 2008 1225793342482 /atosorigin/api12portlet/API12ProxyProvider Function modifyContentUrls - End
**** info Tue Nov 04 11:09:02 MET 2008 1225793342482 /atosorigin/api12portlet/portletClass set Portlet HTML content in request for display
**** debug Tue Nov 04 11:09:02 MET 2008 1225793342482 /atosorigin/api12portlet/portletClass page Help url (sent to droplet) : /null
**** debug Tue Nov 04 11:09:02 MET 2008 1225793342482 /atosorigin/api12portlet/portletClass Lancement du dispatcher sur /index.jsp
"""""""""""""""""""""""""""""""""""""""""""""""""

The timestamp format in the logs is as follows "Tue Nov 04 11:09:44 MET 2008"

Have a look into http://www.unix.com/answers-frequently-asked-questions/13785-yesterdays-date-date-arithmetic.html to get a pattern you can grep. Also please use [ code ] [ /code ] tags to display code, logs, etc.

Hi zaxxon,

thanks for your reply.

Right now i am using following funtion for yesterday date:

today=`date +%Y%m%d`
yesterday=`expr $today - 1`
echo $yesterday
20081103

The output is comming in YYYYMMDD format.So my problem is that i m not able to convert this format in "Tue Nov 04 11:27:30 MET 2008" which is mentioned in log file.

I just read the thread about this example - it is no good solution since when you have 1.12.2008 for example, it will show 20081200 which is good for nothing. Even 2 days before that date, you get something like 20081199 which is useless too.
I would go with one of the perl solutions or with this one:

YESTERDAY=`TZ=GMT+24 date "+%Y%m%d"`
echo ${YESTERDAY}