Event Schedule 1.0.9 - Date token addition and subtraction!

Yesterday's releases for Event Schedule introduced the ability to include simple date tokens in the Scheduled log message, Scheduled log description, and Scheduled log tags fields.

These were based entirely on returning the current day, month, or year - but what if you want to reference last month, next month, yesterday, or 10 years ago?

I've therefore allowed simple addition and subtraction operations on the date tokens, so if you want to express last month as a long name, you can simply configure {MMMM-1}. If the current month is July, then it will return June.

This is not a fix for all scenarios, because it's not applying to the whole date. If you want to express:

{D} {MMM-1} {yyyy-1}

and  run this on the 1st of every month - that should be okay, it will return;

1 Jun 2020.

But if you want to do the same on the last day of the month, you might run into trouble given that the previous month end could have been 28, 29, 30, or 31. We don't handle that, because these are simple tokens and not full date expressions.

Nonetheless, this is a useful addition that can provide cases like creating a Jira ticket titled "Scheduled Maintenance Review for June 2021" on the 1st July.

As the tokens are still a new feature, I've updated the token reference table from yesterday below!

TokenSubstitute
{d}
{d+[nn]}
{d-[nn]}

Current Day as digit (eg. 1, 26, etc)
Optionally add/subtract days

{dd}
{dd+[nn]}
{dd-[nn]}
Current Day as digit with padding zero where needed (eg. 01, 26, etc)
Optionally add/subtract days
{ddd}
{ddd+[nn]}
{ddd-[nn]}
Current short day name (eg. Mon, Fri, etc)
Optionally add/subtract days
{dddd}
{dddd+[nn]}
{dddd-[nn]}
Current long day name (eg. Monday, Friday, etc)
Optionally add/subtract days
{M}
{M+[nn]}
{M-[nn]}
Current Month as digit
Optionally add/subtract months
{MM}
{MM+[nn]}
{MM-[nn]}
Current Month as digit with padding zero where needed 
Optionally add/subtract months
{MMM}
{MMM+[nn]}
{MMM-[nn]}
Current short month name
Optionally add/subtract months
{MMMM}
{MMMM+[nn]}
{MMMM-[nn]}
Current long month name
Optionally add/subtract months
{yy}
{yy+[nn]}
{yy-[nn]}
Two digit year (eg. 20, 21, etc)
Optionally add/subtract years
{yyyy}
{yyyy+[nn]}
{yyyy-[nn]}
Four digit year (eg. 2020, 2021, etc)
Optionally add/subtract years

As noted yesterday - although tags are presented above as lower and upper case, the replacement is not case sensitive. This does not strictly follow standard .NET formatting rules - it is a simple token substitution for convenience, with some enhancements  to allow addition and subtraction.

I've also added a checkbox to allow you to enable or disable including the Description in the log message text. By default it is switched off. 

Reminder - If you have an existing install of Event Schedule with existing instances configured, the instances may stop due to addition of the Include description with log message field.

To resolve, you simply need to go into each app and save the config - remember to turn the Include Description with log message setting on if you want the previous behaviour to continue!

You can update your existing install from within Seq, install Event Schedule to your Seq instance using the Seq.App.EventSchedule Nuget tag, or reflect on the fanciness of the links below!

Comments

You may also like:

Event Timeout - A super powered event monitoring app for Seq

"Something hasn't happened!" My workplace has quite a number of disparate applications and scripts that drive critical SLAs. Historically, these were managed by exception and emailing errors to various mailboxes. This is a fairly poor approach to managing SLAs, since it is reliant on a human factor - someone...

Event Timeout for Seq v1.4.2 released

A new release of Seq.App.EventTimeout is out. This was a little earlier than I planned to release v1.4.x, but there was a bug in the AbstractAPI deserialization as a result of some code refactoring which I'd missed. As usual, you can install Event Timeout for Seq using Seq.App.EventTimeout as the...