简体   繁体   English

如何使用 kql 查询查找哪个 pod 在 AKS 集群中摄取更多数据?

[英]How to find which pod is taking more data ingestion in AKS cluster using kql query?

I am trying to figure out which pod is producing more billable data ingestion in AKS for log analytics.我试图找出哪个 pod 在 AKS 中产生更多的计费数据摄取以进行日志分析。

I tried several queries and I found only a query that checks the particular node我尝试了几个查询,但只发现一个检查特定节点的查询

Is there any query to check the whole pod data ingestion per namespace to find out billable data ingestion?是否有任何查询来检查每个命名空间的整个 pod 数据摄取以找出计费数据摄取?

Thank you?谢谢?

The default query shows logs per container, and not per pod as you would expected from a Kube.netes-specific logging system.默认查询显示每个容器的日志,而不是像您期望的 Kube.netes 特定日志系统那样显示每个 pod。

You can use below KQL query in Log Analytics Workspace -> View Designer -> click on logs button in the header->Logging AKS Test->Container Log.您可以在 Log Analytics 工作区 -> 视图设计器 -> 单击标题中的日志按钮 -> 记录 AKS 测试 -> 容器日志中使用以下 KQL 查询。

let startTimestamp = ago(1h);
KubePodInventory
| where TimeGenerated > startTimestamp
| project ContainerID, PodName=Name
| distinct ContainerID, PodName
| join
(
    ContainerLog
    | where TimeGenerated > startTimestamp
)
on ContainerID
// at this point before the next pipe, columns from both tables are available to be "projected". Due to both 
// tables having a "Name" column, we assign an alias as PodName to one column which we actually want
| project TimeGenerated, PodName, LogEntry, LogEntrySource
| order by TimeGenerated desc

For more information please refer this Document有关更多信息,请参阅此文档

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何将 AKS 应用程序集群、节点、Pod、容器指标发送到 Log Analytics 工作区,以便在 Azure 监控中可用? - How to send the AKS application Cluster, Node, Pod, Container metrics to Log Analytics workspace so that it will be available in Azure Monitoring? 如何在 GKE 中查找哪个 pod 正在使用 Persistent Volume Claim - How to find which pod is using a Persistent Volume Claim in GKE 在多命名空间集群 AKS 中使用入口 - Using ingress in multi namespace cluster AKS 使用数据融合将 pubsub 消息摄取到 Bigquery - pubsub message ingestion into Bigquery using data fusion 如何在 aks 集群节点中设置 efk 日志记录? - how to setup efk logging in aks cluster nodes? 如何将KQL查询的output存储在一个变量中 - How to store output of KQL query in a variable 如何在 azure (AKS) 中的 Kube.netes 集群中附加磁盘 - How to attach a disk in Kubernetes cluster in azure (AKS) KQL查询,如何从rendereddescription中扩展信息 - KQL query, how to extend information from rendereddescription 使用 Cloud Code 和 GoLand 在 aks 集群中远程调试 golang 应用程序 - Remote debugging golang application in aks cluster using Cloud Code and GoLand 使用 terraform 创建 aks 集群时出现 Hashicorp 提供程序错误 - Getting Hashicorp Provider Error while creating aks cluster using terraform
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM