Overview

Operators

Operators are used when setting filter conditions and serve to define the relationship between property names and property values. For detailed information about properties, please refer to the Properties documentation.
In Hackle's data analysis, the following operators are provided. You must select appropriate operators based on the type of property values associated with the chosen property name.

OperatorNumber of Property Values Selectable
= (Is any of)Multiple items
≠ (Is none of)Multiple items
> (Greater)Single item
≥ (Greater or equal)Single item
< (Less)Single item
≤ (Less or equal)Single item
{=} (Is set)Multiple items
{≠} (Is not set)Multiple items
∋ (Contains any of )Multiple items
∌ (Does not contain any of)Multiple items
Starts withMultiple items
Does not start withMultiple items
Ends withMultiple items
Does not end withMultiple items
(.*) (Matches regex)Single item
!(.*) (Does not match regex)Single item

Example

To select users residing in metropolitan cities, since they need to be living in one of metropolitan cities, you can define the filter as follows:

👍

Creating a filter for [Users residing in metropolitan cities]

  • Property: Residence (assuming the property name is residence and property value type is String)
  • Operator: = (Is any of))
  • Property values following the operator: "Incheon Metropolitan City", "Daejeon Metropolitan City", "Daegu Metropolitan City", "Ulsan Metropolitan City", "Busan Metropolitan City", "Gwangju Metropolitan City"

OperatorSingle ValueArray Value
= ((Is any of)Checks if the property exactly matches any of the user-input values.

Ex) User input: ["foo", "bar"]

Property value
• foo → O
• bar → O
• qux → X
Checks if any element in the array property exactly matches any of the user-input values.

Ex) User input: ["foo", "bar"]

Property value
• ["foo", "bar"] → O
• ["foo", "qux"] → O
• ["fo", "ba"] → X
• ["qux"] → X
≠ (Is not any of)Opposite of =

ex) User input: [“foo“, “bar“]

Property value
• foo → X
• bar → X
• qux → O
Opposite of =

ex) User input: [“foo“, “bar“]

Property value
• [“foo“, “bar“] → X
• [“foo“, “qux“] → X
• [“fo“, “ba“] → O
• [“qux“] → O
> (Greater)Checks if the property value is greater than the operand

Ex) User Input: 10

Property value
• 11 → O
• 10 → X
• 9 → X
Checks if the array contains any value greater than the operand

Ex) User input: 10

Property value
• [8, 9, 10] → X
• [9, 10, 11] → O
• [10, 11, 12] → O
≥ (Greater or equal)Checks if the property value is greater than or equal to the operand

Ex) User input: 10

Property value
• 11 → O
• 10 → O
• 9 → X
Checks if the array contains any value greater than or equal to the operand

Ex) User input: 10

Property value
• [8, 9, 10] → O
• [9, 10, 11] → O
• [10, 11, 12] → O
< (Less)Checks if the property value is less than the operand.

Ex) User input: 10

Property value
• 11 → X
• 10 → X
• 9 → O
Checks if the array contains any value less than the operand.

Ex) User input: 10

Property value
• [8, 9, 10] → X
• [9, 10, 11] → O
• [10, 11, 12] → O
≤ (Less or equal)Checks if the property value is less than or equal to the operand

Ex) User input: 10

Property value
• 11 → X
• 10 → O
• 9 → O
Checks if the array contains any value less than or equal to the operand.

Ex) User input: 10

Property value
• [8, 9, 10] → O
• [9, 10, 11] → O
• [10, 11, 12] → O
{=} (Is set)Checks if the selected property group exactly matches the operand.

Ex 1) User input: [“foo“]

Property value
• foo → O
• foo1 → X
• bar → X

Ex 2) User input: [“foo“, “bar“]

Property value
• foo → O
• foo1 → X
• bar → O
Checks if the selected property group exactly matches the operand..

Ex) User input: ["foo","bar"]

Property value
• [“foo“, “bar“] → O
• [“foo“, “foo1“] → X
• [“foo“] → X
{≠} (Is not set)Ex 1) User input: [“foo“]

Property value
• foo → X
• foo1 → O
• bar → O

Ex 2) User input: [“foo“, “bar“]

Property value
• foo → X
• foo1 → O
• bar → X
Ex) User input: ["foo","bar"]

Property value
• [“foo“, “bar“] → X
• [“foo“, “foo1“] → O
• [“foo“] → O
∋ (Contains any of)Checks if the property value contains any of the user-input values as a substring.

Ex) User input: ["fo","ar"]

Property value
• foo → O
• bar → O
• qux → X
Checks if any element in the array property contains any of the user-input values as a substring.

Ex) User input: ["fo","ar"]

Property value
• [“foo“, “bar“] → O
• [“bar“, “qux“] → O
• [“qux“] → X
∌ (Does not contain any of)Ex) User input: ["fo","ar"]

Property value
• foo → O
• bar → O
• qux → X
Ex) User input: ["fo","ar"]

