

기계 번역으로 제공되는 번역입니다. 제공된 번역과 원본 영어의 내용이 상충하는 경우에는 영어 버전이 우선합니다.

# 문자열 값 일치
<a name="string-value-matching"></a>

문자열 값을 메시지 속성 값이나 메시지 본문 속성 값과 일치시켜 메시지를 필터링합니다. 문자열 값은 JSON 정책에서 큰따옴표로 묶습니다. 다음 문자열 작업을 사용하여 메시지 속성 또는 메시지 본문 속성을 일치시킬 수 있습니다.

## 정확한 일치
<a name="string-exact-matching"></a>

정책 속성 값이 하나 이상의 메시지 속성 값과 일치하는 경우 정확한 일치가 발생합니다. `String.Array` 유형 속성의 경우 배열의 각 요소는 일치를 위해 별도의 문자열로 처리됩니다.

다음 정책 속성을 살펴보겠습니다.

```
"customer_interests": ["rugby", "tennis"]
```

이 속성은 다음 메시지 속성과 일치합니다.

```
"customer_interests": {"Type": "String", "Value": "rugby"}
```

```
"customer_interests": {"Type": "String", "Value": "tennis"}
```

```
"customer_interests": {"Type": "String.Array", "Value": "[\"rugby\", \"tennis\"]"}
```

또한 다음 메시지 본문과도 일치합니다.

```
{
   "customer_interests": "rugby"
}
```

```
{
   "customer_interests": "tennis"
}
```

그러나 다음 메시지 속성과는 일치하지 않습니다.

```
"customer_interests": {"Type": "String", "Value": "baseball"}
```

```
"customer_interests": {"Type": "String.Array", "Value": "[\"baseball\"]"}
```

다음 메시지 본문과도 일치하지 않습니다.

```
{
   "customer_interests": "baseball"
}
```

## Anything-but 일치
<a name="string-anything-but-matching"></a>

정책 속성 값에 키워드 `anything-but`가 포함되어 있으면 정책 속성 값을 포함하지 *않는* 모든 메시지 속성 또는 메시지 본문 값과 일치합니다. `anything-but`는 `"exists": false`와 함께 사용할 수 있습니다. `String.Array` 유형 속성의 경우 정책 속성에 나열된 배열 요소가 없는 경우 일치합니다.

다음 정책 속성을 살펴보겠습니다.

```
"customer_interests": [{"anything-but": ["rugby", "tennis"]}]
```

이 속성은 다음 메시지 속성 중 하나와 일치합니다.

```
"customer_interests": {"Type": "String", "Value": "baseball"}
```

```
"customer_interests": {"Type": "String", "Value": "football"}
```

```
"customer_interests": {"Type": "String.Array", "Value": "[\"rugby\", \"baseball\"]"}
```

이 속성은 다음 메시지 본문 중 하나와도 일치합니다.

```
{
   "customer_interests": "baseball"
}
```

```
{
   "customer_interests": "football"
}
```

또한 다음 메시지 속성과 일치합니다(`rugby` 또는 `tennis`이 *아닌* 값이 포함되어 있기 때문).

```
"customer_interests": {"Type": "String.Array", "Value": "[\"rugby\", \"baseball\"]"}
```

또한 다음 메시지 본문과도 일치합니다(`rugby` 또는 `tennis`가 아닌 값이 포함되어 있기 때문).

```
{
   "customer_interests": ["rugby", "baseball"]
}
```

그러나 다음 메시지 속성과는 일치하지 않습니다.

```
"customer_interests": {"Type": "String", "Value": "rugby"}
```

```
"customer_interests": {"Type": "String.Array", "Value": "[\"rugby\"]"}
```

다음 메시지 본문과도 일치하지 않습니다.

```
{
   "customer_interests": ["rugby"]
}
```

**접두사 `anything-but` 사용**

문자열 일치의 경우 `anything-but` 연산자와 함께 접두사를 사용할 수도 있습니다. 예를 들어 다음 정책 속성은 `order-` 접두사를 거부합니다.

```
"event":[{"anything-but": {"prefix": "order-"}}]
```

이 속성은 다음 속성 중 하나와 일치합니다.

```
"event": {"Type": "String", "Value": "data-entry"}
```

```
"event": {"Type": "String", "Value": "order_number"}
```

이 속성은 다음 메시지 본문 중 하나와도 일치합니다.

```
{
   "event": "data-entry"
}
```

```
{
   "event": "order_number"
}
```

그러나 다음 메시지 속성과는 일치하지 않습니다.

```
"event": {"Type": "String", "Value": "order-cancelled"}
```

다음 메시지 본문과도 일치하지 않습니다.

```
{
   "event": "order-cancelled"
}
```

**anything-but 와일드카드**

다음 정책 속성은 `*ball` 와일드카드를 거부합니다.

```
"customer_interests" : [{ "anything-but": { "wildcard": "*ball" }}]
```

이 속성은 다음 속성과 일치합니다.

```
{"customer_interests": ["hockey", "rugby", "soccer] }
```

