Skip to content

Read archived .evtx files with Winlogbeat#11361

Merged
andrewkroh merged 3 commits intoelastic:masterfrom
andrewkroh:feature/wlb/evtx-file-support
Apr 9, 2019
Merged

Read archived .evtx files with Winlogbeat#11361
andrewkroh merged 3 commits intoelastic:masterfrom
andrewkroh:feature/wlb/evtx-file-support

Conversation

@andrewkroh
Copy link
Copy Markdown
Member

@andrewkroh andrewkroh commented Mar 21, 2019

This gives Winlogbeat the ability to read from archived .evtx files. The name parameter recognizes that the value is absolute path and then uses the appropriate APIs to open the file and ingest its contents. In order to support the use case of reading from a file and then exiting when there are no more events (ERROR_NO_MORE_ITEMS) I added a config option to change the behavior of the reader from waiting for more events to stopping.

I also had to add shutdown_timeout option to make Winlogbeat wait for events to finish publishing before exiting.

To keep it simple, globs are not supported. This would have required the introduction of a "prospector" to continuously monitor the glob for new / moved / deleted files.

In the FAQ I added an example of how to use this feature.

Closes #4450

TODO

  • Update reference docs and reference config with the new options.
  • Should it populate log.file.path when reading from an .evtx file?

@andrewkroh
Copy link
Copy Markdown
Member Author

With this enhancement in place it will make it easier to test the development of event processing pipelines since you can playback stored event logs. Aside from that, this has been a much requested feature.

@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/secops

Copy link
Copy Markdown
Contributor

@adriansr adriansr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work !

This gives Winlogbeat the ability to read from archived .evtx files. The `name` parameter recognizes that the value is absolute path and then uses the appropriate APIs to open the file and ingest its contents. In order to support the use case of reading from a file and then exiting when there are no more events (`ERROR_NO_MORE_ITEMS`) I added a config option to change the behavior of the reader from waiting for more events to stopping.

I also had to add `shutdown_timeout` option to make Winlogbeat wait for events to finish publishing before exiting.

To keep it simple, globs are not supported. This would have required the introduction of a "prospector" to continuously monitor the glob for new / moved / deleted files.

    winlogbeat.event_logs:
      - name: ${EVTX_FILE}
        no_more_events: stop

    winlogbeat.shutdown_timeout: 30s
    winlogbeat.registry_file: evtx-registry.yml

    output.elasticsearch.hosts: ['http://localhost:9200']

Closes elastic#4450
@andrewkroh andrewkroh force-pushed the feature/wlb/evtx-file-support branch from 28ec9a7 to e2fb70d Compare April 8, 2019 21:57
@andrewkroh andrewkroh merged commit dfabb06 into elastic:master Apr 9, 2019
@meggenberger
Copy link
Copy Markdown

can no_more_events only be stop?
I have the use case where a storage System (Netapp) is generating Windows Events and writes them to a file on a share in evtx format. Events will be added to that file all day and every they the file will be rotated out (current file keeps the name and older events will be rotated out to a file with a date suffix).

@andrewkroh
Copy link
Copy Markdown
Member Author

@meggenberger
Copy link
Copy Markdown

Great .... this will solve my problem. Now only 7.1. has to be released soon. Thanks for this feature!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Winlogbeat] Add option to read .evt and .evtx files

4 participants