RainerScript¶
RainerScript is a scripting language specifically designed and well-suited for processing network events and configuring event processors. It is the prime configuration language used for rsyslog. Please note that RainerScript may not be abreviated as rscript, because that’s somebody else’s trademark.
Some limited RainerScript support is available since rsyslog 3.12.0 (for expression support). In v5, “if .. then” statements are supported. The first full implementation is available since rsyslog v6.
- Data Types
- Expressions
- Functions
- getenv(str)
- strlen(str)
- tolower(str)
- cstr(expr)
- cnum(expr)
- wrap(str, wrapper_str)
- wrap(str, wrapper_str, escaper_str)
- replace(str, substr_to_replace, replace_with)
- re_match(expr, re)
- re_extract(expr, re, match, submatch, no-found)
- field(str, delim, matchnbr)
- exec_template
- prifilt(constant)
- dyn_inc(bucket_name_literal_string, str)
- lookup(table_name_literal_string, key)
- num2ipv4
- ipv42num
- random(max)
- ltrim
- rtrim
- substring(str, start, subStringLength)
- int2hex(num)
- script_error
- previous_action_suspended
- format_time(unix_timestamp, format_str)
- parse_json(string, container)
- parse_time(timestamp)
- is_time(timestamp, format_str)
- Control Structures
- configuration objects
- String Constants
- Variable (Property) types
- Lookup Tables
- General Queue Parameters
- The rsyslog “call” statement
- The rsyslog “call_indirect” statement
- global() configuration object
- The rsyslog include() object
See also
If you would like to contribute to these docs, but are unsure where to start, please see the rsyslog-doc project README for an overview of the process. If you would like to contribute to the main source project, please review the contribution guidelines listed in the rsyslog project README.
If you have a question about these docs or Rsyslog
in general, please
see the following resources: