Event log size query

(imported topic written by jpeppers91)

Is there a way to query a size of the event log, for instance, security?

(imported comment written by jeff_saxton91)

Here’s how to query the MAXIMUM size of the system log:

values “MaxSize” of keys “HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\EventLog\Security” of registries as string

You can replace “Security” with “System” or “Application” in the registry key name to query the other logs.

Here’s how to get the CURRENT size:

size of file “C:\WINDOWS\System32\Config\SecEvent.evt”

and of course we’ll want the PERCENTAGE of MaxSize:

(size of file “C:\WINDOWS\System32\Config\SecEvent.evt” as integer as floating point) / ( value “MaxSize” of keys “HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\EventLog\Security” of registries as integer as floating point) * 100

hope this helps :slight_smile: