---
title: "Rules - Which loops can be used in rules"
description: "Loops cannot be directly used in the rule block section of Geneos rules. Instead, use available Geneos Operators, Functions, or action throttling to repeat actions or implement simple algorithms within rules."
url: "https://docs.itrsgroup.com/docs/faq/geneos/4407905382545-geneos-rules-which-loops-can-be-used-in-rules/index.html"
---
## Related to

Rule loop, rule iteration, rule functions, repeat, Geneos rules, Gateway rules

### Problem

I want to use a loop in the rule block section.

### Possible Solution(s)

Loops can't be defined as such in the rule block. Some logic and simple algorithms may be defined in the rule block, but using the available Geneos [Operators](https://docs.itrsgroup.com/docs/geneos/current/processing/monitoring-and-alerts/geneos_rulesactionsalerts_tr/index.html#_Operators) or [Functions](https://docs.itrsgroup.com/docs/geneos/current/processing/monitoring-and-alerts/geneos_rulesactionsalerts_tr/index.html#_Functions).

If it is required to repeat actions or some behaviors, an [action throttle](https://docs.itrsgroup.com/docs/geneos/current/processing/monitoring-and-alerts/geneos_rulesactionsalerts_tr/index.html#Action_Throttle) within the rule block can be used to do so. [Action Throttling](https://docs.itrsgroup.com/docs/geneos/current/processing/monitoring-and-alerts/geneos_rulesactionsalerts_tr/index.html#gw2-refguide-actions-throttling) from the Actions section on the other hand, will allow for more detailed and advanced features to be available to throttle the action.

## Related Articles

- [Where can I see a list of all the functions the gateway rule engine supports?](https://docs.itrsgroup.com/docs/faq/geneos/115004030369-geneos-how-to-view-all-functions-available-when-setting-up-a-rule/index.html)
- [How to compare dates in a rule](https://docs.itrsgroup.com/docs/faq/geneos/115004029549-geneos-how-to-compare-timestamp-with-the-current-time-in-gateway-rules/index.html)
- [How to send an alert when the FKM sampler detects 3 trigger keys within 1 minute](https://docs.itrsgroup.com/docs/faq/geneos/115004020025-geneos-how-to-send-an-alert-if-there-are-3-trigger-keys-detected-within-1-minute-in-a-fkm-sampler/index.html)


