Hello @Mohamed jihad bayali
Your issue here I believe is the maximum time range that the alert can look back.
The alert time range is limited to a maximum of two days. Even if the query contains an ago command with a time range of longer than 2 days, the 2 day maximum time range is applied. For example, even if the query text contains ago(7d), the query only scans up to 2 days of data.
https://learn.microsoft.com/en-us/azure/azure-monitor/alerts/alerts-create-new-alert-rule?tabs=log
If you click advanced settings and check the override query time range you will see it is set to 2 days. As 168hrs (7 days) is set in your query, it will default to the maximum allow time range of 2 days. Hence why you do not have any alerts for the devices you have listed above.
I hope this helps provide you with the information you need. If it does, please make sure to mark the question as answered so it helps other people in future.
Kind Regards
Alistair