Support Pagerduty V2 PD-CEF fields#33
Closed
atomicules wants to merge 1 commit intoPagerDuty:masterfrom
Closed
Conversation
Per PR 119 on pdagent, this extends the Pagerduty V2 API support to
pdagent-integrations by:
- Sending through the required PD-CEF fields (these need to be sent to
pdagent even if using V1 api per the current status of PR 119, even if
not actually used for V1 api call)
- Adding a command line flag to select the API version (defaults to V1)
- Adds default mappings for certain PD-CEF fields from Sensu check results
- Allows an optional argument to customise the mappings for PD-CEF
fields from Sensu check results. That works as follows:
--event-map "event_source,check.name"
Comma separated and then the field we want from the check result in
dot notation. It's fairly simplistic, not going to support fields
that actually use dots in their name (but probably pretty rare in
Sensu).
That argument can be supplied multiple times for the different
fields.
It's _fairly_ well error handled (not perfectly) so that if a mapping fails
(e.g. because that field doesn't exist in the Sensu check result)
then it will just set that PD-CEF to an empty string
Have tried to copy command structure of PR 119 as much as is applicable.
Have not looked at tests yet.
References: PagerDuty/pdagent#119
Author
|
I've not marked it as WIP as it works although I suppose strictly speaking should be considered WIP as I've not touched tests yet. |
atomicules
added a commit
to atomicules/sensu-pagerduty-handler
that referenced
this pull request
Nov 10, 2021
Adds: - Class - Group - Timestamp I.e. all the [fields documented here][1]. Since `omitempty` is used in go-pagerduty it's fine sending empty values for these fields over to that. _But_ this isn't much use as is. Really I want to get this so it can pull data from the check details itself like [this][2]: [1]: https://support.pagerduty.com/docs/pd-cef [2]: PagerDuty/pdagent-integrations#33 Signed-off-by: atomicules <base@atomicules.co.uk>
Author
|
Closing due to age. |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Per PR 119 on pdagent, this extends the Pagerduty V2 API support to
pdagent-integrations by:
Sending through the required PD-CEF fields (these need to be sent to
pdagent even if using V1 api per the current status of PR 119, even if
not actually used for V1 api call)
Adding a command line flag to select the API version (defaults to V1)
Adds default mappings for certain PD-CEF fields from Sensu check results
Allows an optional argument to customise the mappings for PD-CEF
fields from Sensu check results. That works as follows:
Comma separated and then the field we want from the check result in
dot notation. It's fairly simplistic, not going to support fields
that actually use dots in their name (but probably pretty rare in
Sensu).
That argument can be supplied multiple times for the different
fields.
It's fairly well error handled (not perfectly) so that if a mapping fails
(e.g. because that field doesn't exist in the Sensu check result)
then it will just set that PD-CEF to an empty string
Have tried to copy command structure of PR 119 as much as is applicable.
Have not looked at tests yet.
References: PagerDuty/pdagent#119