DQL
Questions about Dynatrace Query Language
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Parse a string with special characters

slhempen
Newcomer

I have this string in a message field that needs to be parsed.  I need the values between the double quotes extracted into separate fields.  I am having a hard time getting the correct syntax to handle eliminating '<', '/>', and '"'.

<Robotics UseCase="UC987" Workstation="WTWABCDE" UserID="xxxx" Department="HR" Segment="Express" Automation="GetConfigData" MessageType="Failure" Message="Subflow: GetConfigData, Action: 28, Action name: Set variable; Variable 'Config_Global' doesn't have a property 'LogSegment'." ClaimNumber="1345089A5" TaskID="" />

 

Thanks,

Steve

1 REPLY 1

dannemca
DynaMight Guru
DynaMight Guru

A very simple parsing would be:

LD 'Robotics UseCase="' LD:RoboticUseCase '"' LD 'Workstation="' LD:Workstation '"' LD 'UserID="' LD:UserID '"' LD 'Department="' LD:Department '"' LD 'Segment="' LD:Segment '"' LD 'Automation="' LD:Automation
'"' LD 'MessageType="' LD:MessageType '"' LD 'Message="' LD:Message '"' LD 'ClaimNumber="' LD:ClaimNumber '"' LD 'TaskID="' LD

The only field not able to include in the above parsing rule was the TaskID since empty, and will requires a different parsing rule.

Try and let us know.

Site Reliability Engineer @ Kyndryl

Featured Posts