Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3215500
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T15:11:06+00:00 2026-05-17T15:11:06+00:00

I have written an application which collects windows logs from linux, via the Zenoss

  • 0

I have written an application which collects windows logs from linux, via the Zenoss wmi-client package.

It uses WQL to query the Event log and parses the return. My problem is trying to find the latest entry in the log.

I stumbled across this which tells me to use the NumberOfRecords column in a query such as this

Select NumberOfRecords from Win32_NTEventLogFile Where LogFileName = 'Application'

and use the return value from that as the highest log.

My question is, I have heard that the Windows Event log is a circular buffer, that is it overwrites it’s oldest logs with new ones as the log gets full. Will this have an impact on NumberOfRecords, as if that happens, the “RecordNumber” property of the events will continue to increase, however the actual Number of Records in the event log wouldn’t change (as for every entry written, one is dropped).

Can anyone shed some insight to how this actually works (whether NumberOfRecords is the highest RecordNumber, or the actual number of events in the log), and perhaps suggest a solution?

Update

So we know now that NumberOfRecords won’t work on it’s own because the Event Log is a ring buffer. The MS Solution is to get the Oldest record and add it to NumberOfRecords to get the actual latest record.

This is possible through WinAPI, but I am calling remotely from Linux. Does anyone know how I might achieve this in my scenario?

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T15:11:07+00:00Added an answer on May 17, 2026 at 3:11 pm

    NumberOfRecords will not always be the max record number because the log is circular and the log can be cleared and you may have 1 entry but it’s record number is 1000.

    The way you would do this using the win api would be to get the oldest record number and add the number of records in the log to get the max record number. It doesn’t look like Win32_NTEventLogFile has a oldest record number field to use.

    Are you trying to get the latest record every time you query the log? You can use TimeGenerated when you query Win32_NTLogEvent to get everything > NOW. You can iterate that list to find your max record number.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hi i have written a server application which accepts a name from the client
I have written an Android application that uses SQLite database which is saved in
I have written a windows service application which is installed on my PC. There
I have a written a J2ME application which uses Bluetooth and search a file
I have written standalone application which is working in Windows Azure as startup task.
I have written a chat application which is working as desired apart from 1
I have written an application which uses a pipeline of 15 XSL stylesheets, and
I have written an application which loads information from a plist which lies on
I have written a Ruby application which parses lots of data from sources in
I have written an application from which you can write checks and I have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.