On Wednesday, May 29, 2002, at 12:29 , Hernan Marcelo Salvarezza wrote:

> Hello people
[..]
> the scripts works fine with a small log but when i try to run it in the
> long log file it displays all the log file
> just as if it is being opened with cat.

way strange...


> I am trying to get just the number,setup time and disconnect time from
> the log,,just this values in a single
> line like this
>
> 53353454545 18:10 18:20

>> From the script
>
> my $dtgT = '\d|:|\.';   #numbers or colons or dots
> my $upT = 'SetupTime';
> my $downT = 'DisconnectTime';
> my $prefT = '38\#';
>
> my $find = qr/(.*)\s+ (\d+\.\d+\.\d+\.\d+)\s* $prefT (\d+), \s* $upT\s*
> ([$dtgT]+)\s*$downT\s* ([$dtgT]+)/xo;

notice that there are five things being picked up


my $find = qr/(.*)\s+               # $1 - get the dtg String?
             (\d+\.\d+\.\d+\.\d+)\s* # $2 simple dotQuad Grovellor
             $prefT
             (\d+)                   # $3 = that number thing
             ,\s*                    # comma with or without spaces
             $upT\s*                 # the SetUpTime Token
             ([$dtgT]+)              # $4 - the up time
             \s*$downT\s*            # the downT Token
             ([$dtgT]+)              # $5 the down time
             /xo;                    # so that we can whack in answers.

since all you say that you want are the last three then you could
reconstruct it as


my $find = qr/\d+\.\d+\.\d+\.\d+\s* # simple dotQuad Grovellor
             $prefT
             (\d+)                   # $1 = that number thing
             ,\s*                    # comma with or without spaces
             $upT\s*                 # the SetUpTime Token
             ([$dtgT]+)              # $2 - the up time
             \s*$downT\s*            # the downT Token
             ([$dtgT]+)              # $3 the down time
             /xo;                    # so that we can whack in answers.




> so the question is  how should i form the regexp to just get the number
> from the entire log file?
> how should i form the regexp  get only the disconnect time?
>
>
> Log File:
>
> May 10 14:25:00  13310: %VOIPAAA-5-VOIP_CALL_HISTORY: CallLegType 1,
> ConnectionId 0 0 0 0, SetupTim
> e 17:30:58.645 UTC Fri May 10 2002, PeerAddress 38#533147631,
> PeerSubAddress , DisconnectCause 2F  , Disconnect
> Text no resource., ConnectTime 17:30:58.655 UTC Fri May 10 2002,
> DisconnectTime 17:30:58.655 UTC Fri May 10 200
> 2, CallOrigin 1, ChargedUnits 0, InfoType 2, TransmitPackets 0,
> TransmitBytes 0, ReceivePackets 0, ReceiveBytes
>  0

is that one line entry in the file???

> May 10 15:03:05  13311: %VOIPAAA-5-VOIP_CALL_HISTORY: CallLegType 1,
> ConnectionId 0 0 0 0, SetupTim
> e 18:09:04.262 UTC Fri May 10 2002, PeerAddress 38#5347631,
> PeerSubAddress , DisconnectCause 2F  , DisconnectTe
> xt no resource., ConnectTime 18:09:04.262 UTC Fri May 10 2002,
> DisconnectTime 18:09:04.262 UTC Fri May 10 2002,
>  CallOrigin 1, ChargedUnits 0, InfoType 2, TransmitPackets 0,
> TransmitBytes 0, ReceivePackets 0, ReceiveBytes 0

and this the next line entry???

> May 10 15:03:38  %VOIPAAA-5-VOIP_CALL_HISTORY: CallLegType 2,
> ConnectionId DF125DE2 637711D6
>  BD90A185 393856AE, SetupTime 18:09:15.110 UTC Fri May 10 2002,
> PeerAddress , PeerSubAddress , DisconnectCause
> 10  , DisconnectText normal call clearing., ConnectTime 18:09:37.970 UTC
> Fri May 10 2002, DisconnectTime 18:09:
> 37.970 UTC Fri May 10 2002, CallOrigin 2, ChargedUnits 0, InfoType 2,
> TransmitPackets 451, TransmitBytes 18040,
>  ReceivePackets 0, ReceiveBytes 0


This is actually the interesting entry - since this one does
not have the numeric value I would be expecting given your
first two.... note also that there is no PeerAddress value set...

and does this really need to be on the cgi list? or should this
be on say the beginner's mailing list???

ciao
drieux

---


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to