You need to parse the unstructured data in a log file and write the data to a target file in relational format.
You need to configure an
intelligent structure model
that analyzes unstructured data and discovers its structure.
The following image shows the log file that you want to parse:
Create the
intelligent structure model
in
Data Integration
. The following image shows the
intelligent structure model
details:
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 transformation with a flat file object 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. Configure it to use the
intelligent structure model
that you configured. Select the relational output type.
You connect the source object to the Structure Parser transformation. To map the incoming data
to the fields of the transformation, select the Structure Parser transformation. On the
Field Mapping
tab, map
FIELD1
to the
structure parser input field
FilePath
.
The following image shows the field mapping:
Add a Target transformation with a flat file object for the parsed output group that you want
to process. Name the transformation TargetFile. Add a separate Target transformation
named Unidentified for data that was not identified.
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:
If you need to further parse the data, you can include additional Structure Parser transformations midstream that will parse the output from the preceding parser.