Simulating an Alert Rule
Function
Simulate alert rule
Calling Method
For details, see Calling APIs.
URI
POST /v1/{project_id}/workspaces/{workspace_id}/siem/alert-rules/simulation
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
project_id |
Yes |
String |
Project ID. |
workspace_id |
Yes |
String |
Workspace ID. |
Request Parameters
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
X-Auth-Token |
Yes |
String |
User token. You can obtain the token by calling the IAM API used to obtain a user token. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
pipe_id |
Yes |
String |
Data pipeline ID. |
query |
Yes |
String |
Query statement. |
query_type |
No |
String |
Query syntax: SQL. |
from |
Yes |
Long |
Start time. |
to |
Yes |
Long |
End time. |
event_grouping |
No |
Boolean |
Alert group. |
triggers |
Yes |
Array of AlertRuleTrigger objects |
Alert triggering rules. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
mode |
No |
String |
Mode and quantity. COUNT. |
operator |
No |
String |
Operator. The value can be: EQ: Equal to NE: Not equal to GT: Greater than LT: Less than |
expression |
Yes |
String |
expression |
severity |
No |
String |
Severity. The options are Informational, Low, Medium, High, and Critical. (TIPS, LOW, MEDIUM, HIGH, FATAL) |
accumulated_times |
No |
Integer |
accumulated_times |
Response Parameters
Status code: 200
Parameter |
Type |
Description |
---|---|---|
X-request-id |
String |
This field is the request ID number for task tracking. Format is request_uuid-timestamp-hostname. |
Parameter |
Type |
Description |
---|---|---|
alert_count |
Integer |
Number of alerts. |
severity |
String |
Severity. The options are Informational, Low, Medium, High, and Critical. (TIPS, LOW, MEDIUM, HIGH, FATAL) |
Status code: 400
Parameter |
Type |
Description |
---|---|---|
X-request-id |
String |
This field is the request ID number for task tracking. Format is request_uuid-timestamp-hostname. |
Example Requests
Simulate an alert rule. The ID of the pipe to which the alarm rule belongs is ead2769b-afb0-45dd-b9fa-a2953e6ac82f, the query type is SQL, and the severity is Warning.
{ "pipe_id" : "ead2769b-afb0-45dd-b9fa-a2953e6ac82f", "query" : "* | select status, count(*) as count group by status", "query_type" : "SQL", "event_grouping" : true, "from" : 1665221214000, "to" : 1665546370000, "triggers" : [ { "mode" : "COUNT", "operator" : "GT", "expression" : 10, "severity" : "TIPS" } ] }
Example Responses
Status code: 200
Request succeeded.
{ "alert_count" : 100, "severity" : "TIPS" }
Status Codes
Status Code |
Description |
---|---|
200 |
Request succeeded. |
400 |
Request failed. |
Error Codes
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot