--- id: write-chain-rule title: Write a Chain Rule sidebar_label: Chain Rule description: Learn how to write a chain rule. slug: /help/docs/cse/rules/write-chain-rule/ canonical: https://www.sumologic.com/help/docs/cse/rules/write-chain-rule/ --- import useBaseUrl from '@docusaurus/useBaseUrl'; import CseRule from '../../reuse/cse-rule-description-links.md'; import Iframe from 'react-iframe';  This topic has information about chain rules and how to create them in the Cloud SIEM UI. :::note If you are new to writing rules, see [About Cloud SIEM Rules](/docs/cse/rules/about-cse-rules) for information about rule expressions and other rule options. ::: import TerraformLink from '../../reuse/terraform-link.md'; :::tip You can use Terraform to manage chain rules with the [`sumologic_cse_chain_rule`](https://registry.terraform.io/providers/SumoLogic/sumologic/latest/docs/resources/cse_chain_rule) resource. ::: ## About chain rules A chain rule is similar to a threshold rule. A threshold rule fires when one rule expression is matched at least a certain number times during a specified length of time. In a chain rule you configure two more rule expressions, and for each expression, the number of matches that are required for the rule to fire a signal. The interval you define within which the matches must occur applies to all of the rule expressions in the rule. :::training Micro Lesson Watch this micro lesson to learn how to create a chain rule.