NodeBrain  Demonstration Site
A Rule Engine for State and Event Monitoring     

TuesOfWeekOfLastFriday

Next  Prior  Up        Home        
Suppose you need to watch for a condition, but only on the Tuesday of the week of the last Friday of the month. In this demonstration a time condition is used for this purpose.
Tutorial: Time Conditions     Language: Time Expressions Show Forecast

Rules

Transactions

Log

again after modifications.     Reset to orignal rules and transactions.

N o d e B r a i n   0.9.04 (Columbo) 2015-09-24
Spec 0.0.904 built for x86_64-redhat-linux-gnu
Copyright (C) 2014-2015 Ed Trettevik <eat@nodebrain.org>
MIT or NodeBrain License
----------------------------------------------------------------
/usr/bin/nb = ++safe 
Date       Time     Message
---------- -------- --------------------------------------------
2017-06-23 15:21:08 NB000I NodeBrain nb[24684] apache@ip-172-31-40-21.us-west-2.compute.internal
2017-06-23 15:21:08 NB000I Argument [1] =
2017-06-23 15:21:08 NB000I Reading from standard input.
---------- --------
Rules
| define r1 on(a=1 and b="abc" and ~(tu.w.fr[-1]n));
Transactions
| assert a=1,b="abc"; # what happens depends on day
| show /c
~ 2017-06-23 15:21:08 Clock
~ 2017-06-27 00:00:00 ~(tu.w.fr[-1]n)
                      on((a=1)&((b="abc")&~(tu.w.fr[-1]n)));
| forecast ~(tu.w.fr[-1]n);
tu.w.fr[-1]n schedule ~0-0 interval=0,duration=0)
tu 2017-06-27 00:00:00 1498521600 - we 2017-06-28 00:00:00 1498608000 
tu 2017-07-25 00:00:00 1500940800 - we 2017-07-26 00:00:00 1501027200 
tu 2017-08-22 00:00:00 1503360000 - we 2017-08-23 00:00:00 1503446400 
tu 2017-09-26 00:00:00 1506384000 - we 2017-09-27 00:00:00 1506470400 
tu 2017-10-24 00:00:00 1508803200 - we 2017-10-25 00:00:00 1508889600 
tu 2017-11-21 00:00:00 1511222400 - we 2017-11-22 00:00:00 1511308800 
tu 2017-12-26 00:00:00 1514246400 - we 2017-12-27 00:00:00 1514332800 
tu 2018-01-23 00:00:00 1516665600 - we 2018-01-24 00:00:00 1516752000 
tu 2018-02-20 00:00:00 1519084800 - we 2018-02-21 00:00:00 1519171200 
tu 2018-03-27 00:00:00 1522108800 - we 2018-03-28 00:00:00 1522195200 
tu 2018-04-24 00:00:00 1524528000 - we 2018-04-25 00:00:00 1524614400 
tu 2018-05-22 00:00:00 1526947200 - we 2018-05-23 00:00:00 1527033600 
tu 2018-06-26 00:00:00 1529971200 - we 2018-06-27 00:00:00 1530057600 
tu 2018-07-24 00:00:00 1532390400 - we 2018-07-25 00:00:00 1532476800 
tu 2018-08-28 00:00:00 1535414400 - we 2018-08-29 00:00:00 1535500800 
tu 2018-09-25 00:00:00 1537833600 - we 2018-09-26 00:00:00 1537920000 
tu 2018-10-23 00:00:00 1540252800 - we 2018-10-24 00:00:00 1540339200 
tu 2018-11-27 00:00:00 1543276800 - we 2018-11-28 00:00:00 1543363200 
tu 2018-12-25 00:00:00 1545696000 - we 2018-12-26 00:00:00 1545782400 
tu 2019-01-22 00:00:00 1548115200 - we 2019-01-23 00:00:00 1548201600 
tu 2019-02-19 00:00:00 1550534400 - we 2019-02-20 00:00:00 1550620800 
tu 2019-03-26 00:00:00 1553558400 - we 2019-03-27 00:00:00 1553644800 
tu 2019-04-23 00:00:00 1555977600 - we 2019-04-24 00:00:00 1556064000 
tu 2019-05-28 00:00:00 1559001600 - we 2019-05-29 00:00:00 1559088000 
tu 2019-06-25 00:00:00 1561420800 - we 2019-06-26 00:00:00 1561507200 
tu 2019-07-23 00:00:00 1563840000 - we 2019-07-24 00:00:00 1563926400 
tu 2019-08-27 00:00:00 1566864000 - we 2019-08-28 00:00:00 1566950400 
tu 2019-09-24 00:00:00 1569283200 - we 2019-09-25 00:00:00 1569369600 
tu 2019-10-22 00:00:00 1571702400 - we 2019-10-23 00:00:00 1571788800 
2017-06-23 15:21:08 NB000I NodeBrain nb[24684] terminating - exit code=0