I am trying to split transactions based on specific content in a method's string parameter, but can't seem to get the getter chains to work the way I want it to.
The entry method signature is like this: invoke(String x). The content of x is typically something like this: <msg>NEW</msg>
If I configure the Getter Chain to be toString() then the string correctly appends to the Transaction name (i.e. TXN-<msg>NEW</msg>)
But if I configure the Getter Chain to be toString().indexOf("NEW"), it ends up always returning -1 which means it's not found. I am expecting it to return 5 so that the transaction name resolves to TXN-5.
Is there a way this can be done or am I misusing getter chains here?
I found the answer to my question. When passing String parameters in the Getter Chain, we don't need to include quotes. So instead of toString().indexOf("NEW") we should use toString().indexOf(NEW)
There are other caveats too. I found the answer in the documentation here:
https://docs.appdynamics.com/display/PRO41/Getter+Chains+in+Java+Configurations