Comment on page
XML File Parsing Plugin
The XML input plugin allows to continuously read XML files within a given folder. The plugin can search for a given pattern in the naming of the files and also can be set to read-only files after a given timestamp of the modification or access date. The plugin is able to remember the timestamp of the last read file and therefore detects new files and changes in already uploaded files.
[Edge Main Folder]/configs/configurations/InputPlugins/XMLFileParsing
These configs are only used for the Edge instance Luna.Console, executed directly from the [Edge Main Folder]. Click the "Service Application" tab above to check the location for Edge services.
You can install several SF Edge service instances onto one device - for example to collect data of several machines from a local data collection device. Each service instance needs it's own set of configurations. When using the Senseforce Edge Service Installer, the default configurations are automatically installed for any service.
The default DataMappings.xml can be used for most use cases.
The XmlFileParsingSettings.xml defines where to find the XML files to read, how often to look for new files, and which timestamp to use to decide if the file has to be uploaded.
<?xml version="1.0" encoding="utf-8" ?>
<!-- Definition of files to read -->
<!-- First file criteria definition (does not have to be a single file) -->
<!-- Definition of the file directory path (withoud file name) -->
<!-- Regex used to identify the file(s) to parse -->
<!-- Defines if files in subdirectories of "FilePath" should also be read or not -->
<!-- Define oldest date of files to read -->
<!-- If set to -1, any file is read. If set to 0, all files since Luna startup are read. Otherwise it is interpreted as Unix timestamp in milliseconds -->
<!-- Define which timestampl should be used for "MinimumTimestampToRead" condition (Allowed values: LastWriteDateTime, LastAccessDateTime) -->
<!-- Time interval for polling for new files or lines in files (in seconds) -->
<!-- Defines whether to check if the file is open in another process -->
<!-- Defines the location of the file where information of last read files and lines in files are stored -->
<!-- Defines which XML attribute contains the name of the variable -->
<!-- Add several more instances of File here... -->
<!--Specify file for message mapping-->
<!--Specify file for logging-->
In the Files section, multiple File entries can be defined.
This plugin preserves the hierarchy information by concatenating the node names of all levels of hierarchy and attribute names separated by an underscore ("_"). So for example, if we would use the configuration file shown above the plugin reads the FilePath setting in line 7 as:
Underscores in node names or attribute names are allowed to use, but has to be considered that they are also included in the variable name e.g. in the EventDefintion.
This setting defines the name of an attribute in the data XML files which is only used for the naming, but not as data itself. To understand what this means consider the following very simple XML file as input data:
</Node machine="ASX1000" speed=100>
If no value is assigned to the setting "NameAttribute" or if this setting isn't defined at all the XML file example above would be read as:
If we set <NameAttribute>machine</NameAttribute> in the XMLFileParsing settings the example file above would be read as: