.. _community.windows.win_eventlog_module:
******************************
community.windows.win_eventlog
******************************
**Manage Windows event logs**
.. contents::
:local:
:depth: 1
Synopsis
--------
- Allows the addition, clearing and removal of local Windows event logs, and the creation and removal of sources from a given event log. Also allows the specification of settings per log and source.
Parameters
----------
.. raw:: html
| Parameter |
Choices/Defaults |
Comments |
|
category_file
path
|
|
For one or more sources specified, the path to a custom category resource file.
|
|
maximum_size
string
|
|
The maximum size of the event log.
Value must be between 64KB and 4GB, and divisible by 64KB.
Size can be specified in KB, MB or GB (e.g. 128KB, 16MB, 2.5GB).
|
|
message_file
path
|
|
For one or more sources specified, the path to a custom event message resource file.
|
|
name
string
/ required
|
|
Name of the event log to manage.
|
|
overflow_action
string
|
Choices:
- DoNotOverwrite
- OverwriteAsNeeded
- OverwriteOlder
|
The action for the log to take once it reaches its maximum size.
For DoNotOverwrite, all existing entries are kept and new entries are not retained.
For OverwriteAsNeeded, each new entry overwrites the oldest entry.
For OverwriteOlder, new log entries overwrite those older than the retention_days value.
|
|
parameter_file
path
|
|
For one or more sources specified, the path to a custom parameter resource file.
|
|
retention_days
integer
|
|
The minimum number of days event entries must remain in the log.
This option is only used when overflow_action is OverwriteOlder.
|
|
sources
list
|
|
A list of one or more sources to ensure are present/absent in the log.
When category_file, message_file and/or parameter_file are specified, these values are applied across all sources.
|
|
state
string
|
Choices:
- absent
- clear
present ←
|
Desired state of the log and/or sources.
When sources is populated, state is checked for sources.
When sources is not populated, state is checked for the specified log itself.
If state is clear, event log entries are cleared for the target log.
|