Analytic Rules not triggering but data is on log analytics

Arthur Moreth 20 Reputation points
2025-04-24T18:19:52.8333333+00:00

Hi Guys,
I'm try to resume the question.
I created an analytics rule for a specific situation. If I take the KQL and put it in the Analytics Log, it returns the records I want. But it doesn't trigger the incident at all. I have several incidents with the same structure (just changing the KQL) and they all trigger normally. Only this one doesn't.

I've tried to check the time within KQL, but I didn't get the same result. I've tried to make NRT rules and I also didn't get any results. Each one generates a different number of incidents, but everything is in the analitycs log.

Edit: I put more details in the anwser for the first comment

Microsoft Sentinel
Microsoft Sentinel
A scalable, cloud-native solution for security information event management and security orchestration automated response. Previously known as Azure Sentinel.
1,268 questions
0 comments No comments
{count} votes

Accepted answer
  1. Clive Watson 7,636 Reputation points MVP
    2025-04-24T21:34:14.8633333+00:00

    Hi, this is really hard to triage without seeing some / most of the code as an example, which maybe in another thread?

    Typical issues (I suspect you have discounted 1 & 2):

    1. certain commands like union * are not supported in a detection
    2. detections that look back more than 14days
    3. Supporting data from some sources may have arrived later due to latency, so when the detection ran at say 9:00 it failed, however at 9:02 (or whatever time) the data arrived so it would be picked up in the next run (assuming your sliding window looks back far enough), and would be there when you look later in the day manually!

    e.g. add this at line one and test in your logs blade

    set query_now = datetime(2025-04-24T15:15:00.0000000Z);
    < add your query >
    

    source: https://learn.microsoft.com/en-us/kusto/api/rest/request-properties?view=microsoft-fabric

    and

    https://techcommunity.microsoft.com/blog/microsoftsentinelblog/handling-sliding-windows-in-azure-sentinel-rules/1505394

    You can see query_now in action by a quick test, run these two example queries:

    // Run this to simulate a fixed point in time 
    set query_now = datetime(2025-04-24T15:15:00.0000000Z);
    print now()
    
    
    // run this to show the "real" current time 
    print now()
    

    As an Example sometimes there are delays from Defender products (look at the ProcessingTime)

    SecurityIncident
    | extend Alerts = extract("\\[(.*?)\\]", 1, tostring(AlertIds))
    | mv-expand AlertIds to typeof(string), Labels to typeof(string), Comments to typeof(string), AdditionalData to typeof(string)
    | join kind=leftouter
    (
        SecurityAlert
         | extend ProductProcessingMin = datetime_diff('minute',  ProcessingEndTime, EndTime), ingest_ = ingestion_time()
         | extend sentinelIngestionDelayinMinutes_ = datetime_diff('minute', ingestion_time(), ProcessingEndTime)
         | extend StarttoEndDelayinMinutes_ = datetime_diff('minute', EndTime, StartTime)
    ) on $right.SystemAlertId == $left.AlertIds
    | summarize AlertCount=dcount(AlertIds),arg_max(TimeGenerated, *) by IncidentNumber
    | extend sentinelIngestiontoCreated_ = datetime_diff('minute', ingest_, CreatedTime)
    | extend InvestigationElapsedTime_   = datetime_diff('minute', LastModifiedTime, CreatedTime)
    | summarize arg_max(TimeGenerated,*) by IncidentNumber
    | project IncidentNumber, Title, StartTime, EndTime, ProcessingEndTime, TimeGenerated, ingest_, StarttoEndDelayinMinutes_, ProductProcessingMin,
            sentinelIngestionDelayinMinutes_, AlertName, FirstActivityTime, LastModifiedTime, 
            CreatedTime
            , InvestigationElapsedTime_ 
            , sentinelIngestiontoCreated_
            , Severity, Status, Comments, ProductName, ProviderName
    

    example
    User's image


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.