Splunk AppDynamics

Data collector Error

Gopi_Krishnan
Explorer

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

Labels (1)
Tags (1)
0 Karma
1 Solution

Morelz
Motivator

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

View solution in original post

0 Karma

Morelz
Motivator

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

0 Karma

Gopi_Krishnan
Explorer

Thanks for this.

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.
Get Updates on the Splunk Community!

Introduction to Splunk AI

How are you using AI in Splunk? Whether you see AI as a threat or opportunity, AI is here to stay. Lucky for ...

Splunk + ThousandEyes: Correlate frontend, app, and network data to troubleshoot ...

Are you tired of troubleshooting delays caused by siloed frontend, application, and network data? We've got a ...

Maximizing the Value of Splunk ES 8.x

Splunk Enterprise Security (ES) continues to be a leader in the Gartner Magic Quadrant, reflecting its pivotal ...