Loading

SMARTPARSE

gts strings

The SMARTPARSE function parses STRING values, either from a single STRING parameter or from STRING Geo Time Series™, and produces a number of GTS from the parsed data.

The parsing is done according to a regular expression which contains named capturing groups with the Java/.NET syntax, i.e. (?<name>...).

The captured group is interpreted differently based on the syntax of the name.

SyntaxInterpretation
LxxxCaptured content is used as the value of label xxx
TUCaptured group is interpreted as a timestamp in unit U from the UNIX Epoch origin. Valid values for U are s, ms, us, ns
latCaptured group is interpreted as the latitude if another group named lon is also present
lonCaptured group is interpreted as the longitude if another group named lat is also present
elevUCaptured group is interpreted as the elevation in unit U, where U can be m, cm, mm, ft, km, mi, nm (Nautical Mile). The value is parsed as a DOUBLE and converted to a LONG in mm
VTxxxCaptured group is interpreted as a value for a GTS with class xxx. The type of the value is determined by the value of T which can be B(oolean) S(tring) L(ong) or D(ouble)

This function is ideally suited for parsing log messages and producing Geo Time Series™ from their content.

SMARTPARSE is available since version 1.2.13.

Signatures

Examples

NEWGTS 0 NaN NaN NaN 't=0 foo=bar l=42 d=42.1 b=true s=foo0' ADDVALUE 1 NaN NaN NaN 't=1 foo=bar2 l=43 d=43.1 b=false s=foo1' ADDVALUE 2 NaN NaN NaN 't=2 foo=bar l=44 d=44.1 b=true s=foo2' ADDVALUE 3 NaN NaN NaN 't=3 foo=bar2 l=45 d=45.1 b=false s=foo3' ADDVALUE 't=(?<Tus>[0-9]%2B) foo=(?<Lfoo>[^ ]%2B) l=(?<VLlong>[0-9]%2B) d=(?<VDdouble>[^ ]%2B) b=(?<VBbool>(true|false)) s=(?<VSstr>.*)' SMARTPARSE
't=3 foo=bar2 l=45 d=45.1 b=false s=foo3' 't=(?<Tus>[0-9]%2B) foo=(?<Lfoo>[^ ]%2B) l=(?<VLlong>[0-9]%2B) d=(?<VDdouble>[^ ]%2B) b=(?<VBbool>(true|false)) s=(?<VSstr>.*)' SMARTPARSE