# 逻辑规则

使用逻辑操作符规则将多个规则组合起来以应对复杂场景。你可以将逻辑规则嵌套在另一个逻辑规则中。

#### AND 规则

如果所有子规则都匹配，则触发该规则。

```ini
AND,((#Rule1), (#Rule2), (#Rule3)...),Policy
```

示例：

```ini
AND,((SRC-IP,192.168.1.110), (DOMAIN, example.com)),DIRECT
```

#### OR 规则

如果任意子规则匹配，则触发该规则。

`OR,((#Rule1), (#Rule2), (#Rule3)...),Policy`

示例：

```ini
OR,((SRC-IP,192.168.1.110), (SRC-IP,192.168.1.111)),DIRECT
```

#### NOT 规则

反转原始规则的评估结果。

```ini
NOT,((#Rule1)),Policy
```

示例：

```ini
AND,((NOT,((SRC-IP,192.168.1.110))),(DOMAIN, example.com)),DIRECT
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://surge.mitsea.com/rule/logical-rule.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
