ebonding-stream-to-pagerduty
| ## Read incidents from stream
@rn:read-stream
name = "snow-incidents" &
group = "group-pagerduty"
## update stats
--> @rn:write-stats-to-stream
name = "ebonding-analytics" &
type = "PagerDuty"
## select and rename source fields to match PagerDuty payload
--> @dm:selectcolumns
include = "number|description|short_description|priority|urgency"
--> @dm:map
to ="incident_key" &
func="evaluate" &
expr = number
--> @dm:map
to ="body_details" &
func="evaluate" &
expr = description
--> @dm:map
to ="incident_title" &
func="evaluate" &
expr = short_description
--> @dm:eval
incident_title = "incident_title.replace(chr(34), chr(39))"
--> @dm:eval
body_details = "body_details.replace(chr(34), chr(39))"
## enrich data with service, priority and urgency field mappings
--> @dm:enrich-using-rule-dict
dict = "pagerduty-svc-enrichment-dict" &
rule_column = "rule" &
enrich_columns = "service_id"
--> @dm:enrich-using-rule-dict
dict = "pagerduty-priority-enrichment-dict" &
rule_column = "rule" &
enrich_columns = "priority_id"
--> @dm:map
to ="priority_type" &
func="fixed" &
value = "priority_reference"
--> @dm:enrich-using-rule-dict
dict = "pagerduty-urgency-enrichment-dict" &
rule_column = "rule" &
enrich_columns = "urgency_id"
## create PagerDuty incident payload
--> @dm:apply-template-by-row
template_name = "PagerDuty Create Incident Template"
and output_col = "incident_payload"
--> @dm:selectcolumns
include = "incident_payload"
## use REST API to create incident in PagerDuty
--> @restclient:write
url="https://api.pagerduty.com/incidents"
and accept="application/vnd.pagerduty+json;version=2"
and secret_name = "pagerduty_token2"
and batch_size = 1
and method="POST"
and envelope = '{{incident_payload}}'
|
Extensions used in this Pipeline
Artifacts used in this Pipeline
Bots used in this Pipeline
@rn:read-stream @rn:write-stats-to-stream @dm:selectcolumns @dm:map @dm:eval @dm:enrich-using-rule-dict @dm:apply-template-by-row @restclient:write