from logs-azure_openai.logs-*
| eval
Esql.time_window_date_trunc = date_trunc(1 minutes, @timestamp)
| where azure.open_ai.operation_name == "ChatCompletions_Create"
| keep
azure.open_ai.properties.request_length,
azure.resource.name,
cloud.account.id,
Esql.time_window_date_trunc
| stats
Esql.event_count = count(*),
Esql.azure_open_ai_properties_request_length_avg = avg(azure.open_ai.properties.request_length)
by
Esql.time_window_date_trunc,
azure.resource.name
| where
Esql.event_count >= 10 and
Esql.azure_open_ai_properties_request_length_avg >= 5000
| sort Esql.event_count desc
Install detection rules in Elastic Security
Detect Potential Denial of Azure OpenAI ML Service 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).