Many systems export data in XML format. This section describes how to ingest XML into IDOL using NiFi Ingest.
The steps in this section assume that:
To ingest XML
Add a GetFileSystem processor to your data flow to retrieve the XML file(s).
adv:FlowFileEmbedFiles
to TRUE. For more information about this property, see Advanced Connector Properties.Configure the ExecuteDocumentLua processor.
Right-click the processor and click Configure.
The Configure Processor dialog box opens.
Click ADVANCED.
The advanced configuration page opens.
Copy the example script into the Lua code area.
The script uses the parse_document_xml function to parse the input file. If the incoming FlowFile contains a filename, this is passed directly to the function. If the incoming FlowFile contains an embedded file, the data is read and passed to the parse_document_xml function as a string.
xmlParams
table so that they are suitable for your XML. For example, the document_root_paths
option is a list of paths to elements that represent the root of a document in the input XML. For more information about these options, refer to the documentation for the parse_document_xml function.Connect the "returned" relationship of the ExecuteDocumentLua processor to your ingestion pipeline. The resulting documents are output to the "returned" relationship because they are explicitly returned from the handler
function in the Lua script.
The original FlowFiles that were routed to the ExecuteDocumentLua processor are routed to the "success" relationship. You can auto-terminate this relationship to avoid indexing a document containing all of the original XML.
Start the GetFileSystem and ExecuteDocumentLua processors.
|