# Kibana rules/alerts "If alert matches a query" not working for custom fields

**URL:** <https://discuss.elastic.co/t/kibana-rules-alerts-if-alert-matches-a-query-not-working-for-custom-fields/343580>\
**Category:** Kibana\
**Created:** [September 21, 2023, 11:54pm UTC](https://discuss.elastic.co/t/kibana-rules-alerts-if-alert-matches-a-query-not-working-for-custom-fields/343580 "2023-09-21T23:54:25Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![arislawrence](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/arislawrence/32/125910_2.png) [@arislawrence](https://discuss.elastic.co/u/arislawrence)\
**Post date:** [September 21, 2023, 11:54pm UTC](https://discuss.elastic.co/t/kibana-rules-alerts-if-alert-matches-a-query-not-working-for-custom-fields/343580/1 "2023-09-21T23:54:25Z")

</div>

Elasticsearch, Kibana, Logstash and Beats using version 8.9.1 or 8.10.1

When creating Kibana rules for Log threshold or Metric threshold, the "If alert matches a query" defined is a custom fields, it will not process the action - Webhook but will still trigger the alert.

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/b/b/bb0bf420cc33a78e5855831d0740b90698096220.png)

Adding the filter in the "Condition" and removing it from the "If alert matches a query" will work.

How can i achieve this inside the Actions instead of creating multiple Rules? Thanks

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [October 19, 2023, 11:54pm UTC](https://discuss.elastic.co/t/kibana-rules-alerts-if-alert-matches-a-query-not-working-for-custom-fields/343580/2 "2023-10-19T23:54:33Z")

</div>

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