Not a customer? Click the 'Start a free trial' link to begin a 30-day SaaS trial of our product and to join our community.
Existing Cisco AppDynamics customers should click the 'Sign In' button to authenticate to access the community
06-23-2020 11:38 AM - last edited on 06-23-2020 03:30 PM by Ryan.Paredez
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
Solved! Go to Solution.
07-05-2020 06:46 AM
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
07-06-2020 03:21 AM
Thanks for this.
User | Count |
---|---|
2 | |
1 | |
1 | |
1 |
Thank you! Your submission has been received!
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form