Structure Parser Transformation Example
You need to parse the unstructured data in a log file and write the data to a target file in a compatible format.
You need to configure an intelligent structure that analyzes unstructured data and discovers its structure.
The following image shows the log file that you want to parse:
Create the intelligent structure in Informatica Cloud. The following image shows a sample intelligent structure:
To parse the log file, use a Structure Parser transformation in a mapping to transform the data in the log file.
In the Mapping Designer, you add a source object that is flat file that contains the path to the log file you want to parse.
The following image shows the selected source file properties:
You add a Structure Parser transformation and specify the name as LogParser. Configure it to use the Node-log structure definition that you configured.
You connect the source object to the LogParser transformation. To map the incoming data to the fields of the transformation, select the LogParser transformation. In the Field Mapping tab, map FIELD1 to the Structure Parser Input Fields.
The following image shows the field mapping:
Add a text file target transformation for the parsed output group that you want to process named TargetFile. Add a separate text file target transformation for data that was not identified named Unidentified.
The following image shows the mapping:
Run the mapping to write the data in a structured format to the TargetFile transformation. The mapping sends any data that was not identified by the intelligent structure to the Unidentified transformation.
The following image shows the parsed data output file from the TargetFile transformation: