Splunk AppDynamics

ServiceNow integration - REST API

CommunityUser
Splunk Employee
Splunk Employee

Hello Community and a Happy New Year

Is there a way to configure a http request template to be able to close an existing servicenow incident on Health Rule Violation Ending by locating an existing record using the sys_id ?

Post /api/now/table/incident

Put /api/now/table/incident/{sys_id}

thanks

Steve

Labels (3)
Tags (1)
0 Karma

CommunityUser
Splunk Employee
Splunk Employee

Hello, Steven. Normally customers use an event management system, for this reason, otherwise, your ticket may get extremely cluttered or you will end up with a lot of duplicate tickets. We do not have an integration which does what you are asking, but if you look at how we integrate with ServiceNow Event Management you can likely derive a new HTTP Action template from the concept using the table API. 

#set($controllerName="demo1.appdynamics.com")
{
"records":[
#foreach(${event} in ${fullEventList})

#foreach(${entity} in ${event.affectedEntities})
#if($foreach.index > 0)
,
#end
{
"source": "AppDynamics"
,"event_class": "$controllerName"
,"x_apd_appdynamics_event_source_url": "$event.deepLink"
#if( $entity.entityTypeDisplayName == "Node" )
,"node": "$entity.name"
, "resource": "$entity.name"
, "ci_type": "x_apd_appdynamics_node"
,"ci_identifier" :{
"name":"$entity.name",
"tier_name":"$event.tier.name",
"application_name":"$event.application.name",
"controller_name": "$controllerName"
}
#elseif( $entity.entityTypeDisplayName == "Tier" )
,"node": "$entity.name"
, "resource": "$entity.name"
, "ci_type": "x_apd_appdynamics_tier"
,"ci_identifier" :{
"name":"$entity.name",
"application_name":"$event.application.name",
"controller_name": "$controllerName"
}
#elseif( $entity.entityTypeDisplayName == "Application" )
,"node": "$entity.name"
, "resource": "$entity.name"
, "ci_type": "x_apd_appdynamics_application"
,"ci_identifier" :{
"name":"$event.application.name",
"controller_name": "$controllerName"
}
#elseif( $entity.entityTypeDisplayName == "Business Transaction" )
, "ci_type": "x_apd_appdynamics_tier"
, "resource": "$entity.entityTypeDisplayName - $entity.name"
,"node": "$event.tier.name"
,"ci_identifier" :{
"name":"$event.tier.name",
"application_name":"$event.application.name",
"controller_name": "$controllerName"
}
#elseif( $entity.entityTypeDisplayName == "Service Endpoint" )
, "ci_type": "x_apd_appdynamics_tier"
, "resource": "$entity.entityTypeDisplayName - $entity.name"
,"node": "$event.tier.name"
,"ci_identifier" :{
"name":"$event.tier.name",
"application_name":"$event.application.name",
"controller_name": "$controllerName"
}
#elseif( $entity.entityTypeDisplayName == "Backend" )
, "ci_type": "x_apd_appdynamics_remote_service"
, "resource": "$entity.entityTypeDisplayName - $entity.name"
,"node": "$entity.name"
,"ci_identifier" :{
"name":"$entity.name",
"application_name":"$event.application.name",
"controller_name": "$controllerName"
}
#else
#if($event.node)
, "ci_type": "x_apd_appdynamics_node"
, "resource": "$entity.entityTypeDisplayName - $entity.name"
,"node": "$event.node.name"
,"ci_identifier" :{
"name":"$event.node.name",
"tier_name":"$event.tier.name",
"application_name":"$event.application.name",
"controller_name": "$controllerName"
}
#elseif($event.tier)
, "ci_type": "x_apd_appdynamics_tier"
, "resource": "$entity.entityTypeDisplayName - $entity.name"
,"node": "$event.tier.name"
,"ci_identifier" :{
"name":"$event.tier.name",
"application_name":"$event.application.name",
"controller_name": "$controllerName"
}
#elseif($event.application)
, "ci_type": "x_apd_appdynamics_application"
, "resource": "$entity.entityTypeDisplayName - $entity.name"
,"node": "$event.application.name"
,"ci_identifier" :{
"name":"$event.application.name",
"controller_name": "$controllerName"
}
#else
, "node": "$entity.name"
, "resource": "$entity.entityTypeDisplayName - $entity.name"
#end

#end
#if($event.healthRule)
,"metric_name" : "$event.healthRule.name"
#set( $msg=$event.healthRule.name)
#else
#set( $msg="")
#end
#set( $msg=$msg + ". " + ${event.eventMessage})
#set( $msg = $msg.replace("<b>", "") )
#set( $msg = $msg.replace("</b>", "") )
#set( $msg = $msg.replace("<br>", "") )
,"description" : "$msg"
#if($event.eventType == "POLICY_OPEN_WARNING"
|| $event.eventType == "POLICY_CONTINUES_WARNING"
|| $event.eventType == "POLICY_DOWNGRADED")
,"severity": "2"
#elseif($event.eventType == "POLICY_OPEN_CRITICAL"
|| $event.eventType == "POLICY_CONTINUES_CRITICAL"
|| $event.eventType == "POLICY_UPGRADED")
,"severity": "1"
#elseif($event.eventType == "POLICY_CLOSE_WARNING"
|| $event.eventType == "POLICY_CLOSE_CRITICAL"
|| $event.eventType == "POLICY_CANCELED_WARNING"
|| $event.eventType == "POLICY_CANCELED_CRITICAL")
,"severity": "0"
#end
}
#end
#end
]
}

Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Casting Call: Compete in Cyber Games

Lights, Camera, SecOps: Apply to Compete in Cyber Games     Think you have what it takes to beat the clock? ...

Announcing Modern Navigation: A New Era of Splunk User Experience

We are excited to introduce the Modern Navigation feature in the Splunk Platform, available to both cloud and ...

How Edge Processor's Durable Queue Works

Edge Processor sits in one of the most consequential places in any Splunk pipeline: between your data sources ...