Splunk AppDynamics

How to pull out an array length

Sean_Davey
Path Finder

Hi

I am looking to be able to pull some different information out of an array that is being collected. 

[Array (size 1):
<?xml version="1.0" encoding="utf-8"?>
<ValidationException inSyncReferenceResolution="false" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >
<creationDate>2020-05-19T06:36:50.196</creationDate>
<typeCode>3</typeCode>
<exceptionMessageCode>
     <messageCode>43</messageCode>
    <codeDomainName>ClaimReviewMessageCode</codeDomainName>
    <messageDescription>Claim requires manual review because the provider is not         contracted</messageDescription>
     <policyName>ReviewNonParProviderClaim</policyName>
</exceptionMessageCode>
</ValidationException>
]

1.the length of the array out using a getter chain.  I used the information below to try to pull the length but It keeps telling me it is invalid.

getUrl().split(\.).length 

 2. the message code which in this example is "43"

getURL.get(int/3).split().[1]

Thanks

Labels (1)
Tags (2)
0 Karma

Morelz
Builder

Hi There

I will check on the length one, should be straightforward

To strip out e.g typeCode, you can use below, I use this quite a lot

toString().split(<typeCode>).[1].split(</typeCode>).[0]

Ciao

Get Updates on the Splunk Community!

Fueling your curiosity with new Splunk ILT and eLearning courses

At Splunk Education, we’re driven by curiosity—both ours and yours! That’s why we’re committed to delivering ...

Splunk AI Assistant for SPL 1.1.0 | Now Personalized to Your Environment for Greater ...

Splunk AI Assistant for SPL has transformed how users interact with Splunk, making it easier than ever to ...

Unleash Unified Security and Observability with Splunk Cloud Platform

     Now Available on Microsoft AzureOn Demand Now Step boldly into the AI revolution with enhanced security ...