# How to search the logs which contain the word "Exception"

**URL:** <https://community.graylog.org/t/how-to-search-the-logs-which-contain-the-word-exception/1822>\
**Category:** Graylog Central (peer support)\
**Created:** [July 24, 2017, 10:03am UTC](https://community.graylog.org/t/how-to-search-the-logs-which-contain-the-word-exception/1822 "2017-07-24T10:03:31Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![hefanxu](https://avatars.discourse-cdn.com/v4/letter/h/278dde/32.png) [@hefanxu](https://community.graylog.org/u/hefanxu)\
**Post date:** [July 24, 2017, 10:03am UTC](https://community.graylog.org/t/how-to-search-the-logs-which-contain-the-word-exception/1822/1 "2017-07-24T10:03:31Z")

</div>

Hi,

I’m trying to define some alert which condition will check if the message contain any exceptions. But when I try to do the search with query message:“Exception” it would only filter the message contain the word “Exception” alone.  
Some messages which contain some messages like the “NullPointException” will not be included.  
Do we have any way to filter the message contain some words or end with some words?

---

<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:** [July 25, 2017, 12:05pm UTC](https://community.graylog.org/t/how-to-search-the-logs-which-contain-the-word-exception/1822/2 "2017-07-25T12:05:25Z")

</div>

If you want to include matches like `NullPointerException` you have to allow leading wildcard searches in your Graylog configuration file and search for `*Exception`.

> <https://github.com/Graylog2/graylog2-server/blob/2.2.3/misc/graylog.conf#L260-L262>

---

<div class="post-metadata">

**Author:** ![hefan\_xu](https://avatars.discourse-cdn.com/v4/letter/h/f4b2a3/32.png) [@hefan\_xu](https://community.graylog.org/u/hefan_xu)\
**Post date:** [July 25, 2017, 1:20pm UTC](https://community.graylog.org/t/how-to-search-the-logs-which-contain-the-word-exception/1822/3 "2017-07-25T13:20:57Z")

</div>

thanks for your feedback, the wildcard finally works for me. That block me to define the alert notification. When using the wildcard in the alert, it will add the quote mark for the content.

发自我的小米手机

在 Jochen [graylog@discoursemail.com](mailto:graylog@discoursemail.com)，2017年7月25日 下午8:15写道：

---

<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:** [August 8, 2017, 1:21pm UTC](https://community.graylog.org/t/how-to-search-the-logs-which-contain-the-word-exception/1822/4 "2017-08-08T13:21:11Z")

</div>

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