-
Notifications
You must be signed in to change notification settings - Fork 91
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add JSON support to windows sources (#193)
* changelog 1.6.2 * docs for windows json support * add windows json support * add windows json support * fix typo * chore(vagrant): fix ip Signed-off-by: Dominik Rosiek <[email protected]> * feat: add json related fields to windows event sources Signed-off-by: Dominik Rosiek <[email protected]> * refactor: create types for windows related properties Signed-off-by: Dominik Rosiek <[email protected]> * refactor: inherit windows remote source from windows local source Signed-off-by: Dominik Rosiek <[email protected]> * docs(README): update Signed-off-by: Dominik Rosiek <[email protected]> * fix: fix imports Signed-off-by: Dominik Rosiek <[email protected]> * fix: lint Signed-off-by: Dominik Rosiek <[email protected]> * feat: add enable_json_events property to windows sources Signed-off-by: Dominik Rosiek <[email protected]> * feat: add enable_json_events configuration to README Signed-off-by: Dominik Rosiek <[email protected]> * refactor: makes lint happy Signed-off-by: Dominik Rosiek <[email protected]> * fix: add missing change Signed-off-by: Dominik Rosiek <[email protected]> * tests: add tests for windows json events Signed-off-by: Dominik Rosiek <[email protected]> * chore(changelog): update * Apply suggestions from code review * docs: update due to review Signed-off-by: Dominik Rosiek <[email protected]> * docs: update due to review Signed-off-by: Dominik Rosiek <[email protected]> * feat: remove enable_json_events Signed-off-by: Dominik Rosiek <[email protected]> * Update CHANGELOG.md * Apply suggestions from code review * Delete remote_win_event_json_log_create_spec.rb * Delete local_win_event_json_log_create_spec.rb * tests: fix Signed-off-by: Dominik Rosiek <[email protected]> * fix: defaults Signed-off-by: Dominik Rosiek <[email protected]> * feat!: change default event_message to :message Co-authored-by: Rick Jury <[email protected]> Co-authored-by: Andrzej Stencel <[email protected]>
- Loading branch information
1 parent
e0e1a43
commit c271b3c
Showing
12 changed files
with
94 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,18 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'chef/resource/lwrp_base' | ||
require_relative 'resource_source' | ||
require_relative 'resource_local_win_event_log_source' | ||
|
||
class Chef | ||
class Resource | ||
class SumoSourceRemoteWindowsEventLog < Chef::Resource::SumoSource | ||
class SumoSourceRemoteWindowsEventLog < Chef::Resource::SumoSourceLocalWindowsEventLog | ||
provides :sumo_source_remote_windows_event_log if respond_to?(:provides) | ||
|
||
attribute :source_type, kind_of: Symbol, default: :remote_windows_event_log, equal_to: [:remote_windows_event_log] | ||
attribute :domain, kind_of: String, required: true | ||
attribute :username, kind_of: String, required: true | ||
attribute :password, kind_of: String, required: true | ||
attribute :hosts, kind_of: Array, required: true | ||
attribute :log_names, kind_of: Array, required: true | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# frozen_string_literal: true | ||
|
||
EVENT_FORMAT = { | ||
nil => nil, | ||
:legacy => 0, | ||
:json => 1 | ||
}.freeze | ||
|
||
EVENT_MESSAGE = { | ||
nil => nil, | ||
:complete => 0, | ||
:message => 1, | ||
:metadata => 2 | ||
}.freeze |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters