Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- tellem
- ----
- tellem dsl for extracting telemetry from json and xml and any other input that has a path lang for extracting content from messages
- ### NOTES
- * first implementation in scala and antlr
- * embeddable
- * uses jsonpath for first impl, xpath eventually, support for other path langs should be plugable
- * eventual support of first class logic programming as an ai frontend
- ### FEATURES
- 1. variables
- 2. assertions
- 3. yield template
- * keywords: set, def, assert, template, int, string, float, datetime, eq, ne, lt, gt, lte, gte, pathlang, now
- * comments follow # to end of line
- * use 'now' if you want clock time as telemetry time
- * in the future, will support basic math in an assertion like totalCount / goodCount
- * whitespace within a line is ignored
- * a tellem defines any number of variables with paths
- * all variables are optional types of either string, int, float, or datetime
- * a tellem defines any number of assertions that reference the variables
- * an assertion that references a variable that isEmpty returns false
- * an assertion can use eq, ne, gt, lt, lte, gte
- * there is one implicit assertion: all variables musts resolve
- * if all the assertions are true, a record is formatted and yielded
- ### EXAMPLE
- ```
- set datetime yyy-mo-dd'T'hh-mm-ss.SSSZ
- set pathlang jsonpath
- def device: str($.machineId)
- def time: datetime($.datetime)
- def msgType: str($.payload.type)
- def totalOps: int($.payload.opevent.totalCount)
- def goodOps: int($.payload.opevent.successCount)
- assert msgType eq str(opEvent)
- assert totalOps gt int(12)
- assert goodOps lt int(10)
- template {time} {goodOps} my.telemetry.record.for.device.{device}.lowgoodops.alert
- ```
Add Comment
Please, Sign In to add comment