Splunk AppDynamics

How to send a custom event in the code to the APM, receive a custom event automatically send email ?

CommunityUser
Splunk Employee
Splunk Employee

How to send a custom event in the code to the APM, receive a custom event automatically send email ?

Labels (1)

Atyuha_Pal
Contributor

Hi,

1.Please refer to the below doc  for creating a custom event

https://docs.appdynamics.com/display/PRO43/Alert+and+Respond+API#AlertandRespondAPI-CreateaCustomEve...

2. Please refer to the below doc to create actions in the policy to execute

https://docs.appdynamics.com/display/PRO41/Actions

Thanks,

Atyuha

CommunityUser
Splunk Employee
Splunk Employee

Hi,

I customize the event according to the document,

Create a Custom Event

You can create custom events to be reported in the AppDynamics event viewer and in the events panels on the AppDynamics dashboards. See Monitor Events  to learn how to filter on your custom events so that you can find them. Then you can create alerts triggered by these events as you do for AppDynamics standard events.

You should receive the event ID after successful invocation of the request.

URI 

POST /controller/rest/applications/application_id/events

Input parameters

I created a post request based on the document ( 

curl -X POST --user janice_****@hsbccmbtest:janice****https://hsbccmbtest.saas.appdynamics.com/controller/rest/applications/HSBCNET_SDE4/events?severity=INFO&summary=test1&eventtype=CUSTOM&customeventtype=mycustomevent&propertynames=key1&propertyvalues=value1&propertyvalues=value

)

 

Run on the terminal  , Always prompts HTTP / 1.1 400 Event summary is not specified

(

curl -i -X POST --user janice_wang@hsbccmbtest:janiceWang1 https://hsbccmbtest.saas.appdynamics.com/controller/rest/applications/HSBCNET_SDE4/events?severity=I...

[1] 11428

[2] 11429

[3] 11430

[4] 11431

[5] 11432

[6] 11433

[7] 11434

[2]   Done                    summary=test1

[3]   Done                    eventtype=CUSTOM

[4]   Done                    customeventtype=mycustomevent

[5]   Done                    propertynames=key1

[6]-  Done                    propertynames=key2

[7]+  Done                    propertyvalues=value1

MacBook-Air:~ h$ HTTP/1.1 400 Event summary is not specified

Server: AppDynamics

Set-Cookie: JSESSIONID=3a55b83eece7144710e3795baae9; Path=/controller; HttpOnly;Secure

Content-Language:

Content-Type: text/html

Date: Fri, 13 Oct 2017 02:52:04 GMT

X-Varnish: 1574221971

Age: 0

Via: 1.1 varnish

Connection: keep-alive

Set-Cookie: visid_incap_962359=UJiixdR9QJ+R8G2a8UjDAlQq4FkAAAAAQUIPAAAAAACinpDeYOaZjjor3TsDCmOJ; expires=Fri, 12 Oct 2018 07:59:18 GMT; path=/; Domain=.saas.appdynamics.com

Set-Cookie: nlbi_962359=WCcKQpDvG2RgvM7NCyMyLAAAAACPojL7pEZnrMVzXO+HxSBQ; path=/; Domain=.saas.appdynamics.com

Set-Cookie: incap_ses_628_962359=cL02JzNTO1XGFTdhFxu3CFQq4FkAAAAA6IR3yu9+35OVzYCSjA/7SA==; path=/; Domain=.saas.appdynamics.com

X-Iinfo: 8-93532647-93532677 NNNN CT(0 0 0) RT(1507863124187 237) q(0 0 0 0) r(2 2) U6

X-CDN: Incapsula

Transfer-Encoding: chunked

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>AppDynamics - Error report</title><style type="text/css"><!--H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A {color : black;}HR {color : #525D76;}--></style> </head><body><h1>HTTP Status 400 - Event summary is not specified</h1><hr/><p><b>type</b> Status report</p><p><b>message</b>Event summary is not specified</p><p><b>description</b>The request sent by the client was syntactically incorrect.</p><hr/><h3>AppDynamics</h3><script type="text/javascript">

//<![CDATA[

(function() {

var _analytics_scr = document.createElement('script');

_analytics_scr.type = 'text/javascript'; _analytics_scr.async = true; _analytics_scr.src='/_Incapsula_Resource?SWJIYLWA=719d34d31c8e3a6e6fffd425f7e032f3&ns=1&cb=53430638';

var _analytics_elem = document.getElementsByTagName('script')[0]; _analytics_elem.parentNode.insertBefore(_analytics_scr, _analytics_elem);

})();

// ]]>

)

How can i solve it?

0 Karma
Get Updates on the Splunk Community!

Splunk AI Assistant for SPL | Key Use Cases to Unlock the Power of SPL

Splunk AI Assistant for SPL | Key Use Cases to Unlock the Power of SPL  The Splunk AI Assistant for SPL ...

Buttercup Games: Further Dashboarding Techniques (Part 5)

This series of blogs assumes you have already completed the Splunk Enterprise Search Tutorial as it uses the ...

Customers Increasingly Choose Splunk for Observability

For the second year in a row, Splunk was recognized as a Leader in the 2024 Gartner® Magic Quadrant™ for ...