발생조건, 대상선택 가이드
메트릭스 알림의 이벤트 발생 조건과 이벤트 대상 선택은 동일한 문법을 사용합니다.
단, 이벤트 발생 조건은 태그(Tag)의 Key를 변수로 사용하고, 이벤트 대상 선택은 필드(Field)의 Key를 변수로 사용합니다.
기본 문법
-
문자열을 적을 때 그냥 적으면 변수, ‘’또는 “”로 감싸면 text로 인식합니다.
// 예시 oid == "oid" 1. oid : 변수 2. == : 함수 3. "oid" : text
oname가 ott-1235일 때를 판단하고 싶을 때// 정상적인 경우 oname = "ott-1235" 또는 oname = 'ott-1235'
// 비정상적인 경우 (알림이 동작하지 않습니다.) oname = ott-1235
-
숫자를 적을 때 그냥 적으면 number, ‘’또는 “”로 감싸면 text로 인식합니다.
// 예시 oid == 123 1. oid : 변수 2. == : 함수 3. 123 : number
oid가 123일 때를 판단하고 싶을 때// 정상적인 경우 oid == 123
// 비정상적인 경우 (알림이 동작하지 않습니다.) oid == '123' 또는 oid == "123"
사용 가능한 연산자 목록
함수 |
사용법 |
기능 |
== |
operand1 == operand2 |
operan1과 operand2가 같은지 확인합니다. |
!= |
operand1 != operand2 |
operan1과 operand2가 다른지 확인합니다. |
> |
operand1 > operand2 |
operand1이 operand2보다 큰지 확인합니다. |
>= |
operand1 >= operand2 |
operand1이 operand2보다 큰거나 같은지 확인합니다. |
< |
operand1 < operand2 |
operand1이 operand2보다 작은지 확인합니다. |
⇐ |
operand1 ⇐ operand2 |
operand1이 operand2보다 작거나 같은지 확인합니다. |
like |
operand1 like operand2 |
ooperand1를 Key로 하는 Value가 operand2로 시작하거나 끝나는지 확인합니다. |
&& |
expression1 && expression2 |
expression1과 expression2이 모두 true인지 확인합니다. |
|| |
expression1 || expression2 |
expression1 또는 expression2이 true인지 확인합니다. |
or |
expression1 or expression2 |
|| 와 완벽히 동일한 역할을 수행하는 연산자입니다. |
and |
expression1 and expression2 |
&&와 완벽히 동일한 역할을 수행하는 연산자입니다. |
like
-
startsWith 함수와 endsWith 함수의 기능을 편리하게 사용할 수 있도록 like 연산자가 추가되었습니다.
-
기존 startsWith, endsWith을 사용하는 경우
startsWith(Key, “Value”)
endsWith(Key, “Value”)
-
startsWith 대신 like 연산자를 사용하는 경우
Key like "Value*"
-
endsWith 대신 like 연산자를 사용하는 경우
Key like "*Value"
-
startsWith과 endsWith을 동시에 지원하는 기능이 추가되었습니다.
Key like "*Value*"
-
operand2의 중간에는 *를 사용할 수 없습니다.
// 미지원 문법
Key like "tag*lue"
-
like 연산자에서 *가 생략되는 경우 == 로 동작합니다.
// 아래의 두 문장은 완전히 같은 결과를 가집니다.
Key like "Value"
Key == "Value"
사용 가능한 함수 목록
함수 |
사용법 |
기능 |
startsWith(param1, param2) |
param1를 Key로 하는 Value가 param2로 시작하면 true, otherwise false |
|
endsWith(param1, param2) |
param1를 Key로 하는 Value가 param2와 끝나면 true, otherwise false |
|
isNull(param1) |
param1이 null이면 true, otherwise false |
|
isNotNull(param1) |
param1이 null이 아니면 true, otherwise false |
|
isEmpty(param1) |
param1이 null 또는 EmptyString("")이면 true, otherwise false |
|
isNotEmpty(param1) |
param1이 null도 아니고 EmptyString("")도 아니면 true, otherwise false |