Cache
This filter introduces a simple cache mechanism in the rule. It is a TTL based cache and it can have a local visibility (cache is only visible to the current filter) or a global visibility (cache shared across ALL the rules).
If the target of the Message as input has been cached before, and his TTL is not expired, it will be dropped and not propagated to the next filter.
Otherwise if the target of the Message is new to the cache, it is inserted in it and propagated to the next filter.
Parameters
Parameter | Type | Default | Description |
---|---|---|---|
target | STRING | “main” | the field of the Message that should be used for the filter (it could be main or and extra field) |
refresh_on_get | BOOL | “true” | the TTL is refreshed if the key has been looked up |
ttl | DURATION | 24h | how long after the key will be deleted |
sync_time | DURATION | 5m | how often the sync on file should be called |
name | STRING | "" | named global cache: this cache will be available for ALL the rules also for different files |
global | BOOL | “false” | make this cache global: like for the name param this cache is available to all the rules with the name “global” |
file | STRING | "" | enable cache persistence. It loads and writes the cache from a file |
ignore_first_run | BOOL | “false” | if true the messages that arrives to the cache with the firstRun flag enabled will be send to the next filter |
... | cache(ttl="24h", global="true") | ...
Output
The output is not being changed. This filter can only stop or not the propagation of the Message.
Examples
Soon…