Skip to content

Add bookmarking support to win_eventlog#8281

Closed
simnv wants to merge 1 commit intoinfluxdata:masterfrom
simnv:win_eventlog_bookmarks
Closed

Add bookmarking support to win_eventlog#8281
simnv wants to merge 1 commit intoinfluxdata:masterfrom
simnv:win_eventlog_bookmarks

Conversation

@simnv
Copy link
Copy Markdown
Contributor

@simnv simnv commented Oct 17, 2020

win_eventlog plugin tracks processed events and automatically saves bookmarks in Windows Registry. So even if Windows is rebooted or plugin was in stopped state for some time, no events will be missed.

Current event bookmark is saved under Software\InfluxData\Telegraf key in the EventBookmark string value. By default plugin tries to use HKEY_LOCAL_MACHINE hive, assuming it has Administrator privileges, but if it can't open key in this hive for writing, it tries to use HKEY_CURRENT_USER hive instead.

If even HKEY_CURRENT_USER couldn't be opened (telegraf is started with no priviliges at all) or there was no previous bookmark saved, plugin subscribes to events starting from the current time.

Required for all PRs:

  • Signed CLA.
  • Associated README.md updated.
  • Has appropriate unit tests.

win_eventlog plugin tracks processed events and automatically saves
bookmarks in Windows Registry. So even if Windows is rebooted or
plugin was in stopped state for some time, no events will be missed.

Current event bookmark is saved under `Software\InfluxData\Telegraf`
key in the `EventBookmark` string value. By default plugin tries to
use `HKEY_LOCAL_MACHINE` hive, assuming it has Administrator privileges,
but if it can't open key in this hive for writing, it tries to use
`HKEY_CURRENT_USER` hive instead.

If even `HKEY_CURRENT_USER` couldn't be opened (telegraf is started with
no priviliges at all) or there was no previous bookmark saved, plugin
subscribes to events starting from the current time.
@Hipska Hipska added feat Improvement on an existing feature such as adding a new setting/mode to an existing plugin platform/windows plugin/input 1. Request for new input plugins 2. Issues/PRs that are related to input plugins area/windows Related to windows plugins (win_eventlog, win_perf_counters, win_services) and removed platform/windows labels Jan 21, 2021
@sjwang90
Copy link
Copy Markdown
Contributor

Hey @simnv - thanks for your PR! We think this is a tremendous feature that we actually want to implement across Telegraf and other plugins, not just win_eventlog (see #8352).

I'm going to close this now as we're going to take this on as a bigger project for Telegraf. Please comment on the #8352 if you have any feedback.

@sjwang90 sjwang90 closed this Jan 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/windows Related to windows plugins (win_eventlog, win_perf_counters, win_services) feat Improvement on an existing feature such as adding a new setting/mode to an existing plugin plugin/input 1. Request for new input plugins 2. Issues/PRs that are related to input plugins

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants