Thanks Mr. Matthew Cristina
--- On Sun, 9/13/09, Matthew J. Roth <[email protected]> wrote: From: Matthew J. Roth <[email protected]> Subject: Re: [asterisk-users] Queue_logs To: "Asterisk Users Mailing List - Non-Commercial Discussion" <[email protected]> Date: Sunday, September 13, 2009, 4:04 PM Maria Cristina Bayno wrote: > I'm here again and need your help. Regarding Queue logs in asterisk, > do anyone knows how can I get all the logs for the specific/particular > date? Example is I want to get all the logs from September 9-12? > > Maria, Here's a Bash script that will do what you're looking for. If you redirect the output to a file it will only contain the queue_log records in the date range from start_epoch to end_epoch. Note that it may take a while to complete, depending on the size of your queue_log. --- Start getdates_ql ---------------------------------------------------------- #!/bin/bash start_epoch=`date -d 'Sep 9 2009 00:00:00' +'%s'` end_epoch=`date -d 'Sep 12 2009 23:59:59' +'%s'` while read line; do epoch=`echo $line | cut -d '|' -f 1` if [ $epoch -ge $start_epoch -a $epoch -le $end_epoch ]; then echo $line fi done < /var/log/asterisk/queue_log exit 0 --- End getdates_ql ------------------------------------------------------------ Regards, Matthew Roth InterMedia Marketing Solutions Software Engineer and Systems Developer _______________________________________________ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- AstriCon 2009 - October 13 - 15 Phoenix, Arizona Register Now: http://www.astricon.net asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
_______________________________________________ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- AstriCon 2009 - October 13 - 15 Phoenix, Arizona Register Now: http://www.astricon.net asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
