Simon icon Simon
Flexible server monitoring

Introducing Simon 5!

Simon version 5 is now available. It is a massive update, introducing a much-requested feature: syncing the Simon data between multiple Macs, plus a Simon Status service, a Link Checker filter, improved Find filter, iMessage and Speak Error notifiers, a new app icon, and much more.

Important: please note that Simon 5 requires a minimum of macOS 10.12 (Sierra), and is a paid upgrade from Simon 4. Purchasers since September 1, 2020 automatically get a version 5 license (that also works in previous versions).

Read the Simon What's New page for details.

Changed text before and after

Is there a way to output the changed text/characters with the surrounding text?

For example let's say:
"...this is a test text that is short..." has changed into "...this is a great text that is short...".
The Block filter would normally output the difference as: "grea". Is there a way to output the difference as: "is a great text"?

Also is there a way to output the changed text before and after the change? So the final output would look like this:

"...is a test text..." was changed into "...is a great text..."

Thanks.

David Sinclair's picture

Re: Changed text before and after

That was actually requested a year ago, and it's high on my feature suggestions list. But hasn't been added yet.

If you're familiar with scripting, it should in theory be possible to do it now in a script-based filter, by looking at the {ServiceResponseText} variable (which has the full text) and finding the {FilterOutputText} (output from the previous filter) and including more context via the script. But that's beyond my meagre scripting ability.

Otherwise, you can wait for me to add a filter variable and/or filter plugin to do this. Since there's been another request for it, I'll bump it up the priority queue, so it might get included in version 3.6 (though no promises; I haven't decided on the features for that yet).

Re: Changed text before and after

Yes that would be a killer feature: To output the two versions (before and after change) of the entire text belonging to each line that has changed, and maybe highlight the changed text in it.
Hope it makes it to ver. 3.6 or Simon Express.

David Sinclair's picture

Re: Changed text before and after

Good news: version 3.7 (in beta soon) has a new Context filter, to output more context around the output of a previous filter. You can choose a number of characters or a delimiter (or both) to extend the context before and after the text.

There are a number of new filter variables to support this, which may be useful for other filters or notifiers too.