cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Rajendra.Nautiyal
AppDynamics Team (Retired)

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

 

 

Comments
Vijay.Venkatarajulu
AppDynamics Team

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

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

 

Cody.Naumann
AppDynamics Team (Retired)

@Rajendra.Nautiyal? Correction needed?

Rajendra.Nautiyal
AppDynamics Team (Retired)

yes please correct :

 

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

to 

getcustomerList.get(int/1).split(=).[1]
Version history
Last update:
‎12-22-2018 12:07 PM
Updated by:
June 26 Webinar
Discover new Splunk integrations and AI innovations for Cisco AppDynamics.


Register Now!

Observe and Explore
Dive into our Community Blog for the Latest Insights and Updates!


Read the blog here