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!

Your Feedback. Our Roadmap. Visit the PX Feedback Booth at .conf26

You use Splunk every day, come and help shape what's next.  Save Your Seat: Product-Focused Sessions at ...

Agentic SOC Triage: Investigating Splunk ES Notables with MCP Server and a Local LLM

The Problem: Too Many Alerts, Too Little Context Security operations teams running Splunk Enterprise Security ...

Painting a Clearer Picture: Creating Cross-Domain Visibility with AI Canvas

Watch Now Painting a Clearer Picture: Creating Cross-Domain Visibility with AI Canvas     Do you ever feel ...