File Processor Agent Example – LoggerDatum

<< Click to Display Table of Contents >>

Live > Agents > File Agents > File Processor > Examples >

File Processor Agent Example – LoggerDatum

1.Add LoggerDatum to the *.config file's processors setting, and ensure the following LoggerDatum settings:

 

Setting

Value

Description

LoggerDatum.dateTimeColumnHeaderRegex

DatumUtcDate

DT_LOGGER_DATUM.DATUM_UTC_DT

LoggerDatum.dateTimeUtc

true


LoggerDatum.datumQualifierColumnHeaderRegex

DatumQualifier

DT_LOGGER_DATUM.DATUM_QUALIFIER

LoggerDatum.datumValueColumnHeaderRegex

DatumValue

DT_LOGGER_DATUM.DATUM_VALUE

LoggerDatum.delimiters

&#09;,

The fields are separated by tabs and/or commas.

LoggerDatum.folderWatcherPath

C:\EarthSoft\Live\
LoggerDatum


LoggerDatum.loggerCodeColumnHeaderRegex

LoggerCode

DT_LOGGER.LOGGER_CODE

LoggerDatum.seriesNameColumnHeaderRegex

SeriesName

DT_LOGGER_SERIES.SERIES_NAME; any SERIES_UNIT and SERIES_FUNCTION

LoggerDatum.updateExistingValues

false


 

And default (non-LoggerDatum) settings (or add LoggerDatum.utcOffsetHrs setting):

 

Setting

Value

Description

dateTimeFormats


Empty; determined automatically.

headerLinesRegex


Empty; the file's header is on the first non-empty line in the file (and is only one line).

utcOffsetHrs

-5

DT_LOGGER.UTC_OFFSET_HRS

 

2.Start the agent, and copy the following file to folder C:\EarthSoft\Live\LoggerDatum.

 

 

LoggerCode,SeriesName,DatumUtcDate,DatumValue,DatumQualifier

"ABC","Distance","2018-02-13 06:40:28","2.3",

"ABC","Volume","2018-02-13 06:41:21","4.5","I"

"ABC","Volume","2018-02-13 06:41:43","4.7",

 

 

3.The file's first non-empty line is the header line (because headerLinesRegex is empty); it contains the DT_LOGGER.LOGGER_CODE, DT_LOGGER_SERIES.SERIES_NAME, and DT_LOGGER_DATUM.DATUM_UTC_DT, DATUM_VALUE, and DATUM_QUALIFIER columns.

 

4.For each subsequent line:

a.Find/add the logger row for the LoggerCode, e.g., for the file's second line:

 

LOGGER_CODE

LOGGER_DESC

LIVE_DATA_SOURCE

UTC_OFFSET_HRS

ABC

NULL

folder://COMPUTER_NAME/C:/EarthSoft/Live/LoggerDatum

-5 (= utcOffsetHrs)

 

b.Find/add the series row for the SeriesName to the above logger row (linked via LOGGER_ID), e.g., for the file's second line:

 

SERIES_NAME

SERIES_UNIT

SERIES_FUNCTION

Distance

Any

Any

 

c.Add the datum row for the DatumUtcDate, DatumValue, and DatumQualifier to the above series row (linked via LOGGER_SERIES_ID), e.g., for the file's second line:

 

DATUM_UTC_DT

DATUM_VALUE

DATUM_QUALIFIER

2018-02-13 06:40:28 (LoggerDatum.dateTimeUtc = true; does not use logger row's UTC_OFFSET_HRS)

2.3

NULL