英文:
How do I build a query using MQL to fetch data from Log based metric?
问题
我有一个基于日志的指标,其中未定义资源类型。如何为以下日志基准指标构建 MQL 查询:
logging.googleapis.com/user/MY_METRIC
如果我在 Metric Explorer 中使用“配置视图”,数据会显示。然而,当我切换到 MQL 时,似乎无法创建正确的过滤器。
fetch logging.googleapis.com/user/MY_METRIC
给出了资源类型未定义的语法错误。
英文:
I have a log based metric where the resource type is not defined. How do I build a MQL query for a log based metric for the following:
logging.googleapis.com/user/MY_METRIC
If I use the "configuration view" in Metric Explorer the data shows. However when I switch to MQL I can't seem to create the correct filter.
fetch logging.googleapis.com/user/MY_METRIC
gives me syntax errors for resource type not defined.
答案1
得分: 0
如果日志来自虚拟机,则必须选择资源类型为计算。
资源类型必须声明。
英文:
If the logs come from a VM then the resource type must be selected as compute.
Resource type must be declared.
答案2
得分: 0
我在我的环境中进行了测试并检查,在MQL中必须提供资源类型。这将起作用。
英文:
I have tested in my environment and checked it is mandatory to give the resource type in MQL. This will work.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论