Skip to main content

Move Defender XDR Custom Detections to Continuous (NRT) Frequency Safely

Check which Defender XDR custom detection rules can run continuously, move them one at a time, and keep a way back.

Close-up of a smartphone showing incognito browser mode, held by a person.

Underlined words are defined in the KBY Lexicon. Tap or click one to see what it means.

A scheduled custom detection rule only looks for matches when its next run comes round. Continuous (NRT) frequency checks events as they are collected and processed, but only for queries that meet a short list of conditions.

Everything here is based on Microsoft’s Defender documentation as it read on 27 November 2026, when the pages carried a last-updated date of 22 November 2026. Two parts of the feature are still labelled preview in those pages, so check the current wording before you plan a change window.

#Why it matters that a scheduled rule answers late

A custom detection rule is an advanced hunting query that runs at a set frequency and raises alerts and response actions when it matches. The frequency options are every 24 hours, every 12 hours, every 3 hours, hourly and Continuous (NRT). A custom option exists too, but only for rules that use data ingested into Microsoft Sentinel.

For rules on Defender data, the frequency also fixes the lookback window. A 24-hour rule looks back 30 days, a 12-hour rule 48 hours, a 3-hour rule 12 hours and an hourly rule four hours. Rules evaluate when data was ingested rather than when the event happened, so an event with an older timestamp can still be picked up.

That is why moving a rule to Continuous (NRT) is worth considering. Microsoft says the frequency has minimal to no impact on your organisation’s resource usage, and suggests considering it for any qualified rule. The word that matters is qualified, because a rule that does not meet the conditions simply cannot use it.

Qualifying is only half the job, because a rule also has to keep the fields that make an alert useful once it has moved. Changing the frequency does not change what a rule detects. Detection logic, tuning and the choice of response actions stay with the rule’s owner.

#How the pieces fit: what makes a query continuous

The portal decides eligibility from the query text. A query can run continuously only when it meets all four of these conditions:

  • It references one table only.
  • It uses only operators from the list of supported KQL features. For the matches regex operator, the expression must be written as a string literal with the usual quoting, so the regular expression \A becomes "\\A".
  • It uses no joins, no unions and no externaldata operator.
  • It contains no comment lines or other comment information.

The table has to be on the supported list as well. For Defender data that list includes DeviceEvents, DeviceProcessEvents, DeviceFileEvents, DeviceNetworkEvents, DeviceLogonEvents, EmailEvents, EmailAttachmentInfo, EmailUrlInfo, IdentityLogonEvents, CloudAppEvents and AlertEvidence, among others. EmailEvents is supported except for its LatestDeliveryLocation and LatestDeliveryAction columns, and only generally available columns count at all.

The query must also keep returning what the alert needs. For Defender for Endpoint tables, Microsoft recommends returning Timestamp, DeviceId and ReportId, so the alert is tagged with the correct device group scope and the process tree can be built. For other Defender tables the recommendation is Timestamp and ReportId taken from the same event. A plain query returns these columns without help. A query that uses project or summarize can drop them.

Time filtering works differently from ordinary hunting. The service prefilters data by the rule’s lookback and evaluates ingestion_time(), not the event timestamp, to allow for ingestion delay. Microsoft’s advice is to avoid filtering on Timestamp or TimeGenerated unless you want to narrow the window on purpose.

Rendering diagram...

A detective's hand adjusts knobs on a vintage tape recorder, suggesting investigation or espionage.
Photo by cottonbro studio on Pexels

#Rolling it out one rule at a time

Because the portal checks eligibility for you, the main risk is not a failed migration. It is an eligible rule that moves with a query nobody has read for a year. The order below keeps every change small and reversible.

  1. Open Investigation & response then Detection then Custom detection rules and list the rules. The page shows each rule’s last run, last run status, next run and status.
  2. Open each rule you might move. Copy its query, frequency, alert settings, automated actions and scope into your change record. The rule details page shows the general information, run status and scope, and the Edit wizard shows the rest.
  3. Pick the pilot rules. Start with rules that raise alerts only and take no automated action, because a rule with automated actions acts on the devices or users its query returns, at whatever frequency it runs.
  4. For a rule that is close to eligible, fix the query first in advanced hunting. One cause that is easy to miss is a comment line at the top, which blocks the migration while changing nothing the rule detects.
  5. On the custom detection rules page, select Migrate now. The portal lists every rule whose KQL is compatible. Tick only your pilot rules, not all of them, and select Save.
  6. Repeat for the next batch once the validation checks below pass.

Following along? Tap a step’s number to tick it off.

This change updates the frequency of every rule you tick, so treat it as a state change. The precondition is a recorded query, frequency and scope for each rule. The is that record. The rollback is in the last section.

The query below is Microsoft’s sample for a continuous-eligible rule. It counts antivirus detections per device and keeps the latest Timestamp and ReportId for each:

1DeviceEvents
2| where ingestion_time() > ago(1d)
3| where ActionType == "AntivirusDetection"
4| summarize (Timestamp, ReportId)=arg_max(Timestamp, ReportId), count() by DeviceId
5| where count_ > 5

Now take the same query with a comment line added at the top, which is a natural place to record an owner or a ticket number. The detection logic is unchanged, but the rule no longer qualifies:

1// Owner: SOC tier 2, ticket SEC-1234
2DeviceEvents
3| where ingestion_time() > ago(1d)
4| where ActionType == "AntivirusDetection"
5| summarize (Timestamp, ReportId)=arg_max(Timestamp, ReportId), count() by DeviceId
6| where count_ > 5

