Building a Program
This section describes how to download and use the program package (index.zip) for log alarms.
Creating a Function
Create a function for extracting logs and upload the sample code package, as shown in Figure 1. For details, see section "Function Management" in the FunctionGraph User Guide.
This function analyzes received operation records, filters logins or logouts from unauthorized IP addresses using a whitelist, and sends alarms under a specified SMN topic.
Setting Environment Variables
On the Configuration tab page of the function, set the environment variables and SMN topic name, as shown in Table 1.
Environment Variable |
Description |
---|---|
SMN_Topic |
SMN topic name. |
RegionName |
Region. |
IP |
IP address whitelist. |
Set the environment variables (Figure 2) by following the procedure in section "Environment Variables" in the FunctionGraph User Guide.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.