<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;">Thanks Mr. Matthew<img src="http://mail.yimg.com/us.yimg.com/i/mesg/tsmileys2/01.gif"><br><br>Cristina<br><br><br>--- On <b>Sun, 9/13/09, Matthew J. Roth <i><mroth@imminc.com></i></b> wrote:<br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"><br>From: Matthew J. Roth <mroth@imminc.com><br>Subject: Re: [asterisk-users] Queue_logs<br>To: "Asterisk Users Mailing List - Non-Commercial Discussion" <asterisk-users@lists.digium.com><br>Date: Sunday, September 13, 2009, 4:04 PM<br><br><div class="plainMail">Maria Cristina Bayno wrote:<br>> I'm here again and need your help. Regarding Queue logs in asterisk, <br>> do anyone knows how can I get all the logs for the specific/particular <br>> date? Example is I want to get all the logs from September
9-12?<br>><br>><br><br>Maria,<br><br>Here's a Bash script that will do what you're looking for. If you <br>redirect the output to a file it will only contain the queue_log records <br>in the date range from start_epoch to end_epoch. Note that it may take <br>a while to complete, depending on the size of your queue_log.<br><br>--- Start getdates_ql <br>----------------------------------------------------------<br>#!/bin/bash<br><br>start_epoch=`date -d 'Sep 9 2009 00:00:00' +'%s'`<br>end_epoch=`date -d 'Sep 12 2009 23:59:59' +'%s'`<br><br>while read line; do<br> epoch=`echo $line | cut -d '|' -f 1`<br><br> if [ $epoch -ge $start_epoch -a $epoch -le $end_epoch ]; then<br> echo $line<br> fi<br>done < /var/log/asterisk/queue_log<br><br>exit 0<br><br>--- End getdates_ql <br>------------------------------------------------------------<br><br>Regards,<br><br>Matthew
Roth<br>InterMedia Marketing Solutions<br>Software Engineer and Systems Developer<br><br><br>_______________________________________________<br>-- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com" target="_blank">http://www.api-digital.com</a> --<br><br>AstriCon 2009 - October 13 - 15 Phoenix, Arizona<br>Register Now: <a href="http://www.astricon.net" target="_blank">http://www.astricon.net</a><br><br>asterisk-users mailing list<br>To UNSUBSCRIBE or update options visit:<br> <a href="http://lists.digium.com/mailman/listinfo/asterisk-users" target="_blank">http://lists.digium.com/mailman/listinfo/asterisk-users</a><br></div></blockquote></td></tr></table><br>