# Get admin notification from logs?

**URL:** https://meta.discourse.org/t/get-admin-notification-from-logs/363729
**Category:** Support
**Tags:** notifications
**Created:** [April 28, 2025, 4:09am UTC](https://meta.discourse.org/t/get-admin-notification-from-logs/363729 "2025-04-28T04:09:13Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![piffy](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/piffy/32/254198_2.png) [@piffy](https://meta.discourse.org/u/piffy)
#### Post date: [April 28, 2025, 4:09am UTC](https://meta.discourse.org/t/get-admin-notification-from-logs/363729/1 "2025-04-28T04:09:13Z")

</div>

**Question** : Is there a way for admins/moderator to get some kind of push notification from the “Logs & screening” section? Like a message from the Automation plugin or something?

**Context** : We have had a couple incidents where old accounts are compromised and the email is changed. These accounts are then being used to message people and scam users.

I noticed that the `add email` log entries can be used to identify this issue in advance, though I don’t want to constantly be checking it. Is there a way to get a notification when this type of log entry shows up?

---

<div class="post-metadata">

### Author: ![piffy](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/piffy/32/254198_2.png) [@piffy](https://meta.discourse.org/u/piffy)
#### Post date: [April 30, 2025, 10:29pm UTC](https://meta.discourse.org/t/get-admin-notification-from-logs/363729/3 "2025-04-30T22:29:59Z")

</div>

I got this [data explorer](https://meta.discourse.org/t/32566?silent=true) query that I added as a report that can allow checking but doesn’t do a “push” notification when there’s an update.

```sql
SELECT 
    uh.action,
    acting.username AS acting_user,
    target.username AS target_user,
    uh.updated_at
FROM user_histories uh
LEFT JOIN users acting ON acting.id = uh.acting_user_id
LEFT JOIN users target ON target.id = uh.target_user_id
WHERE uh.action = 88
  AND uh.updated_at > CURRENT_DATE - INTERVAL '7 days'
ORDER BY uh.updated_at DESC
LIMIT 100

```

---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [May 7, 2025, 12:05pm UTC](https://meta.discourse.org/t/get-admin-notification-from-logs/363729/4 "2025-05-07T12:05:42Z")

</div>

Could you refine that query slightly and rig it up to a recurring ‘schedule a PM with [data explorer](https://meta.discourse.org/t/32566?silent=true) results’ automation? If you select ‘skip if no results’ and adjust the automation frequency to match the time interval in the query then it may work as a ‘push notification’ type ping?

Something like this (with a recurring automation frequency of 30 minutes):

```sql
SELECT 
    uh.created_at AS "email updated",
    uh.acting_user_id,
    uh.target_user_id
FROM user_histories uh
WHERE uh.action = 88
  AND uh.updated_at > CURRENT_TIMESTAMP - INTERVAL '30 minutes'
ORDER BY 1 DESC

```

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [June 6, 2025, 12:06pm UTC](https://meta.discourse.org/t/get-admin-notification-from-logs/363729/5 "2025-06-06T12:06:12Z")

</div>

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