# Error in rule that drop log message

**URL:** <https://community.graylog.org/t/error-in-rule-that-drop-log-message/4015>\
**Category:** Graylog Central (peer support)\
**Created:** [February 1, 2018, 10:04am UTC](https://community.graylog.org/t/error-in-rule-that-drop-log-message/4015 "2018-02-01T10:04:22Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![rajaoui123](https://avatars.discourse-cdn.com/v4/letter/r/3be4f8/32.png) [@rajaoui123](https://community.graylog.org/u/rajaoui123)\
**Post date:** [February 1, 2018, 10:04am UTC](https://community.graylog.org/t/error-in-rule-that-drop-log-message/4015/1 "2018-02-01T10:04:22Z")

</div>

rule "ignorelogs"  
when  
has\_field(“level”) && to\_string($message.level) == "5"  
then  
drop\_message();  
end  
i create this rules to drop message that contain level 6 but nothing change could you help me ??

---

<div class="post-metadata">

**Author:** ![jochen](https://sea2.discourse-cdn.com/flex016/user_avatar/community.graylog.org/jochen/32/8_2.png) [@jochen](https://community.graylog.org/u/jochen)\
**Post date:** [February 1, 2018, 10:25am UTC](https://community.graylog.org/t/error-in-rule-that-drop-log-message/4015/2 "2018-02-01T10:25:51Z")

</div>

You wrote “level 6”, but your rule checks for level == “5”.

---

<div class="post-metadata">

**Author:** ![rajaoui123](https://avatars.discourse-cdn.com/v4/letter/r/3be4f8/32.png) [@rajaoui123](https://community.graylog.org/u/rajaoui123)\
**Post date:** [February 1, 2018, 11:21am UTC](https://community.graylog.org/t/error-in-rule-that-drop-log-message/4015/3 "2018-02-01T11:21:02Z")

</div>

> [@jochen](#):
>
> You wrote “level 6”, but your rule checks for level == “5”.

even i change it nothing change

---

<div class="post-metadata">

**Author:** ![jochen](https://sea2.discourse-cdn.com/flex016/user_avatar/community.graylog.org/jochen/32/8_2.png) [@jochen](https://community.graylog.org/u/jochen)\
**Post date:** [February 1, 2018, 1:38pm UTC](https://community.graylog.org/t/error-in-rule-that-drop-log-message/4015/4 "2018-02-01T13:38:35Z")

</div>

Please provide some example messages and more details about your setup.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex016/uploads/graylog/original/3X/c/7/c7c09c6b5099570133d6502b83f50ba4430de5b6.png) [@system](https://community.graylog.org/u/system)\
**Post date:** [February 15, 2018, 1:39pm UTC](https://community.graylog.org/t/error-in-rule-that-drop-log-message/4015/5 "2018-02-15T13:39:19Z")

</div>

Closed on February 15, 2018, 1:39pm UTC

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
