Splunk AppDynamics

Re: How to use an API to enable or disable health rules and policies

CommunityUser
Splunk Employee
Splunk Employee

@Narendra.Reddy

  

How can i delete de health rule of a especific application?

Thanks.

[This question originated on this article: How to use an API to enable or disable health rules and policies

Labels (3)
0 Karma

Yogesh_Chouk
Builder

Hi,

We do not have REST API to delete the health rule. However, here is the way to do delete health rules:

 

  • Get the Health rule Id using below command from the database
Select id, name from policy where name like '%health_rule_name%';
  • Get the JESSIONID and X-CSRF-TOKEN for the user having login access to controller UI:
curl -i --user admin@customer1:admin http://localhost:8090/controller/auth?action=login

HTTP/1.1 200 OK
cache-control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: Thu, 01 Jan 1970 00:00:00 GMT
Set-Cookie: JSESSIONID=8edd9e48f2ec26cbeeb6f24126b5; Path=/controller; HttpOnly
Set-Cookie: X-CSRF-TOKEN=46f1d4590d4955d55a1428e53b8d495fd57bdcd7
Date: Fri, 28 Jul 2017 11:21:15 GMT
Content-Length: 0

  • Run the following CURL call with JESSIONID and X-CSRF-TOKEN from step 1?
curl -X POST -H "Cookie:JSESSIONID=8edd9e48f2ec26cbeeb6f24126b5;" -H "X-CSRF-TOKEN:46f1d4590d4955d55a1428e53b8d495fd57bdcd7" -H "Content-Type: application/json" -H "Accept: application/json" http://localhost:8090/controller/restui/health_rules/delete -d [Health_rule_ids]


PS: replace localhost, port and credentials and Health_rule_ids as required.

Thanks,

Yogesh

Get Updates on the Splunk Community!

Fueling your curiosity with new Splunk ILT and eLearning courses

At Splunk Education, we’re driven by curiosity—both ours and yours! That’s why we’re committed to delivering ...

Splunk AI Assistant for SPL 1.1.0 | Now Personalized to Your Environment for Greater ...

Splunk AI Assistant for SPL has transformed how users interact with Splunk, making it easier than ever to ...

Unleash Unified Security and Observability with Splunk Cloud Platform

     Now Available on Microsoft AzureOn Demand Now Step boldly into the AI revolution with enhanced security ...