Re: [logs] perl question relating to log analysis (fwd)

From: Jeff Schaller (schallerat_private)
Date: Wed Aug 28 2002 - 11:37:49 PDT

  • Next message: Michael Poon: "Re: [logs] a small reminder"

    On Wed, 28 Aug 2002, Glenn Forbes Fleming Larratt wrote:
    
    > More Perl - hit DELETE now if uninterested.
    
    > %returnvalue =
    > (
    >   "msg 1" => 1,
    >   "msg 2" => 2,
    >   "msg 3" => 3,
    > );
    
    > if(/$subsidiary_regexp_before($regexp_to_glean_mgs)$subsidiary_regexp_after/)
    > { return $returnvalue{$1}; }
    
    The only trouble here is that $regexp_to_glean_mgs has to be
    general enough to match whatever you've got in %returnvalue and so
    at that point, the return value from the regex matching is
    probably just returning the "interesting" part of the syslog
    string. At that point, you can't do any more RE pattern matching.
    For a fake example:
    
    mailsrv1: message 293872 died
    mailsrv2: message 222222 died
    
    then you'd basically have to have every possible syslog entry in
    %returnvalue.
    
    -jeff
    -- 
    Every dark cloud has a silver lining, but lightning kills hundreds of
    people each year who are trying to find it. http://www.despair.com
    
    _______________________________________________
    LogAnalysis mailing list
    LogAnalysisat_private
    http://lists.shmoo.com/mailman/listinfo/loganalysis
    



    This archive was generated by hypermail 2b30 : Wed Aug 28 2002 - 11:53:56 PDT