Skip to content

Commit bc0b866

Browse files
committed
update expression syntax documentation
Signed-off-by: Shenoy Pratik <sgguruda@amazon.com>
1 parent 26e3d80 commit bc0b866

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

docs/expression_syntax.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,13 @@ Currently, the following functions are supported
184184
- takes one String literal as argument. This is the key to lookup in the event's metadata. If the key contains "/", then recursive lookup into the metadata attributes is done.
185185
- returns the value corresponding to the argument (key) passed. Value can be of any type.
186186
For example, if metadata contains {"key1": "value2", "key2": 10}, then `getMetadata("key1")` returns "value2", and `getMetadata("key2")` return 10.
187+
* `getEventType()`
188+
- Takes no arguments.
189+
- Returns the event type of the given event as a String.
190+
- Throws an error if any arguments are provided.
191+
- Event types is useful from routing requests based on type examples: `LOG`, `TRACE` and `METRIC`.
192+
For example, if the event has an event type `"LOG"`, `getEventType()` will return `"LOG"`.
193+
Example usage in an expression: `getEventType() == "LOG"`.
187194
* `contains()`
188195
- takes two String arguments. Both should be either string literals or Json Pointers with String values.
189196
- returns true if the second argument is a substring of the first argument. Otherwise, return false.

0 commit comments

Comments
 (0)