Test Data Model Rules
Cortex XSIAM steps for testing data model rules.
After writing data model rules, test them to ensure the rules work as expected.
There are two ways to test the modeling rules:
Use an XQL query in the Cortex XSIAM UI.
Create a data model test configuration and execute the test using
demisto-sdk.
Example JSON and data modeling rules
Use the sample JSON and data model rules as described in Create data model rules.
The JSON file represents the ingested events:
[
{
"id": "1234",
"message": "New user added 'root2'",
"type": "audit",
"op": "add",
"result": "success",
"host_info": {
"host": "prod-01",
"os": "Windows"
},
"created": "1676764803"
},
{
"id": "1235",
"message": "User 'root2' delete failed, permission denied",
"type": "audit",
"op": "delete",
"result": "failed",
"host_info": {
"host": "prod-01",
"os": "Windows"
},
"created": "1676764823"
}
]The following are sample data model rules:
Test data model rules using the Cortex XSIAM UI
After creating the XDM rules and ensuring no errors were raised, construct a new XQL query with the fields mapped in the data model. Using the data model above, the query looks like this:
datamodel dataset in("MyVendor_MyProduct_raw") |
FIELDS
xdm.event.id,
xdm.event.description,
xdm.event.type,
xdm.event.outcome,
xdm.event.operation,
xdm.event.is_completed,
xdm.source.hostname,
xdm.source.os_family
Last updated
Was this helpful?