Move the owner and ticket into the rule’s description, which is a field in the alert settings, then remove the comment line from the query. A rule that joins two tables is a different case. It needs a redesign, for example as two separate single-table rules, and that is a detection decision rather than a frequency change, so leave it on a scheduled frequency until its owner decides.

#Check it worked before you move the next batch

Do not read a quiet rule as a healthy one. Confirm each pilot rule against its own record from before the change, and give it time to match something.

  1. On the custom detection rules page, check that the rule’s status is on and its last run status shows success.
  2. Open the rule and review Triggered alerts. A new alert should carry the device or other impacted asset that earlier alerts from this rule carried.
  3. For a device rule, open one alert and confirm the process tree is present. A missing tree points to a query that no longer returns DeviceId and ReportId.
  4. Open Triggered actions and confirm it lists only the actions you expect, and none for an alert-only rule.
  5. Compare the alert count over the first full day with the same period before the change.

Pass means the status is on, the last run succeeded and new alerts carry the same entities as before. Stop and move to the rollback if any of these fail, or if the count jumps well beyond what the rule’s owner expects.

The documentation does not say whether saving a new frequency on an existing rule triggers another 30-day check, as saving a new rule does. It says only that edits apply from the next scheduled run. Watch an alert-only pilot rule first for that reason, and do not assume either behaviour for a rule with response actions.

Industrial optical switch with connected rubber cables of different colors with stickers representing letters and numbers and plastic terminations
Photo by Brett Sayles on Pexels

#What goes wrong

  • A rule is missing from the Migrate now list. Its query breaks one of the four conditions, uses a table or column that is not supported, or contains a comment. Compare it with the conditions above, one at a time.
  • Alerts arrive without a device or lose their process tree. The query was rewritten with summarize or project and no longer returns DeviceId and ReportId. Use the arg_max pattern from the sample to keep them.
  • A rule matches far more than expected. Each run can create at most 150 alerts, so a broad query can hit that ceiling. Narrow the query rather than raising expectations. Microsoft’s own advice is to tune the query so it does not alert on normal, day-to-day activity.
  • Custom details vanish from alerts. A rule can carry up to 20 key-value pairs, and the combined size of custom details in one alert is limited to 4 KB. Beyond that, the whole custom details array is dropped from the alert.
  • A device never alerts at all. The rule can only see data that devices report, so first check whether the device is onboarded and active. The KBY guide on Defender for Endpoint devices stuck onboarding or inactive covers that.
  • The same event appears twice. Duplicates can occur when a lookback is longer than the frequency. The service groups and deduplicates events with identical entities, custom details and dynamic details into one alert, so most duplicates collapse. That deduplication is separate from grouping alerts into incidents.

One more limit affects any rule you tune after the move: alert grouping into incidents is in preview and holds up to 150 alerts per incident. Closed incidents are not reopened, so a new matching alert creates a new incident.

#Permissions for changing these rules

Managing custom detections needs a role that covers the data the rule queries. For Defender data that means the Security settings (manage) permission, or the Security Administrator or Security Operator role in Microsoft Entra. Security Operator is enough only when role-based access control is off in Defender for Endpoint. Otherwise the person also needs the Manage Security Settings permission there.

Device scope is a second check. A user can create or edit a rule only with permissions for the devices in its scope, so someone without access to all devices cannot edit a rule scoped to all devices. Microsoft advises using the roles with the fewest permissions and keeping Global Administrator for emergencies.

For this change, give the migration to the smallest group that owns the rules, and review the alert and action trail afterwards. Automated actions deserve the most care. A rule acts on the devices in the DeviceId column of its results, and the device actions include isolating the device, collecting an investigation package, running an antivirus scan, starting an investigation and restricting app execution.

Faster detection with those actions attached means faster action. That is an inference, because Microsoft documents the frequency and the actions separately, but it is the reason this article starts with alert-only rules.

#Backing out a frequency change

Every step above has a way back, and each relies on the record taken before the change.

  1. To return a rule to its earlier frequency, open the rule, select Edit, set the frequency recorded in your change record and save. The new schedule applies from the rule’s next run.
  2. To pause a rule while you decide, use Turn off. This stops it running and keeps its definition.
  3. If you changed a query, paste the recorded query back in the Edit wizard.
  4. If a rule’s automated action isolated devices unexpectedly, release them from the device page. Microsoft’s guidance says isolation lifts automatically after seven days, and that a device offline when isolation is submitted is retried for up to three days.

Avoid Delete as a rollback, because it turns the rule off and removes it permanently. Once the pilot rules have run cleanly for a few days, move the next batch. The useful end state is a record, kept with the rules, of each rule’s query, owner, frequency and why it qualified, so the next person who edits a query knows what a comment line or a join would cost.

About this page

Credited to

Dates

Published

Sources

This page lists no external sources.

Corrections

No corrections are listed for this page. Some review sweeps corrected pages without naming each one; those are in the corrections log.

Found this useful? Follow KBY for more like it.

Reader Interaction

Comments

Add a thoughtful note on Move Defender XDR Custom Detections to Continuous (NRT) Frequency Safely. Comments are checked for spam and held for moderation before appearing.

Loading comments...

More from KBY that goes with this article.

Discover more

Lexicon Definitions

Was this useful?

Reports go to the site owner and are used to correct pages. Corrections are listed at /corrections.

Engineering insights, direct to you.

Receive the latest Systems Engineering tutorials, production guides, Engineering Labs and operational best practices.