win_eventlog – Manage Windows event logs¶
New in version 2.4.
- 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.
- win_eventlog_entry – Write entries to Windows event logs
- The official documentation on the win_eventlog_entry module.
- name: Add a new event log with two custom sources win_eventlog: name: MyNewLog sources: - NewLogSource1 - NewLogSource2 state: present - name: Change the category and message resource files used for NewLogSource1 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 win_eventlog: name: MyNewLog maximum_size: 16MB overflow_action: DoNotOverwrite state: present - name: Clear event entries for MyNewLog win_eventlog: name: MyNewLog state: clear - name: Remove NewLogSource2 from MyNewLog win_eventlog: name: MyNewLog sources: - NewLogSource2 state: absent - name: Remove MyNewLog and all remaining sources win_eventlog: name: MyNewLog state: absent
Common return values are documented here, the following are the fields unique to this module: