# Exclude word in log injection rules

**URL:** <https://community.dynatrace.com/t/exclude-word-in-log-injection-rules/43729>\
**Category:** Logs\
**Tags:** log-configuration, log-monitoring-class\
**Created:** [January 19, 2024, 9:24pm UTC](https://community.dynatrace.com/t/exclude-word-in-log-injection-rules/43729 "2024-01-19T21:24:57Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![alex94](https://avatars.discourse-cdn.com/v4/letter/a/a183cd/32.png) [@alex94](https://community.dynatrace.com/u/alex94)\
**Post date:** [January 19, 2024, 9:24pm UTC](https://community.dynatrace.com/t/exclude-word-in-log-injection-rules/43729/1 "2024-01-19T21:24:57Z")

</div>

Hello,

is there a way to exclude word when making a log ingest rules for a host?

For example, I want to include in Storage logs that match “/health/ready” but doens’t have “StatusCode: 200”.

How can i write a not matching expression?

Thank you

---

<div class="post-metadata">

**Author:** ![Pawel\_Zalewski](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/pawel_zalewski/32/8101_2.png) [@Pawel\_Zalewski](https://community.dynatrace.com/u/Pawel_Zalewski)\
**Post date:** [January 20, 2024, 3:22pm UTC](https://community.dynatrace.com/t/exclude-word-in-log-injection-rules/43729/2 "2024-01-20T15:22:55Z")

</div>

Hi,

There are only 2 options:

1. If no wildcard is used in the value, then the matcher looks for an exact fit to the value.
2. If a wildcard is used, the matcher looks for the exact match.

For example, the value&nbsp;INFO&nbsp;results in sending only the log data having the exact&nbsp;INFO&nbsp;string, but the value&nbsp;\*INFO\*&nbsp;(using the wildcards) matches log data that contain the&nbsp;INFO&nbsp;string in its content.

---

<div class="post-metadata">

**Author:** ![PacoPorro](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/pacoporro/32/36087_2.png) [@PacoPorro](https://community.dynatrace.com/u/PacoPorro)\
**Post date:** [January 22, 2024, 7:22am UTC](https://community.dynatrace.com/t/exclude-word-in-log-injection-rules/43729/3 "2024-01-22T07:22:48Z")

</div>

Can I suggest to use 2 rules?&nbsp;  
1st rule should exclude&nbsp;StatusCode: 200  
2nd rule should include&nbsp;/health/ready

---

<div class="post-metadata">

**Author:** ![alex94](https://avatars.discourse-cdn.com/v4/letter/a/a183cd/32.png) [@alex94](https://community.dynatrace.com/u/alex94)\
**Post date:** [January 22, 2024, 1:12pm UTC](https://community.dynatrace.com/t/exclude-word-in-log-injection-rules/43729/4 "2024-01-22T13:12:55Z")

</div>

Thank you for the info!

We are new to Dynatrace and I am currently looking at the different possibilities of ingest rules to make sure we don’t keep useless logs because we have a lot of them.

I wanted to know if that was possible to do it with one rules, but i can for sure do it with multiple rules using include and exclude.

---

<div class="post-metadata">

**Author:** ![PacoPorro](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/pacoporro/32/36087_2.png) [@PacoPorro](https://community.dynatrace.com/u/PacoPorro)\
**Post date:** [January 22, 2024, 1:15pm UTC](https://community.dynatrace.com/t/exclude-word-in-log-injection-rules/43729/5 "2024-01-22T13:15:23Z")

</div>

As far as I know, it is not possible to use a single rule.  
Note that rules are evaluated from top to bottom, which means that exclusion must come before inclusion.
