When writing your notification messages you may already have been using GreenLight's expression language without knowing it. By picking a template from the "Expr. Templates" pulldown a code-snippet gets pasted into your message. Later, when the notification is send, this snippet is parsed and replaced with the resulting value.

While the pulldown provides you with a comfortable way of customizing your message, it's not a complete list of all functions available. On the following pages you will find a set of useful functions.



Functions are defined as follows (note: every expression has to start with ${ and end with } ):



Currently the following prefixes are available:




GreenLight specific functions


String manipulation utils


Array manipulation utils

GreenLight specific functions




Object def(Object obj, Object defaultValue)

Returns the defaultValue if obj is null

${gl:def(result, "no result found"))}

int maxInt()

Returns the maximum value an int can have


String concat(String val1, String val2)

Concatenates the two arguments and returns the resulting string

${gl:concat('some', 'value')}

String commonName(String name)

Returns the common server name


String abbreviatedName(String name)

Returns the abbreviated server name


String manipulation functions




boolean isEmpty(String str)

Checks if a String is empty ("") or null


boolean isBlank(String str)

Checks if a String is whitespace, empty ("") or null


String trim(String str)

Removes control characters from both ends of this String

${str:trim(' text ')}

int indexOf(String str, String searchStr)

Finds the first index within a String

${str:indexOf('abcdefg', 'd')}

int lastIndexOf(String str, String searchStr)

Finds the last index within a String

${str:indexOf('abcdefgd', 'd')}

String substring(String str, int start, int end)

Gets a substring from the specified String

${str:substring('aabbaa', 2, 4)}

String substringBefore(String str, String separator)

Gets the substring before the first occurrence of a separator

${str:substringBefore('myServer/acme', '/')}

String substringAfter(String str, String separator)

Gets the substring before the first occurrence of a separator

${str:substringAfter('name@server', '@')}

String[] split(String str, String separator, int max)

Splits the provided text into an array

${str:split("ab:cd:ef", ":", -1}

String replace(String text, String searchString, String replacement)

Replaces all occurrences of a String within another String

${str:replace('some_string', '_', ' ')}

String abbreviate(String str, int maxWidth)

Abbreviates a String using ellipses

${str:abbreviate('some long text', 5)}

String lowerCase(String str)

Converts a String to lower case


String upperCase(String str)

Converts a String to upper case


Array manipulation functions




Object[] subarray(Object[] array, int startIndex, int endIndex)

Produces a new array containing the elements between the start and end indices

${arr:subarray(str:split('ab:cd:ef', ':'), 0, 1}

int getLength(Object array)

Returns the length of an array

${arr:getLength(str:split('ab:cd:ef', ':'))}

Object[] remove(Object[] array, int index)

Removes the element at the specified position from the specified array

${arr:remove(str:split('ab:cd:ef', ':'), 0)}


Combining functions

The following will output the number of Administrator groups for a server:

There are ${arr:getLength(str:split(result.statistics['Server.Administrators'], ',', -1))} Administrator 
groups on server ${gl:commonName(}