Splunk AppDynamics

How to export and import custom rules

CommunityUser
Splunk Employee
Splunk Employee

Hey all,

Been trying to export and importing custom made rules configuration through the REST API of Appdynamics.

Right now I can export all servlet custom rules through the REST API. Now I want to import the configuration XML but constantly getting an internal server error. I'm doing something wrong and I don't know what

With postman I enter the following URL:

http://controllername:portnumber/controller/transactiondetection/applicationname/tier/custom/servlet?overwrite=true

I set the action to 'POST'

Add this in the body

<?xml version="1.0" encoding="UTF-8"?>
<custom-match-points controller-version="004-002-007-000">
	<custom-match-point>
		<name> another name </name>
		<business-transaction-name> The name</business-transaction-name>
		<entry-point>SERVLET</entry-point>
		<background>false</background>
		<enabled>true</enabled>
		<match-rule>
			<servlet-rule>
				<enabled>true</enabled>
				<priority>10</priority>
				<excluded>false</excluded>
				<uri filter-type="STARTSWITH" filter-value="/pages/wicket"/>
				<parameters>
					<parameter match-type="check-for-existence">
						<name filter-type="EQUALS" filter-value="the configuration"/>
					</parameter>
				</parameters>
				<properties/>
			</servlet-rule>
		</match-rule>
	</custom-match-point>
</custom-match-points>

As a header I set the Content-Type to application/xml and i set the authorization tab as Basic auth and fill in needed credentials.

Click on send and boom internal server error. My guess its either the authentication (don't think so) something missing in the header (maybe) or something wrong with the body (likely). 

Labels (1)
0 Karma

CommunityUser
Splunk Employee
Splunk Employee

Hi, 

I'm having this same problem, were you able to find resolution?

I've tried the admin account on a brand new app, on a brand new controller so shouldn't be any permissions oddities.  

We're working through a migration from on-prem, and I've successfully been able to export/import healthrules and dashboards.  Just moved onto detection rules and getting this 500 error. 

To simplify things I tried the most basic export with curl based on the doc, that worked fine.  Then tried importing the output of that export again just using curl based on the doc and I consistently get a 500 Internal server error.

0 Karma

CommunityUser
Splunk Employee
Splunk Employee

Can you confirm that the user you are using has access to create health rules for that application?

Or better, run it using AppDynamics root credentials.

curl -X POST --user user1@customer1:secret http://demo.appdynamics.com/controller/healthrules/38 -F file=@uploadhealthrule.xml

user1: root

secret: AppDynamics admin password.

https://docs.appdynamics.com/display/PRO44/Configuration+Import+and+Export+API#ConfigurationImportan...

0 Karma
Get Updates on the Splunk Community!

[Puzzles] Solve, Learn, Repeat: Dynamic formatting from XML events

This challenge was first posted on Slack #puzzles channelFor a previous puzzle, I needed a set of fixed-length ...

Enter the Agentic Era with Splunk AI Assistant for SPL 1.4

  &#x1f680; Your data just got a serious AI upgrade — are you ready? Say hello to the Agentic Era with the ...

Stronger Security with Federated Search for S3, GCP SQL & Australian Threat ...

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...