KQL related question -- How to make the a query that would combine 3 columns into one specific column

Ranniell Dalope 0 Reputation points
2026-06-05T07:45:58.2866667+00:00
  • I am trying to create a KQL query aggregate 3 different column that has the same TimeGenerated.
  • It has the same operation, but different values for the 2 other column.

What I am trying to see is:

| project TimeGenerated, AuditChange

AuditChange would result into [{Target:"",OldValue:"",NewValue:""}]

Microsoft Security | Microsoft Sentinel

1 answer

Sort by: Newest
  1. AI answer

    2026-06-05T07:46:10.4133333+00:00

    Use summarize to aggregate the rows that share the same TimeGenerated, then project a single dynamic column that combines the three fields into an array of objects.

    Assuming the three columns are Target, OldValue, and NewValue, and each row with the same TimeGenerated has one set of values:

    YourTable
    | summarize AuditChange = make_list(
        pack(
            "Target",   Target,
            "OldValue", OldValue,
            "NewValue", NewValue
        )
    ) by TimeGenerated
    | project TimeGenerated, AuditChange
    

    Result shape:

    • TimeGenerated: one row per timestamp
    • AuditChange: dynamic array like [{"Target":"...","OldValue":"...","NewValue":"..."}, ...]

    If there is only ever one row per TimeGenerated and you just want a single object instead of an array, use make_bag() instead of make_list() and adjust the pack() accordingly.


    References:

    AI-generated content may be incorrect. Read our transparency notes for more information.

    Was this answer helpful?

Your answer

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