1#!/usr/local/bin/python3.8 2# -*- coding: utf-8 -*- 3 4# Copyright: (c) 2017, Andrew Saraceni <andrew.saraceni@gmail.com> 5# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) 6 7DOCUMENTATION = r''' 8--- 9module: win_eventlog_entry 10short_description: Write entries to Windows event logs 11description: 12 - Write log entries to a given event log from a specified source. 13options: 14 log: 15 description: 16 - Name of the event log to write an entry to. 17 type: str 18 required: yes 19 source: 20 description: 21 - Name of the log source to indicate where the entry is from. 22 type: str 23 required: yes 24 event_id: 25 description: 26 - The numeric event identifier for the entry. 27 - Value must be between 0 and 65535. 28 type: int 29 required: yes 30 message: 31 description: 32 - The message for the given log entry. 33 type: str 34 required: yes 35 entry_type: 36 description: 37 - Indicates the entry being written to the log is of a specific type. 38 type: str 39 choices: [ Error, FailureAudit, Information, SuccessAudit, Warning ] 40 category: 41 description: 42 - A numeric task category associated with the category message file for the log source. 43 type: int 44 raw_data: 45 description: 46 - Binary data associated with the log entry. 47 - Value must be a comma-separated array of 8-bit unsigned integers (0 to 255). 48 type: str 49notes: 50 - This module will always report a change when writing an event entry. 51seealso: 52- module: community.windows.win_eventlog 53author: 54 - Andrew Saraceni (@andrewsaraceni) 55''' 56 57EXAMPLES = r''' 58- name: Write an entry to a Windows event log 59 community.windows.win_eventlog_entry: 60 log: MyNewLog 61 source: NewLogSource1 62 event_id: 1234 63 message: This is a test log entry. 64 65- name: Write another entry to a different Windows event log 66 community.windows.win_eventlog_entry: 67 log: AnotherLog 68 source: MyAppSource 69 event_id: 5000 70 message: An error has occurred. 71 entry_type: Error 72 category: 5 73 raw_data: 10,20 74''' 75 76RETURN = r''' 77# Default return values 78''' 79