如何从日志资源管理器中重新删除GCP日志?
我正在使用GCP日志资源管理器来存储管道中的记录消息。 我需要通过查看特定事件的日志来调试问题。此错误的消息是相同的,除了最后一个事件ID。
因此,例如,错误消息是
事件ID不存在:foo
我知道我可以使用以下语法来构造一个查询,该查询将使用此特定消息结构返回
resource.type="some_resource"
resource.labels.project_id="some_project"
resource.labels.job_id="some_id"
severity=WARNING
jsonPayload.message:"Event ID does not exist:"
日志然后,查询将返回消息具有该字符串的每个日志。
我最终得到了这样的结果
Event ID does not exist: 1A
Event ID does not exist: 2A
Event ID does not exist: 2A
Event ID does not exist: 3A
,所以我希望将其重复起来,以最终得到,
Event ID does not exist: 1A
Event ID does not exist: 2A
Event ID does not exist: 3A
但我在语言docs
由于行的数量,我也无法下载界定的日志文件。 是否可以重复排列行?
I am using GCP Logs explorer to store logging messages from my pipeline.
I need to debug an issue by looking at logs from a specific event. The message of this error is identical except for an event ID at the end.
So for example, the error message is
event ID does not exist: foo
I know that I can use the following syntax to construct a query that will return the logs with this particular message structure
resource.type="some_resource"
resource.labels.project_id="some_project"
resource.labels.job_id="some_id"
severity=WARNING
jsonPayload.message:"Event ID does not exist:"
The last line in that query will then return every log where the message has that string.
I end up with a result like this
Event ID does not exist: 1A
Event ID does not exist: 2A
Event ID does not exist: 2A
Event ID does not exist: 3A
so I wish to deduplicate that to end up with only
Event ID does not exist: 1A
Event ID does not exist: 2A
Event ID does not exist: 3A
But I don't see support for this type of deduplication in the language docs
Due to the amount of rows, I also cannot download a delimited log file.
Is it possible to deduplicate the amount of rows?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
要使用BigQuery重复编写记录,请按照以下步骤:
选择
查询,该查询使用一个子句组的组。
创建或替换表[TablEname]为[Select语句]
将结果实现为新表格。您可以在此链接中查看完整的教程。
要分析大量日志,您可以将它们路由到BigQuery并使用Fluentd分析日志。
Fluentd具有一个输出插件,可以将BigQuery用作存储收集的日志的目的地。使用该插件,您可以将日志直接直接从许多服务器实时加载到BigQuery中。
在此链接,您可以找到有关如何使用FluentD和fluentd and and and andd and and and andd and and and的完整教程Bigquery。
要将日志路由到BigQuery,首先是必须创建一个水槽并将其路由到BigQuery。
更多有关配置和管理接收器的信息 在这里。
要查看详细信息,格式和规则在将日志条目从云日志记录到BigQuery时适用的规则,请遵循此链接。
To deduplicate records with BigQuery, follow these steps:
SELECT
query that aggregates the desired column using aGROUP BY
clause.CREATE OR REPLACE TABLE [tablename] AS [SELECT STATEMENT]
.You can review the full tutorial in this link.
To analyze a big quantity of logs, you could route them to BigQuery and analyze the logs using Fluentd.
Fluentd has an output plugin that can use BigQuery as a destination for storing the collected logs. Using the plugin, you can directly load logs into BigQuery in near real time from many servers.
In this link, you can find a complete tutorial on how to Analyze logs using Fluentd and BigQuery.
To route your logs to BigQuery, first it is necessary to create a sink and route it to BigQuery.
More information about Configuring and managing sinks here.
To review details, the formatting, and rules that apply when routing log entries from Cloud Logging to BigQuery, please follow this link.