Customize parsing strategies
- UpdatedApr 3, 2025
- 2 minutes to read
- Vancouver
- Service Mapping
You can modify parsing strategies that come as part of the base system or add new ones. Parsing strategies are part of discovery patterns, which Service Mapping and Discovery use to discover and map configuration items (CIs).
Before you begin
Practical knowledge of Java scripting is required.
Role required: pd_admin
About this task
Parsing serves to analyze syntax of the source file. You extract values from parsed files, which allows you to convert these values into variables. There are standard parsing strategies, which are part of the base system. If you cannot extract data using the standard parsing strategies, you can create your own parsing strategy. Custom parsing strategies are JavaScript files.
- You may use the content variable to refer to the raw data resulting from executing the operation.
- Use rtrn to indicate the string, which is the result of your custom parsing.
- The script output must be in well-formed XML syntax.
For example, the output must contain correct tags and markup:
- If necessary, you may use third-party JavaScripts to convert the content
into XML.
For example, to convert the content from JSON into XML, use the X2JS JavaScript provided by open-source software.
Procedure
What to do next
Use this custom parsing strategy for defining operations inside pattern steps.