text code block:FROM .alerts-security.* | where kibana.alert.rule.name is not null and kibana.alert.risk_score >= 73 and not kibana.alert.rule.type in ("threat_match", "machine_learning", "new_terms") and not kibana.alert.rule.name like "Deprecated - *" and kibana.alert.rule.name != "My First Rule" and // covered by 7306ce7d-5c90-4f42-aa6c-12b0dc2fe3b8 event.dataset != "endpoint.alerts" | STATS Esql.alerts_count = count(*), Esql.first_time_seen = MIN(@timestamp), Esql.last_time_seen = MAX(@timestamp), Esql.process_executable = VALUES(process.executable), Esql.cmd_line = VALUES(process.command_line), Esql.parent_executable = VALUES(process.parent.executable), Esql.file_path_values = VALUES(file.path), Esql.file_path_values = VALUES(file.path), Esql.dll_path_values = VALUES(dll.path), Esql.user_id_values = VALUES(user.id), Esql.user_name_values = VALUES(user.name), Esql.agent_id_values = VALUES(agent.id), Esql.host_id_values = VALUES(host.id), Esql.event_module_values = VALUES(event.module), Esql.source_ip_values = VALUES(source.ip), Esql.agents_distinct_count = COUNT_DISTINCT(agent.id) by kibana.alert.rule.name // fist time seen in the last 5 days - defined in the rule schedule Additional look-back time | eval Esql.recent = DATE_DIFF("minute", Esql.first_time_seen, now()) // first time seen is within 10m of the rule execution time | where Esql.recent <= 10 and Esql.agents_distinct_count == 1 and Esql.alerts_count <= 10 and (Esql.last_time_seen == Esql.first_time_seen) | keep kibana.alert.rule.name, Esql.*
Install detection rules in Elastic Security
Detect Newly Observed High Severity Detection Alert 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(external, opens in a new tab or window).