跳到主要内容

Function reference

The transformer uses functions in Vanus. Every function consists of two parts, the first part is the function name, and the other is parameters required by this function.

The function parameters support the following type:

  • Event JSON Path - support event attribute such as $.id and event data such as $.data.service.
  • Define Variable - in define defined variable such as <variable>.
  • Constant - constant value such as "123".

For example:

    {"command": ["create", "$.data.source", "$.source"]}

The following sections describe the functions, organized by what they do.

Topics

  • Structure
    • create
    • delete
    • move
    • rename
    • replace
    • duplicate
  • String
    • upper_case
    • lower_case
    • add_prefix
    • add_suffix
    • replace_with_regex
    • join
    • replace_string
    • replace_between_positions
    • capitalize_sentence
    • check_custom_values
    • split_with_intervals
    • extract_between_delimiters
    • extract_missing
    • replace_between_delimiters
    • capitalize_word
    • split_with_delimiter
    • split_between_positions
    • split_from_start
    • extract_between_positions
  • Date and time
    • date_format
    • unix_time_format
  • Mathematical
    • math_add
    • math_sub
    • math_mul
    • math_div
  • Condition
    • condition_if
  • Array
    • render_array
    • array_foreach
    • unfold_array
  • Common
    • length