Splunk AppDynamics

How to create mobile apps Custom Event alert and respond send eamil.

CommunityUser
Splunk Employee
Splunk Employee

Hi all,

Create a Custom Event

You can create custom events to be reported in the AppDynamics event viewer and in the event's 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 the 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****

[Redacted]

)

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

How can I solve it?

^ Post edited by @Ryan.Paredez to remove Controller URL. Please do not share your Controller URL for Privacy and Security reasons.

Labels (3)
Tags (1)
0 Karma

Yogesh_Chouk
Builder

Hi

Could you please try below and let us know if it helps. 

 

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

 

Thanks,

Yogesh

0 Karma

CommunityUser
Splunk Employee
Splunk Employee

Hi,

This is the rest api I've been using.

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 =value2

The summary has been defined, but always prompts HTTP / 1.1 400 Event summary is not specified. what should I do? 

0 Karma

Yogesh_Chouk
Builder

Hi,

Can yo please try as suggested earlier? We have suggested to use '\' before &summary=test1.

Kindly try above and let us know if that helps. Please share screenshot of request and response both in case if you still face an issue.

Thanks,

Yogesh

0 Karma

CommunityUser
Splunk Employee
Splunk Employee

Hi,

Thanks for your reply and help,I try the same as you said,but not yet successful.

curl -i -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

 Include an error screenshot:

image.png

HTTP/1.1 500 Internal Server Error;

and If  remove '\' screenshot:

image.png

 

0 Karma

Yogesh_Chouk
Builder

Hi,

We checked for the error logs into your saas account 'hsbccmbtest' and it was as below.

Caused by: javax.ejb.AccessLocalException: Client not authorized for this invocation
	at com.sun.ejb.containers.BaseContainer.preInvoke(BaseContainer.java:1960)
	at com.sun.ejb.containers.EJBLocalObjectInvocationHandler.invoke(EJBLocalObjectInvocationHandler.java:210)

 It looks like you do not have enough permissions to create a custom events. To create the event, user need an Admin or Account owner role. Please assign the admin or account owner role to yourself and execute the rest api suggested by us ealier i.e including '\'. Let us know if you face any issues after this.

Thanks,

Yogesh

0 Karma

Yogesh_Chouk
Builder

Hi,

Can you go through the below link and let us know if it helps.

https://stackoverflow.com/questions/15089000/how-can-pass-multiple-parameters-in-nsurl-string-in-ios

Thanks,

Yogesh

0 Karma

CommunityUser
Splunk Employee
Splunk Employee

Hi yogesh.chouk ,

Can you help me solve the new problem?

I do not know how to start, thanks

0 Karma

CommunityUser
Splunk Employee
Splunk Employee

Hi,

Thank you very much . I will find an account to try again,

Still have a problem,Use curl to send the request in the terminal,how should I send a request in iOS code?

Because apm not only need username and password also need an Account,and we do not use libcurl.

The following is my post request in the code:

Always can not send success,how do I add an account password?

NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"https://hsbccmbtest.saas.appdynamics.com/controller/rest/applications/HSBCNET_SDE4/events?severity=WARN&eventtype=CUSTOM\&summary=test1&customeventtype=mycustomevent&propertynames=hostName&propertyvalues=failed"]];

NSMutableURLRequest *request =[NSMutableURLRequest requestWithURL:url];
request.HTTPMethod = @"POST";
NSString *args=[NSString stringWithFormat:@"janice_***@hsbccmbtest:janice****"];
request.HTTPBody = [args dataUsingEncoding:NSUTF8StringEncoding];
NSURLSession *session = [NSURLSession sharedSession];

NSURLSessionDataTask *sessionDataTask = [session dataTaskWithRequest:request completionHandler:^(NSData * _Nullable data, NSURLResponse * _Nullable response, NSError * _Nullable error) {
NSLog(@"%@",data);
}];
[sessionDataTask resume];

 This is the result of sending,failure:

image.png

Please forgive me for this stupid question,haha, Whether it can provide help or whether there is a demo? Thanks again.

0 Karma
Get Updates on the Splunk Community!

Say goodbye to manually analyzing phishing and malware threats with Splunk Attack ...

In today’s evolving threat landscape, we understand you’re constantly bombarded with phishing and malware ...

AppDynamics is now part of Splunk Ideas

Hello Splunkers, We have exciting news for you! AppDynamics has been added to the Splunk Ideas Portal. Which ...

Advanced Splunk Data Management Strategies

Join us on Wednesday, May 14, 2025, at 11 AM PDT / 2 PM EDT for an exclusive Tech Talk that delves into ...