lua_selectors
This module contains ‘selectors’ implementation: code to extract data from Rspamd tasks and compose those together. Typical selector looks like this: header(User).lower.substring(1, 2):ip
Functions:
Function | Description |
---|---|
lua_selectors.parse_selector(cfg, str) |
No description |
lua_selectors.register_extractor(cfg, name, selector) |
No description |
lua_selectors.register_transform(cfg, name, transform) |
No description |
lua_selectors.process_selectors(task, selectors_pipe) |
No description |
lua_selectors.combine_selectors(task, selectors, delimiter) |
No description |
lua_selectors.flatten_selectors(selectors) |
Convert selectors to a flat table of elements. |
lua_selectors.kv_table_from_pairs(selectors) |
Convert selectors to a table where the odd elements are keys and even are elements. |
lua_selectors.create_closure(log_obj, cfg, selector_str, delimiter, fn) |
Creates a closure from a string selector, using the specific combinator function. |
lua_selectors.create_closure(cfg, selector_str, delimiter='', flatten=false) |
Creates a closure from a string selector. |
The module lua_selectors
defines the following functions.
lua_selectors.parse_selector(cfg, str)
Parameters:
No parameters
Returns:
No return
Back to module description.
lua_selectors.register_extractor(cfg, name, selector)
Parameters:
No parameters
Returns:
No return
Back to module description.
lua_selectors.register_transform(cfg, name, transform)
Parameters:
No parameters
Returns:
No return
Back to module description.
lua_selectors.process_selectors(task, selectors_pipe)
Parameters:
No parameters
Returns:
No return
Back to module description.
lua_selectors.combine_selectors(task, selectors, delimiter)
Parameters:
No parameters
Returns:
No return
Back to module description.
lua_selectors.flatten_selectors(selectors)
Convert selectors to a flat table of elements
Parameters:
No parameters
Returns:
No return
Back to module description.
lua_selectors.kv_table_from_pairs(selectors)
Convert selectors to a table where the odd elements are keys and even are elements
Similarly to make a map from (k, v) pairs list
To specify the concrete constant keys, one can use the id
extractor
Parameters:
No parameters
Returns:
No return
Back to module description.
lua_selectors.create_closure(log_obj, cfg, selector_str, delimiter, fn)
Creates a closure from a string selector, using the specific combinator function
Parameters:
No parameters
Returns:
No return
Back to module description.
lua_selectors.create_closure(cfg, selector_str, delimiter='', flatten=false)
Creates a closure from a string selector
Parameters:
No parameters
Returns:
No return
Back to module description.
Back to top.