Skip to content

New comparison condition #64

@shellcromancer

Description

@shellcromancer

Is your feature request related to a problem? Please describe.
With substation today, it's not possible to conditionally set a value based on how two keys from the input relate to each other, this is where a compare condition could help. This is useful when comparing values in an array before and after a copy using a gjson selection to a metadata key and setting output based on that result.

Describe the solution you'd like
A new compare condition compare parts of the JSON with itself like described above and we'd probably to support comparisons (across datatypes integers, strings, floats, and booleans) in the form of:

  • equals,
  • greaterthan,
  • greaterthanequals,
  • lessthan,
  • lessthanequals

Describe alternatives you've considered
We could not support this, after introducing the for_each condition similar problems can be solved more directly.

Additional context
The implementation for this could likely borrow code from the length inspector/condition, the only difference is we are comparing another input value instead of a static literal.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions