# Threshold Rule : API has dynamic id in its signature

**URL:** <https://discuss.elastic.co/t/threshold-rule-api-has-dynamic-id-in-its-signature/303700>\
**Category:** Elastic Observability\
**Created:** [May 2, 2022, 2:23am UTC](https://discuss.elastic.co/t/threshold-rule-api-has-dynamic-id-in-its-signature/303700 "2022-05-02T02:23:15Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![VijayM](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vijaym/32/101719_2.png) [@VijayM](https://discuss.elastic.co/u/VijayM)\
**Post date:** [May 2, 2022, 2:23am UTC](https://discuss.elastic.co/t/threshold-rule-api-has-dynamic-id-in-its-signature/303700/1 "2022-05-02T02:23:15Z")

</div>

API signature has an argument {txn-id} in its URI, which gets value dynamically :  
transaction.name : “GET /api/abx/granter/{txn-id}”

Appreciate your help on how to build the alert for this situation.  
I'm using "Threshold Rule"

---

<div class="post-metadata">

**Author:** ![simianhacker](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/simianhacker/32/3383_2.png) [@simianhacker](https://discuss.elastic.co/u/simianhacker)\
**Post date:** [May 4, 2022, 3:38pm UTC](https://discuss.elastic.co/t/threshold-rule-api-has-dynamic-id-in-its-signature/303700/2 "2022-05-04T15:38:13Z")

</div>

Which "Threshold" rule? There is the "Metric Threshold Rule", "Inventory Threshold Rule", "Log Threshold Rule", "Error Count Threshold", and "Index Threshold Rule".

Are you trying to set `{txn-id}` in one of the actions?

---

<div class="post-metadata">

**Author:** ![VijayM](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vijaym/32/101719_2.png) [@VijayM](https://discuss.elastic.co/u/VijayM)\
**Post date:** [May 5, 2022, 1:30am UTC](https://discuss.elastic.co/t/threshold-rule-api-has-dynamic-id-in-its-signature/303700/3 "2022-05-05T01:30:18Z")

</div>

Hi,  
Pls refer to the case #00933935.

For that case, I'm told :  
We are [currently](https://github.com/elastic/kibana/pull/125876) work to have filter for transaction name in the `apm lantency threshold rule type` but for now you can use this example to create transaction filters :

- Click on “Metrics” under the “Observability” second in the left hand navigation
- Click on “Settings” in the upper right hand corner of the screen
- Add your **apm index** pattern to the “Metric indices” field.
- Click on `Alerts and Rules > Metrics > Create threshold rule` in the upper right hand corner of the screen
- Create an alert that looks like the following add the filter which might be `transaction.name: "GET /transaction"` and `service.name: "service_name"` :

Trying to use the above approach suggested by elastic and am stuck.  
No I'm not setting the {txn-id}, just passing as is : transaction.name : “GET /api/abx/granter/{txn-id}”

---

<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:** [November 4, 2022, 8:35am UTC](https://discuss.elastic.co/t/threshold-rule-api-has-dynamic-id-in-its-signature/303700/4 "2022-11-04T08:35:22Z")

</div>