Property value
• [“foo“, “bar“] → X
• [“bar“, “qux“] → X
• [“qux“] → O
Starts withChecks if the property value starts with any element from the user input. The user input elements must match the beginning of the property value.

Ex) User input: ["fo","ba"]

Property value
• foo → O
• bar → O
• qux → X
Checks if the property value starts with any element from the user input. The user input elements must match the beginning of the property value.

Ex) User input : ["fo","ba"]

Property value
• [“foo“, “bar“] → O
• [“bar“, “qux“] → O
• [“qux“] → X
Does not start withEx) User input: ["fo","ba"]

Property value
• foo → X
• bar → X
• qux → O
Ex) User input: ["fo","ba"]

Property value
• [“foo“, “bar“] → X
• [“bar“, “qux“] → X
• [“qux“] → O
Ends withChecks if the property value ends with any element from the user input. The user input elements must match the end of the property value.

Ex) User input: ["oo","ar"]

Property value
• foo → O
• bar → O
• qux → X
Checks if the property value ends with any element from the user input. The user input elements must match the end of the property value.

Ex) User input: ["oo","ar"]

Property value
• [“foo“, “bar“] → O
• [“bar“, “qux“] → O
• [“qux“] → X
Does not end withEx) User input: ["oo","ar"]

Property value
• foo → X
• bar → X
• qux → O
Ex) User input: ["oo","ar"]

Property value
• [“foo“, “bar“] → X
• [“bar“, “qux“] → X
• [“qux“] → O
(.*) (Matches regex)Checks if the property value matches any of the user-input values as a regular expression.

Ex) User input: [“f.*“, “\d+”]

Property value
• foo → O
• 1 → O
• qux → X
Checks if the property value matches any of the user-input values as a regular expression

Ex) User input: [“f.*“, “\d+”]

Property value
• [“foo“, “1“] → O
• [“1“, “qux“] → O
• [“qux“] → X
!(.*) (Does not match regex)Ex) User input : [“f.*“, “\d+”]

Property value
• foo → X
• 1 → X
• qux → O
Ex) User input: [“f.*“, “\d+”]

Property value
• [“foo“, “1“] → X
• [“1“, “qux“] → X
• [“qux“] → O

Regular Expressions

Regular expressions provide more sophisticated pattern matching capabilities that cannot be expressed using string operators alone.

For example, if you want to select only URL paths matching /api/v1/items/{number}, this cannot be accomplished with standard string operators since they lack the ability to specifically target numbers.

Examples of Cases That Cannot Be Solved with String Operators

  • Contains numbers
  • Contains only letters
  • Ends with numbers only
  • Starts with numbers only
  • Contains specific characters and ends with numbers

For basic string operations, we recommend using these operators:

  • Starts with one of the following
  • Ends with one of the following
  • Contains one of the following

Useful Regular Expression Syntax

Symbols

  1. \d+
    • Represents consecutive numbers. Can express numbers of any length.
  2. \D+
    • Represents consecutive characters. Can express strings.
  3. ^
    • Indicates the start of a string.
    • ^a means strings starting with 'a'.
  4. $
    • Indicates the end of a string.
    • a$ means strings ending with 'a'.
  5. {n}
    • Indicates n consecutive occurrences.
    • \d{2} means a two-digit number.

Partial Match vs. Exact Match

Regular expressions provide partial matching by default.

  • Partial Match
    • /v1/
      • /api/v1/items/1 : ✅
      • /api/v1/items/apples/1 : ✅
  • Exact Match can be expressed using start and end symbols
    • ^/api/v1/items/1$
      • /api/v1/items/1 : ✅
      • /api/v1/items/apples/1 : ❌

URL Path Matching

When matching paths that end with numbers (e.g., IDs):

  • /api/v1/items/\d+
    • /api/v1/items/1 : ✅
    • /api/v1/items/apples/1 : ❌
  • /api/v1/items/apples/\d+
    • /api/v1/items/apples/1 : ✅
    • /api/v1/items/bananas/1 : ❌

For paths containing specific strings:

  • /v1/
    • /api/v1/items/1 : ✅
    • /api/v2/items/1 : ❌

For paths containing specific string types and ending with numbers:

  • /api/v1/items/(apples|bananas)/\d+
    • /api/v1/items/apples/1 : ✅
    • /api/v1/items/bananas/1 : ✅
    • /api/v1/items/oranges/1 : ❌

Other String Matching

For selecting specific address formats as event properties, you can use patterns like this:

  • Yeoksam-ro (number) Building (number) Unit (number)
    • Yeoksam-ro \d+ \d+dong \d+unit
      • Yeoksam-ro 301 101-dong 101-unit : ✅
      • Yeoksam-ro 301 1003-unit : ❌
      • Teheran-ro 301 101-dong 101-unit : ❌

You can even select residents living on the first floor. \d{n} means a number repeating n times:

  • 1\d{2}unit
    • 101-199unit : ✅