[Rt-devel] [rt-users] need some explanation on rt.log data

Asif Iqbal vadud3 at gmail.com
Wed Jul 14 11:55:11 EDT 2010


On Wed, Jul 14, 2010 at 11:43 AM, Asif Iqbal <vadud3 at gmail.com> wrote:
> On Fri, Jul 9, 2010 at 9:08 PM, Asif Iqbal <vadud3 at gmail.com> wrote:
>> On Fri, Jul 9, 2010 at 8:05 PM, Ruslan Zakirov <ruz at bestpractical.com> wrote:
>>> Asif,
>>>
>>> It's message id generated by RT or message id of an incomming mail.
>>
>> It looks like this message id is made out of few components like
>> rt version, epoch time, ticket id, scrip id and few other numbers
>> with `-' or `.' separated. So rest of the components are just random
>> numbers to compile the message id?
>>
>> what part of rt code generates that? is it possible to add the transaction
>> id (trxID) in it too like below before sending it to rt.log. it will
>> help us to audit/track
>> activity of tickets right from the log.
>>
>> rt-3.8.2-16815-1278696300-880.767036-trxID-185-0 at rt.example.net
>>
>> so the format would be, to somewhat generalize
>>
>> rt-versionid-randomid-epoch-randomid.ticketid-transactionid-scripid-always0 at fqdn
>
> How do I modify this section of the file /opt/rt3/lib/RT/Action/SendEmail.pm
>
> sub SendMessage {
>
>    # DO NOT SHIFT @_ in this subroutine.  It breaks Hook::LexWrap's
>    # ability to pass @_ to a 'post' routine.
>    my ( $self, $MIMEObj ) = @_;
>
>    my $msgid = $MIMEObj->head->get('Message-ID');
>    chomp $msgid;
>
>    $self->ScripActionObj->{_Message_ID}++;
>
>    $RT::Logger->info( $msgid . " #"
>            . $self->TicketObj->id . "/"
>            . $self->TransactionObj->id
>            . " - Scrip "
>            . ($self->ScripObj->id || '#rule'). " "
>            . ( $self->ScripObj->Description || '' ) );
>
>    my $status = RT::Interface::Email::SendEmail(
>        Entity      => $MIMEObj,
>        Ticket      => $self->TicketObj,
>        Transaction => $self->TransactionObj,
>    );
>
> so to replace the msgid from
>
> rt-3.8.2-16248-1279122035-324.768607-185-0 at rt.example.net
>
> to this
>
> rt-3.8.2-16248-1279122035-324.768607-transactionid-185-0 at rt.qwestip.net
>
> so it has the transaction id in there as well ?

looking further more in that file /opt/rt3/lib/RT/Action/SendEmail.pm, line 592

         if (    $msgid
            and $msgid
            =~ s/<(rt-.*?-\d+-\d+)\.(\d+)-\d+-\d+\@\QRT->Config->Get('Organization')\E>$/
                         "<$1." . $self->TicketObj->id
                          . "-" . $self->ScripObj->id
                          . "-" . $self->ScripActionObj->{_Message_ID}
                          . "@" . RT->Config->Get('Organization') . ">"/eg
            and $2 == $self->TicketObj->id
            )

Looks like this is the code that creates the msgid.

So should I just add the $self->TransactionObj in here to make sure
msgid always have the transaction id as well?



>
>>
>> Thanks
>>
>>
>>>
>>> On Fri, Jul 9, 2010 at 11:11 PM, Asif Iqbal <vadud3 at gmail.com> wrote:
>>>> On Fri, Jul 9, 2010 at 2:45 PM, Kenneth Crocker <kfcrocker at lbl.gov> wrote:
>>>>> Asif,
>>>>>
>>>>> Sometimes, depending on the message, the number refers to the script being
>>>>> acted on or a user ID or a QueueID, etc. That's about all I know.
>>>>
>>>> Hmm.. I went through 34000 lines of rt.log and I could not match my
>>>> user id or queue id
>>>> any where.
>>>>
>>>> I am an active user resolving tickets. I also manage this box.
>>>>
>>>>>
>>>>> Kenn
>>>>> LBNL
>>>>>
>>>>> On Fri, Jul 9, 2010 at 10:52 AM, Asif Iqbal <vadud3 at gmail.com> wrote:
>>>>>>
>>>>>> Hi All
>>>>>>
>>>>>> I noticed about 60% of all rt.log has a token in the following format
>>>>>>
>>>>>>  <rt-3.8.2-16815-1278696300-880.767036-185-0 at rt.example.net>
>>>>>>
>>>>>> and some of those are followed by the ticket number, transaction
>>>>>> number and Scrip number after that
>>>>>> like this
>>>>>>
>>>>>>  <rt-3.8.2-16075-1278695671-112.767031-174-0 at rt.example.net>
>>>>>> #767031/4506465 - Scrip 174 ...
>>>>>>
>>>>>> Is there a to find out what are those numbers mean?
>>>>>>
>>>>>> Obviously..
>>>>>>   767031 in that <..token> is the ticket number.
>>>>>>   rt-3.8.2 is the RT version
>>>>>>   1278695671 is probably the epoch time
>>>>>>
>>>>>> But, what are the other numbers represents ?
>>>>>>
>>>>>> --
>>>>>> Asif Iqbal
>>>>>> PGP Key: 0xE62693C5 KeyServer: pgp.mit.edu
>>>>>> A: Because it messes up the order in which people normally read text.
>>>>>> Q: Why is top-posting such a bad thing?
>>>>>>
>>>>>> Discover RT's hidden secrets with RT Essentials from O'Reilly Media.
>>>>>> Buy a copy at http://rtbook.bestpractical.com
>>>>>
>>>>>
>>>>>
>>>>> Discover RT's hidden secrets with RT Essentials from O'Reilly Media.
>>>>> Buy a copy at http://rtbook.bestpractical.com
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Asif Iqbal
>>>> PGP Key: 0xE62693C5 KeyServer: pgp.mit.edu
>>>> A: Because it messes up the order in which people normally read text.
>>>> Q: Why is top-posting such a bad thing?
>>>>
>>>> Discover RT's hidden secrets with RT Essentials from O'Reilly Media.
>>>> Buy a copy at http://rtbook.bestpractical.com
>>>>
>>>
>>>
>>>
>>> --
>>> Best regards, Ruslan.
>>>
>>
>>
>>
>> --
>> Asif Iqbal
>> PGP Key: 0xE62693C5 KeyServer: pgp.mit.edu
>> A: Because it messes up the order in which people normally read text.
>> Q: Why is top-posting such a bad thing?
>>
>
>
>
> --
> Asif Iqbal
> PGP Key: 0xE62693C5 KeyServer: pgp.mit.edu
> A: Because it messes up the order in which people normally read text.
> Q: Why is top-posting such a bad thing?
>



-- 
Asif Iqbal
PGP Key: 0xE62693C5 KeyServer: pgp.mit.edu
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?


More information about the rt-devel mailing list