Cache

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

ParameterTypeDefaultDescription
targetSTRING“main”the field of the Message that should be used for the filter (it could be main or and extra field)
refresh_on_getBOOL“true”the TTL is refreshed if the key has been looked up
ttlDURATION24hhow long after the key will be deleted
sync_timeDURATION5mhow often the sync on file should be called
nameSTRING""named global cache: this cache will be available for ALL the rules also for different files
globalBOOL“false”make this cache global: like for the name param this cache is available to all the rules with the name “global”
fileSTRING""enable cache persistence. It loads and writes the cache from a file
ignore_first_runBOOL“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