limit problem in lire:group while creating my report

Joost van Baal joostvb at logreport.org
Thu Oct 27 16:48:42 CEST 2005


Hi again,

Op do 27 okt 2005 om 03:45:51 +0200 schreef Emeric Laroche:
> 2005/10/27, Joost van Baal <joostvb at logreport.org>:
> > Op do 27 okt 2005 om 02:20:13 +0200 schreef Emeric Laroche:
> > >
> > > I'm creating a report for syslog messages.
> > > some problems can appear from different hosts and I want to see from
> > > wich host this message appear so I want to have something like :
> > > Level
> > >     Message
> > >         Host
> > >
> > > so this is part of my "host-by-top-10-messages-by-level.xml" file :
> > > <lire:report-calc-spec>
> > >   <lire:group>
> > >     <lire:field name="level"/>
> > >     <lire:group sort="-msg_count" limit="10">
> > >       <lire:field name="message"/>
> > >       <lire:group >
> > >         <lire:field name="hostname"/>
> > >         <lire:count name="msg_count" label="message"/>
> > >       </lire:group>
> > >     </lire:group>
> > >   </lire:group>
> > > </lire:report-calc-spec>
> > >
> >
> > Wild guess:
> >
> >      <lire:group sort="-msg_count">
> >        <lire:field name="message"/>
> >        <lire:group sort="-msg_count" limit="10">
> >          <lire:field name="hostname"/>
> >          <lire:count name="msg_count" label="message"/>
> >        </lire:group>
> >      </lire:group>
> >
> > Could you try that?
> 
> Well.. truncate the number of hostname for each messages (I have 12
> message in my test log file and 13 hosts, the 12 messages appear but
> just 10 hosts... and I want 10 messages and 13 hosts)

A rats...  Another (still quite wild, actually...) guess:

  <lire:report-calc-spec>
   <lire:group>
    <lire:field name="level"/>
    <lire:group sort="-msg_count" limit="10">
      <lire:field name="message"/>
      <lire:group name="msg_count">
        <lire:field name="hostname"/>
        <lire:count label="message"/>
      </lire:group>
    </lire:group>
   </lire:group>
  <lire:report-calc-spec>

(Had to study a bit of "Chapter 11. The Lire Report Specification Markup
Language" of the Lire Developer's Manual for this...)

> > BTW, are you willing to share this with us under a free license like the
> > GPL?  If so, we can ship your host-by-top-10-messages-by-level.xml file
> > with next Lire release.
> 
> Sure it's not a problem !
> I'll send you the template and reports I'm creating.

Excellent!  Be sure to add something like:

 Copyright (C) 2005 Emeric Laroche

 This file is free software; you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
 [...]

to it (assuming you're the copyright holder).

Bye,

Joost

-- 
.    .                                        http://logreport.com/
| '.|                        /^LogReport$/
| Lire                                        http://logreport.org/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 827 bytes
Desc: Digital signature
Url : http://lists.logreport.org/pipermail/questions/attachments/20051027/c2d2a935/attachment.bin 


More information about the Questions mailing list