Other Functions

  • xpath(data, expression [,resultType]) - performs an XPath function on the first parameter value. Data must contain XML (so depends on the serializer used for events). The resultType may be specified to indicate if you want to have an XML node, an XML nodelist, a string or a number returned.

  • jsonpath(data, expression) - performs a jsonpath function on the first parameter value. Data must contain JSON

  • formatDate(timestamp, [format [,timezone]]) - formats a timestamp to a string using the specified format. The timezone is optional and defaults to the server’s timezone. The format follows the Java SimpleDateFormat conventions. If no format is specified, it defaults to yyyy-MM-dd HH:mm:ss.

  • concat(listData, delimiter) - concatenates all elements in the listData to a single string, with delimiter between the elements.

  • left( data, n ) - returns the first n characters from data. If data is shorter than n it returns the whole string,

  • right( data, n ) - returns the last n characters from data. If data is shorter than n it returns the whole string,

  • length( data ) - returns the length of the string

  • lower( data ) - converts string to lowercase

  • upper( data) - converts string to uppercase

  • substring( data, first [, last]) - returns substring from first to end of string or last (exclusive). If string is shorter than first it returns an empty string.

  • hour(timestamp)

  • minute(timestamp)

  • day(timestamp)

  • week(timestamp)

  • month(timestamp)

  • year(timestamp)

  • metaData(key) - returns the value of the metadata key for the event. If the key does not exist, it returns an empty string.

  • data contains searchString - returns true if the data contains the searchString, false otherwise.

  • data in [value1, value2, …​] - returns true if the data is equal to any of the values in the list, false otherwise. The values in the list can be strings, numbers or booleans.

Examples

select( xpath(payloadData, "//customerId") as customerId)

Gets the first customerId in the payloadData.

xpath(payloadData, "count(//customerId)", "NUMBER") > 10

Returns events with more than 10 customerId elements in the payload.

select(jsonpath(payloadData, "$.book[*].title") as titles)

Gets the titles for all books.