AppDynamics Knowledge Base

How do I format a getter chain split rule in the data collector?

How do I format a getter chain split rule in the data collector?

Symptoms

Use this split rule if you have an arraylist <String>, and you need to fetch the value of pincode in the data collector so that anyone can use that data collector in analytics to retrieve results.

java.util.ArrayList<String> customerList = new java.util.ArrayList<String>();
customerList.add("name=foo");
customerList.add("pincode=67869");
customerList.add("country=null");
customerList.add("state=LA");

Diagnosis

You create a Java split rule and it's formatted as follows:

getcustomerList.get(1).split("=")[1];

 

However, you try this split rule in the data collector and it doesn't work.

 

Solution

In your Java split rule, format it as follows:

getcustomerList.get(int/1).split(=).[1]

See also: Using Getter Chains - Java

Labels (1)
Comments

Just a small clarification, should this be "int/1" instead of "int/0" in below line?

getcustomerList.get(int/0).split(=).[1]

@Rajendra.Nautiyal? Correction needed?

yes please correct :

getcustomerList.get(int/0).split(=).[1]

to 

getcustomerList.get(int/1).split(=).[1]
Version history
Last update:
‎02-22-2017 03:37 PM
Updated by: