CtrlB
  • CtrlB Flow
    • 🖐️Introducing CtrlB Flow
    • 🏁Getting started
    • Getting data in CtrlB Flow
    • Explore your data
    • Control your data
  • CtrlB Live Debug
    • 🖐️Introducing CtrlB Live Debug
      • What can you do with CtrlB?
      • How CtrlB works?
    • 🏁Getting started in 2 minutes
    • Plugins
      • Visual Studio Code
      • PyCharm, IntelliJ & WebStorm
    • Agents
      • Python
        • Installation
        • Configuration
        • System Requirements
        • Data Redaction
        • Troubleshoot / Release Notes
          • Version 1.0
      • NodeJs
        • Installation
        • Configuration
        • System Requirements
        • Data Redaction
        • Troubleshoot / Release Notes
          • Version 1.0
      • Java
        • Installation
        • Run with IntelliJ
        • Configuration
        • System Requirements
        • Data Redaction
        • Troubleshoot / Release Notes
      • Go
        • Installation
        • Run with Goland
        • Run with Docker
        • Configuration
        • System Requirements
        • Data Redaction
    • 🎛️Conditional Expressions
    • 🏭Deploy within your firewall
    • 🍉Benchmarking impact on your system
      • Java
      • Go
    • Benchmarking impact on your system:
Powered by GitBook
On this page
  • Supported Data Types
  • Basic Operators
  • Logical Operators
  • Using Brackets for Priority
  • Examples
  • Future Extensions & Conclusion
  1. CtrlB Live Debug

Conditional Expressions

When setting up probes, if it's required to be triggered only under specific circumstances. That's where our conditional logic comes into play. You can use the context of active variables to create these conditions. Dive in to explore how you can utilize the depth of our conditionals:

Supported Data Types

  • Numbers: Integer and decimal values.

  • Strings: Sequence of characters enclosed within quotes.

  • Booleans: True or false values.

Basic Operators

  • ==: Equals

  • !=: Not equals

  • <: Less than (for numbers)

  • <=: Less than or equal to (for numbers)

  • >: Greater than (for numbers)

  • >=: Greater than or equal to (for numbers)

Logical Operators

  • &&: Logical AND

  • ||: Logical OR

Using Brackets for Priority

Brackets ( and ) can be used to group conditions and override the standard priority of operations.

Examples

Given the variables:

number = 5
text = "hello"
flag = True

True Conditions:

  1. (number == 5 && text == "hello")

  2. (flag || (number == 6 && text != "world"))

  3. ((number > 4 || flag) && text != "world")

False Conditions:

  1. (number < 5 && text == "hello")

  2. (text == "world" || (number != 5 && !flag))

Given the rule (number > 4 && (text == "hello" || (flag && text != "world"))), the system checks if number is greater than 4. If true, it then checks if the text is "hello" or both flag is true and text is not "world".

Future Extensions & Conclusion

We're actively working to support complex data structures like arrays, maps, and objects etc. These will be introduced in the upcoming releases, allowing for even more powerful conditional operations.

PreviousData RedactionNextDeploy within your firewall

Last updated 1 year ago

🎛️