Forum Discussion
Ashok42470
Feb 20, 2025Copper Contributor
Need assistance on KQL query for pulling AKS Pod logs
I am trying to pull historical pod logs using below kql query. Looks like joining the tables; containerlog and KubePodInventory didn't go well as i see lot of duplicates in the output. ContainerLog ...
Kidd_Ip
Feb 22, 2025MVP
Take this:
ContainerLog
| join kind=inner (
KubePodInventory
| where ServiceName == "<<servicename>>"
) on ContainerID
| project TimeGenerated, Namespace, ContainerID, ServiceName, LogEntrySource, LogEntry, Name1
| distinct TimeGenerated, Namespace, ContainerID, ServiceName, LogEntrySource, LogEntry, Name1
| sort by TimeGenerated asc