Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (Flatly)
  • No Skin
Collapse
Brand Logo

NetXMS Forum

  1. Home
  2. Support
  3. Logwatch: Count lines per minute & logrotate

Logwatch: Count lines per minute & logrotate

Scheduled Pinned Locked Moved Support
2 Posts 1 Posters 19.8k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • I
    I
    Ingmar
    wrote on last edited by
    #1

    I'd like to pull some statistics out of a logfile as it is being written to, for example "requests per minute". I know how to set up logwatch and create parsers to match error messages and get notifications for those, but this is a little different. What I want is the number of times a rule has matched and then set up a delta DCI so I can get requests per minute. Is this possible, and if so, how?

    In addition I've been wondering what happens to the logwatch subagent when logrotate moves the file away. Will it reopen the new logfile?

    1 Reply Last reply
    0
    • I
      I
      Ingmar
      wrote on last edited by
      #2

      Answering my own question: I found the LogWatch.Parser.MatchedRecords(*) DCI to get the number of matched records. Had to create a separate parser XML to get only the records that I want, as it's not possible to select by rule, only by file. Then I had to guess what the parameter for that DCI was - turns out it's the name of the first <file> tag in the parser definition. Then I just put a "Delta per Minute" transformation on the DCI and I get nice charts.

      Is this documented anywhere? Because I couldn't find anything about that DCI other than in the source, and neither could Google. I often find myself poking around in NetXMS source (which is pleasantly clean by the way) because the documentation seems incomplete or outdated.

      1 Reply Last reply
      0

      Hello! It looks like you're interested in this conversation, but you don't have an account yet.

      Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

      With your input, this post could be even better 💗

      Register Login
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      Powered by NodeBB Contributors
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups