Ad Widget

Collapse

Count of entrys in Logfiles

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mbrand5371
    Member
    • May 2009
    • 55

    #1

    Count of entrys in Logfiles

    One of your application's has log entrys like:

    01 Sep 2010 07:56:31 [RMI TCP Connection(2826)] INFO (25870810675) - Printserver: Start der Druckverarbeitung auf dem Server
    01 Sep 2010 07:56:31 [RMI TCP Connection(2826)] INFO (25870810675) - Printserver: printPointer(): Schema files successfully exported.
    01 Sep 2010 07:56:35 [RMI TCP Connection(2826)] INFO (25870810675) - Printserver: printPointer(): Pdffile successfully exported.
    01 Sep 2010 07:58:15 [RMI TCP Connection(2844)] INFO (25870810675) - Printserver: Start der Druckverarbeitung auf dem Server
    01 Sep 2010 07:58:15 [RMI TCP Connection(2844)] INFO (25870810675) - Printserver: printPointer(): Schema files successfully exported.
    01 Sep 2010 07:58:18 [RMI TCP Connection(2844)] INFO (25870810675) - Printserver: printPointer(): Pdffile successfully exported.

    I need to count the entrys with values: "Start der Druckverarbeitung auf dem Server" in the last 60 seconds.
    Following up, i need to graph the count :-)

    Item with log key will get the whole line. But how can i count matched entry's ?
    Last edited by mbrand5371; 20-09-2010, 07:48.
  • ad@kbc-clearing.com
    Member
    • Sep 2005
    • 77

    #2
    You should use a calculated item with formula:
    count(snmptraps,60,text you want to filter)

    This calculated item must be evaluated every 60 secs.
    After that, you can put it in a graph.

    Comment

    • mbrand5371
      Member
      • May 2009
      • 55

      #3
      Counting by using calculated items needs to get the log entrys with an zabbix item and so we get an needloess copy of the log entrys in zabbix database.

      We're currently using this workaround:

      In zabbix-agent.conf
      UserParameter=egrep.rsprint,C:\cygwin\bin\egrep.ex e -c "Start der Druckverarbeitung" /cygdrive/c/safir/server/safir-rsPrint_4.1.7.1/application/logs/rsPrintServer.log

      In zabbix we've created an item which gets the value from the UserParameter and calculating the averages and other things with calculated items targeting the UserParameter.

      I think it would be nice to have an zabbix key like:
      log.count[file,<regexp>,<negregexp>,<encoding>,<maxlines>,<m ode>]

      file – full file name
      regexp – regular expression for pattern
      negregexp – regular expression for negating pattern (possible to get lines which contails eg. "foobar" but not "foobar...unused")
      encoding - Code Page identifier
      maxlines - Maximum number of new lines per second the agent will send to
      mode - one of all (default), skip (skipping processing of older data)

      Comment

      Working...