|
| 1 | +# Windows Event Log (winevtlog) |
| 2 | + |
| 3 | +The **winevtlog** input plugin allows you to read Windows Event Log with new API from `winevt.h`. |
| 4 | + |
| 5 | +## Configuration Parameters <a id="config"></a> |
| 6 | + |
| 7 | +The plugin supports the following configuration parameters: |
| 8 | + |
| 9 | +| Key | Description | Default | |
| 10 | +| :--- | :--- | :--- | |
| 11 | +| Channels | A comma-separated list of channels to read from. | | |
| 12 | +| Interval\_Sec | Set the polling interval for each channel. \(optional\) | 1 | |
| 13 | +| Interval\_NSec | Set the polling interval for each channel (sub seconds. \(optional\) | 0 | |
| 14 | +| Read\_Existing\_Events | Whether to read existing events from head or tailing events at last on subscribing. \(optional\) | False | |
| 15 | +| DB | Set the path to save the read offsets. \(optional\) | | |
| 16 | +| String\_Inserts | Whether to include StringInserts in output records. \(optional\) | False | |
| 17 | +| Render\_Event\_As\_XML | Whether to render system part of event as XML string or not. \(optional\) | False | |
| 18 | +| Use\_ANSI | Use ANSI encoding on eventlog messages. \(optional\) | False | |
| 19 | + |
| 20 | +Note that if you do not set _db_, the plugin will tail channels on each startup. |
| 21 | + |
| 22 | +## Configuration Examples <a id="config_example"></a> |
| 23 | + |
| 24 | +### Configuration File |
| 25 | + |
| 26 | +Here is a minimum configuration example. |
| 27 | + |
| 28 | +```python |
| 29 | +[INPUT] |
| 30 | + Name winevtlog |
| 31 | + Channels Setup,Windows PowerShell |
| 32 | + Interval_Sec 1 |
| 33 | + DB winevtlog.sqlite |
| 34 | + |
| 35 | +[OUTPUT] |
| 36 | + Name stdout |
| 37 | + Match * |
| 38 | +``` |
| 39 | + |
| 40 | +Note that some Windows Event Log channels \(like `Security`\) requires an admin privilege for reading. In this case, you need to run fluent-bit as an administrator. |
| 41 | + |
| 42 | +### Command Line |
| 43 | + |
| 44 | +If you want to do a quick test, you can run this plugin from the command line. |
| 45 | + |
| 46 | +```bash |
| 47 | +$ fluent-bit -i winevtlog -p 'channels=Setup' -p 'Read_Existing_Events=true' -o stdout |
| 48 | +``` |
| 49 | + |
| 50 | +Note that `winevtlog` plugin will tail channles on each startup. |
| 51 | +If you want to confirm whether this plugin is working or not, you should specify `-p 'Read_Existing_Events=true'` parameter. |
0 commit comments