---
title: 'antispam:plugin:rulestatistics'
url: 'https://docs.danami.com/warden/command-line-interface/antispam/antispam-plugin-rulestatistics'
markdown: 'https://docs.danami.com/warden/command-line-interface/antispam/antispam-plugin-rulestatistics.md'
date: '2026-09-22'
description: 'Log real-time per-rule statistics for each email, allowing admins to easily analyze rule performance and identify false positives/negatives. warden --task=antispam:plugin:rulestatistics Option Value Default Description --use_rule_statistics <1|0> 1 Whether to log real-time rule st…'
taxonomy:
  category:
    - docs
---

[](#)  [ Basics ](https://docs.danami.com/warden/)     [ Command Line Interface ](https://docs.danami.com/warden/command-line-interface)      Antispam       antispam:plugin:rulestatistics    

# antispam:plugin:rulestatistics

Log real-time per-rule statistics for each email, allowing admins to easily analyze rule performance and identify false positives/negatives.

```
warden --task=antispam:plugin:rulestatistics
```

| Option | Value | Default | Description |
|---|---|---|---|
| `--use_rule_statistics` | <1\|0> | 1 | Whether to log real-time rule statistics to the database. |
| `--rule_statistics_sync_spam_levels` | <1\|0> | 1 | Whether to sync the rule\_statistics\_spam\_level and rule\_statistics\_spam\_kill\_level with the server wide policy spam levels. Disabling this option allows you to set a custom spam level and spam kill level. This is useful for testing different spam levels without actually changing them under the server wide policy. |
| `--rule_statistics_spam_level` | <int> | 7 | The score required for the rule to be logged as spam. This should usually match the spam level set for the server wide policy. |
| `--rule_statistics_spam_kill_level` | <int> | 13 | The score required for the rule to be logged as spam when using the "move" or "tag" spam actions with receive spam set to "no". Any score above the spam level but below the spam\_kill\_level will be treated as "spammy". This should usually match the spam kill level set for the server wide policy. If you are not using the spam kill level then set it to match the rule\_statistics\_spam\_level. |
| `--rule_statistics_log_rule` | <string1,string2> |  | The rule names to log statistiscs for. If no entries are added then statistics will be logged for all rules. |
| `--rule_statistics_log_rule_add` | <string> |  | Add a single entry to rule\_statistics\_log\_rule. |
| `--rule_statistics_log_rule_del` | <string> |  | Remove a single entry from rule\_statistics\_log\_rule. |
| `--rule_statistics_ignore_rule` | <string1,string2> |  | The rule names to ignore and not log statistics for. |
| `--rule_statistics_ignore_rule_add` | <string> |  | Add a single entry to rule\_statistics\_ignore\_rule. |
| `--rule_statistics_ignore_rule_del` | <string> |  | Remove a single entry from rule\_statistics\_ignore\_rule. |
| `--rule_statistics_log_sub_rules` | <1\|0> | 0 | Whether to log statistics for sub-rules (meta rules starting with double underscores). This adds a lot more database logging so it is not normally recommended to enable on busy servers. |
| `--default` | <yes> |  | Reset all settings to their default values. |
| `--default_option` | <option> |  | Reset a specific setting to its default value. |
| `--reload` | <yes> |  | Reload the service after saving settings. |

## Examples

```
// turn on the rule statistics plugin
warden --task=antispam:plugin:rulestatistics --use_rule_statistics=1 --reload=yes

// turn off the rule statistics plugin
warden --task=antispam:plugin:rulestatistics --use_rule_statistics=0 --reload=yes

// set the rule_statistics_log_rule
warden --task=antispam:plugin:rulestatistics --rule_statistics_log_rule='ALL_TRUSTED,DCC' --reload=yes

// add an entry to rule_statistics_log_rule
warden --task=antispam:plugin:rulestatistics --rule_statistics_log_rule_add='DCC' --reload=yes

// delete an entry from rule_statistics_log_rule
warden --task=antispam:plugin:rulestatistics --rule_statistics_log_rule_del='DCC' --reload=yes

// reset rule_statistics_log_rule to its default value
warden --task=antispam:plugin:rulestatistics --default_option=rule_statistics_log_rule --reload=yes

// reset all settings to their default values
warden --task=antispam:plugin:rulestatistics --default=yes --reload=yes
```

 [ ](https://docs.danami.com/warden/command-line-interface/antispam/antispam-plugin-relaycountry) [](https://docs.danami.com/warden/command-line-interface/antispam/antispam-plugin-sh)

---

## Navigation

- Previous: [antispam:plugin:relaycountry](https://docs.danami.com/warden/command-line-interface/antispam/antispam-plugin-relaycountry.md)
- Next: [antispam:plugin:sh](https://docs.danami.com/warden/command-line-interface/antispam/antispam-plugin-sh.md)
