community.windows.win_eventlog – Manage Windows event logs¶
Note
This plugin is part of the community.windows collection (version 1.3.0).
To install it use: ansible-galaxy collection install community.windows
.
To use it in a playbook, specify: community.windows.win_eventlog
.
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¶
See Also¶
See also
- community.windows.win_eventlog_entry
The official documentation on the community.windows.win_eventlog_entry module.
Examples¶
- name: Add a new event log with two custom sources
community.windows.win_eventlog:
name: MyNewLog
sources:
- NewLogSource1
- NewLogSource2
state: present
- name: Change the category and message resource files used for NewLogSource1
community.windows.win_eventlog:
name: MyNewLog
sources:
- NewLogSource1
category_file: C:\NewApp\CustomCategories.dll
message_file: C:\NewApp\CustomMessages.dll
state: present
- name: Change the maximum size and overflow action for MyNewLog
community.windows.win_eventlog:
name: MyNewLog
maximum_size: 16MB
overflow_action: DoNotOverwrite
state: present
- name: Clear event entries for MyNewLog
community.windows.win_eventlog:
name: MyNewLog
state: clear
- name: Remove NewLogSource2 from MyNewLog
community.windows.win_eventlog:
name: MyNewLog
sources:
- NewLogSource2
state: absent
- name: Remove MyNewLog and all remaining sources
community.windows.win_eventlog:
name: MyNewLog
state: absent
Return Values¶
Common return values are documented here, the following are the fields unique to this module:
Authors¶
Andrew Saraceni (@andrewsaraceni)