

# Trigger custom actions on anomalous behavior (Amazon Web Services Management Console)
<a name="trigger-custom-actions-anomalous-behavior"></a>

You can enable **custom actions in response to anomalous behavior** by using **Amazon IoT SiteWise MQTT notifications** in combination with **Amazon IoT Core**.

Follow these steps to configure MQTT notifications in Amazon IoT SiteWise, and trigger a custom action in Amazon IoT Core based on inference results:
+ Locate the asset in Amazon IoT SiteWise, where the inference runs.
+ Identify the property you used as the `resultProperty` when creating the computation model. Enable **MQTT Notification** for this property.
+ Once you enable **MQTT Notification**, copy the **Notification Topic** that Amazon IoT SiteWise generates.
+ Navigate to Amazon IoT Core. Under MQTT test client, subscribe to the copied **Notification Topic** to monitor the incoming messages.
+ Create an **Amazon IoT Core Rule** to **Process Inference Results**. (This ensures that actions are triggered only if the system detects an anomaly). Replace `notification-topic` with the **Notification Topic** that Amazon IoT SiteWise generates.

```
SELECT * FROM "notification-topic"
  WHERE indexof(get(get(payload.values, 0).value, 'stringValue'), "NO_ANOMALY_DETECTED") < 0
```

Configure the rule to trigger any of the actions that Amazon IoT Core supports. Learn more about the actions supported by [Amazon IoT Core](https://docs.amazonaws.cn/iot/latest/developerguide/iot-rule-actions.html).