Sometimes the data stream doesn't provide you with all the information you need. For example, timestamp or asset name is in the file name - fe.: "Device1_20180605.dat". Or with REST Server you can get an information about the sender node/application and IP. This article describes what metadata you can get in the PI Connector for UFL.


Table of all the keywords for meta information:

__DSNAMEThe name of the configured data source (on the connector administration page)
__DSDESCRIPTIONData source description  (on the connector administration page)
__DSADDRESSData source address  (on the connector administration page)
__MESSAGEThe content of the current message (line)
__STREAMINFOStream information (described below)



For the File channel, this variable has the following format: filename|modification date|creation date, for example: a.txt|07-Jun-2016 04:35:39.676|03-Jun-2016 02:51:31.173 (replaces PFN parameter in the UFL Interface)

For the REST server channel, this variable has the following format: Source IP Address|Port, for example:|5687

For the REST Client channel, the format is following: Endpoint address and server, for example:|nginx


How to parse meta information?

In the following example for File channel we parse all the meta information as static attributes and create an asset.

FIELD(1).Name = "FileName"
FIELD(2).Name = "TimestampCreated"
FIELD(2).Type = "DateTime"
FIELD(2).Format = "dd-MMM-yyyy hh:mm:ss.nnn",_
FIELD(3).Name = "TimestampModified"
FIELD(3).Type = "DateTime"
FIELD(3).Format = "dd-MMM-yyyy hh:mm:ss.nnn",_
FIELD(4).Name = "StatAttrCol"
FIELD(4).Type = "Collection"
FIELD(5).Name = "Temp"


Data.FILTER = C1=="*"

Temp = __MESSAGE
FileName = ["(*)|*"]
TimestampModified = ["*|(*)|*"]
TimestampCreated = ["*|*|(*)"]
__MESSAGE = Temp
StatAttrCol = Clear()

StatAttrCol = Add("Data Source name",__DSNAME)
StatAttrCol = Add("Data Source description",__DSDESCRIPTION)
StatAttrCol = Add("Data source address",__DSADDRESS)
StatAttrCol = Add("StreamInfo string",__STREAMINFO)
StatAttrCol = Add("Streamdata string",__MESSAGE)
StatAttrCol = Add("File name",FileName)
StatAttrCol = Add("File created",TimestampCreated)
StatAttrCol = Add("File modified",TimestampModified)
StatAttrCol = Add("Processing started",NOW())



The result: