
Once the maximum log size is reached, older items will be deleted to make way for new items.
Overwrite events as needed (oldest events first) - This is the default setting. Beyond that, decide upon your retention policy. The first thing you may want to change would be the "Maximum log size (KB)". Right click on the Security log and select Properties. To check or modify your security event log settings, launch Event Viewer. Here is a screenshot of typical security event log settings: By default the security log is configured to overwrite events as needed. Level 4 is Information, 3 is Warning, 2 is Error, and 1 is Critical.In a security conscious environment, it may be necessary or mandated to archive the Windows security event log. If you want to restrict searches to only include a certain event level, you can query for them using their level number. Wevtutil qe "C:\Directory\SubDirectory\logFile.evt" /lf:true | findstr /C:"license found" evt log file, you can find the text “license found” using: Once you have determined which log you would like to query, type something such as: If you want to specify the level of the event, such as “Information,” you can include:Ĭscript eventquery.vbs /L Application /V /FI "Type eq Information"| findstr /C:"Performance counters for the WmiApRpl" For instance, if you want to find the string “Performance counters for the WmiApRpl” in the output of the Application log, you can use:Ĭscript eventquery.vbs /L Application /V | findstr /C:"Performance counters for the WmiApRpl" This can be done by piping the output of the query to the findstr command which will be able to pattern match the output. You can further refine your search by including a search pattern. For example, if you are using the Application log, you can use the Application argument. Then, you can specify which log you are trying to work with. Open the command line and browse to the directory containing the eventquery.vbs script: