cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Not a customer? Start a free trial

Click the Start a free trial link to start a 15-day SaaS trial of our product and join our community as a trial user. If you are an existing customer do not start a free trial.

AppDynamics customers and established members should click the sign in button to authenticate.

Java (Java Agent, Installation, JVM, and Controller Installation)

Data collector Error

SOLVED
Gopi.Krishnan
Builder

Data collector Error

Hi,

 

I have created a data collector for a particular response to be captured. I want only a certain part of it to be captured and am using the split function. So the response is below

 

Success
{
"data": {
"customerId": "1128477",
"contactInformation": {
"email": "test_1@test.com",
"mobileCountryCode": "0091",
"mobileNumber": "1234567890"

 

I want to capture the customerId and the data collector I am using is

getData().toString().split("customerId":).[1].split(,).[0] 

and this gives me output 

[CANNOT EVALUATE: No target specified]

 

Am I missing something or doing something wrong? The initial part getData().toString() gives me all the response details but when I try to split it to capture customerId then it gives me the above error. Please help

 

Regards,

Gopikrishnan

Tags (1)
By replying you agree to the Terms and Conditions of the AppDynamics Community.
Data collector Error
2 REPLIES 2
Mario.Morelli
Architect

Re: Data collector Error

Hi there

 

There are special characters you have to escape e.g commas

 

A working getter chain would be like

This will also remove the " and just return the number

getData().toString().split(customerId": ).[1].split(").[0]

 

To change your one to a working one it would like below

getData().toString().split("customerId":).[1].split(\,).[0]

 

Ciao



Learn more about me in the Community Member Spotlight Q & A
Gopi.Krishnan
Builder

Re: Data collector Error

Thanks for this.