[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [multitail] regex help




in following sample i wan't only 2 first

[Wed Nov 15 13:22:46 2006] [error] [client 164.7.108.226] PHP Notice: 
Undefined variable: toto in
/sg2/instdev2/htdocs/V4/_FO_/lta.old/bench/test.php on line 7
[Wed Nov 15 13:22:47 2006] [notice] child pid 22968 exit signal
Segmentation fault (11)
[Wed Nov 15 13:22:46 2006] [error] [client 164.7.108.225] PHP Notice: 
Undefined variable: foo in /sg2/instdev2/htdocs/V4/_FO_/foo.php on line 20

As i said before, I check this regex in tools like regexCoach or
regexBuddy. It is valid and match what i want.
I found that multitail compile the regex with look ahead assertion if i
escape the question mark like \? , but it still dont work anyway.
    
Alternative:

    multitail -em "(\d\.\d\.108\.226|\d\.\d\.108\.226|^\[.+\] \[\S\] )"

but I think what you really want is the context option in GNU's grep (i.e. -A or
--after-context=NUM), to match the line with the IP address and show the next
line... I don't see that option in multitail.  You can ask for a new feature.
  
  
Generic line (i mean line not assigned to IP) are not always folling something. The 3 line of sample is not ordered. So next line that following the matching one is
not a valid solution for me.
I try your alternative,  some remarks
- \d\.\d\.108\.226 will match 4.7.108.226 but not 4.71.108.226, you should wrote \d+\.\d+\.108\.226
- You had set twice 108.226 but this should be mistype.
- the \d char classes doesn't work for me in multiltail, but [0-9] do.
- ^\[.+\] \[\S\] will not match anything unless the second brackets pair hold only one no space char such  [a], should put [\S+] to match more stuff, anyway, even corrected, this regexp will match all line since all line start with the format '[date] [level] ', that's why i appended the negative look ahead assertion in my example. eg: start(?!\[) => match start if not followed by \[
- As for \d, \S is not working in my myltitail. 

Could someone confirm that standard base character classes for regexp work or not in multitail  ?
List of base character classes i know
classes <=> equivalent
\w <=> [a-zA-Z0-9_]
\W <=> [^a-zA-Z0-9_]
\s <=> [ \t\n\r]
\S <=> [^ \t\n\r]
\d <=> [0-9]
\D <=> [^0-9]

I have compiled multitail 4.2.0 on SunOS 5.9 Generic_112233-08 sun4u sparc SUNW,Sun-Blade-1000



-- 





---------------------------------------------------------------------
Sorry, This disclamer is auto added by FW's company
---------------------------------------------------------------------

























Si vous n'etes pas destinataires de ce message, merci d'avertir l'expediteur de l'erreur de distribution et de le detruire immediatement.
Ce message contient des informations confidentielles ou appartenant a La Francaise des Jeux. Il est etabli a l'intention exclusive de ses destinataires. Toute divulgation, utilisation, diffusion ou reproduction (totale ou partielle) de ce message ou des informations qu'il contient, doit etre prealablement autorisee.
Tout message electronique est susceptible d'alteration et son integrite ne peut etre assuree. La Francaise des Jeux decline toute responsabilite au titre de ce message s'il a ete modifie ou falsifie.

If you are not the intended recipient of this e-mail, please notify the sender of the wrong delivery and delete it immediately from your system.
This e-mail contains confidential information or information belonging to La Francaise des Jeux and is intended solely for the addressees. The unauthorised disclosure, use, dissemination or copying (either whole or partial) of this e-mail, or any information it contains, is prohibited.
E-mails are susceptible to alteration and their integrity cannot be guaranteed. La Francaise des Jeux shall not be liable for this e-mail if modified or falsified.