from logs-aws_bedrock.invocation-*
| MV_EXPAND gen_ai.policy.name
| where gen_ai.policy.action == "BLOCKED" and gen_ai.compliance.violation_detected == "true" and gen_ai.policy.name == "word_policy"
| keep user.id
| stats profanity_words= count() by user.id
| where profanity_words > 5
| sort profanity_words desc
Install detection rules in Elastic Security
Detect Unusual High Word Policy Blocks Detected in the Elastic Security detection engine by installing this rule into your Elastic Stack.
To setup this rule, check out the installation guide for Prebuilt Security Detection Rules(opens in a new tab or window).