그러나 다음 메시지 속성과는 일치하지 않습니다.

```
{"customer_interests": ["baseball", "basketball"] }
```

**anything-but 접미사** 

다음 정책 속성은 `-ball`

 접미사를 거부합니다.

```
"customer_interests": [ { "anything-but": { "suffix": "ball" } } ]
```

이 속성은 다음 속성과 일치합니다.

```
{"customer_interests": ["hockey", "rugby", "soccer] }
```

그러나 다음 메시지 속성과는 일치하지 않습니다.

```
 {"customer_interests": ["baseball", "basketball"] }
```

## Equals-ignore-case 일치
<a name="string-equals-ignore"></a>

정책 속성이 키워드 `equals-ignore-case`를 포함하고 있는 경우, 모든 메시지 속성 또는 본문 속성 값에 대해 대소문자를 구분하지 않는 일치 연산을 수행합니다.

다음 정책 속성을 살펴보겠습니다.

```
"customer_interests": [{"equals-ignore-case": "tennis"}]
```

이 속성은 다음 메시지 속성 중 하나와 일치합니다.

```
"customer_interests": {"Type": "String", "Value": "TENNIS"}
```

```
"customer_interests": {"Type": "String", "Value": "Tennis"}
```

이 속성은 다음 메시지 본문 중 하나와도 일치합니다.

```
{
    "customer_interests": "TENNIS"
}
```

```
{
    "customer_interests": "teNnis"
{
```

## IP 주소 일치
<a name="string-address-matching"></a>

`cidr` 연산자를 사용하여 수신 메시지가 특정 IP 주소 또는 서브넷에서 발생하는지 확인할 수 있습니다.

다음 정책 속성을 살펴보겠습니다.

```
"source_ip":[{"cidr": "10.0.0.0/24"}]
```

이 속성은 다음 메시지 속성 중 하나와 일치합니다.

```
"source_ip": {"Type": "String", "Value": "10.0.0.0"}
```

```
"source_ip": {"Type": "String", "Value": "10.0.0.255"}
```

이 속성은 다음 메시지 본문 중 하나와도 일치합니다.

```
{
   "source_ip": "10.0.0.0"
}
```

```
{
   "source_ip": "10.0.0.255"
}
```

그러나 다음 메시지 속성과는 일치하지 않습니다.

```
"source_ip": {"Type": "String", "Value": "10.1.1.0"}
```

다음 메시지 본문과도 일치하지 않습니다.

```
{
   "source_ip": "10.1.1.0"
}
```

## 접두사 일치
<a name="string-prefix-matching"></a>

정책 속성이 키워드 `prefix`를 포함하고 있는 경우, 이 값은 메시지 속성 또는 지정된 문자로 시작하는 모든 메시지 속성 값과 일치합니다.

다음 정책 속성을 살펴보겠습니다.

```
"customer_interests": [{"prefix": "bas"}]
```

이 속성은 다음 메시지 속성 중 하나와 일치합니다.

```
"customer_interests": {"Type": "String", "Value": "baseball"}
```

```
"customer_interests": {"Type": "String", "Value": "basketball"}
```

이 속성은 다음 메시지 본문 중 하나와도 일치합니다.

```
{
   "customer_interests": "baseball"
}
```

```
{
   "customer_interests": "basketball"
}
```

그러나 다음 메시지 속성과는 일치하지 않습니다.

```
"customer_interests": {"Type": "String", "Value": "rugby"}
```

다음 메시지 본문과도 일치하지 않습니다.

```
{
   "customer_interests": "rugby"
}
```

## 접미사 일치
<a name="string-suffix-matching"></a>

정책 속성이 키워드 `suffix`를 포함하고 있는 경우, 이 값은 메시지 속성 또는 지정된 문자로 끝나는 모든 메시지 속성 값과 일치합니다.

다음 정책 속성을 살펴보겠습니다.

```
"customer_interests": [{"suffix": "ball"}]
```

이 속성은 다음 메시지 속성 중 하나와 일치합니다.

```
"customer_interests": {"Type": "String", "Value": "baseball"}
```

```
"customer_interests": {"Type": "String", "Value": "basketball"}
```

이 속성은 다음 메시지 본문 중 하나와도 일치합니다.

```
{
    "customer_interests": "baseball"
}
```

```
{
    "customer_interests": "basketball"
}
```

그러나 다음 메시지 속성과는 일치하지 않습니다.

```
"customer_interests": {"Type": "String", "Value": "rugby"}
```

다음 메시지 본문과도 일치하지 않습니다.

```
{
    "customer_interests": "rugby"
}
```

## 와일드카드
<a name="string-value-wildcard"></a>

 와일드카드 문자(\*)를 사용하여 이벤트 패턴의 문자열 값을 매칭할 수 있습니다.

다음 정책은 와일드카드(\*) 문자를 사용합니다.

```
"customer_interests": [ { "wildcard": "*ball" } ]
```

이 속성은 다음 속성과 일치합니다.

```
{"customer_interests": ["baseball", "basketball"] }
```