首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >如何获取带有行中断的消息-,以便通过一条消息来识别它

如何获取带有行中断的消息-,以便通过一条消息来识别它
EN

Stack Overflow用户
提问于 2022-03-29 11:34:38
回答 1查看 277关注 0票数 0

我正在尝试配置google云操作系统代理,以便从应用程序中收集日志记录。

我的配置相当高级,但是当日志消息包含多行时会出现问题,例如:

代码语言:javascript
运行
复制
11:18:18,396 INFO  [org.jboss.as.ejb3.deployment.processors.EjbJndiBindingsDeploymentUnitProcessor] (MSC service thread 1-9) JNDI bindings for session bean named CommonJServiceBinder in deployment unit deployment "jboss-commonj-binder-1.2.jar" are as follows:
    java:global/jboss-commonj-binder-1.2/CommonJServiceBinder!com.manh.jboss.commonj.CommonJServiceBinder
    java:app/jboss-commonj-binder-1.2/CommonJServiceBinder!com.manh.jboss.commonj.CommonJServiceBinder
    java:module/CommonJServiceBinder!com.manh.jboss.commonj.CommonJServiceBinder
    java:global/jboss-commonj-binder-1.2/CommonJServiceBinder
    java:app/jboss-commonj-binder-1.2/CommonJServiceBinder
    java:module/CommonJServiceBinder

在这些情况下,日志浏览器将每一行显示为单独的消息。记录浏览器

我的配置如下:

代码语言:javascript
运行
复制
logging:
  receivers:
    AS_CA:
      type: files
      include_paths:
      - /home/log/server-startup.log
  service:
    pipelines:
      custom_pipeline_CA:
        receivers: [AS_CA]
        processors: [TYPE1]
  processors:
    TYPE1:
      type: parse_regex
      field: message
      regex: "^(?<time>^[0-9]{2}:[0-9]{2}:[0-9]{2}\,[0-9]{3})\s+(?<severity>DEFAULT|DEBUG|INFO|NOTICE|WARNING|WARN|ERROR|CRITICAL|ALERT|EMERGENCY)\s+(?<msg>.*\n)"
EN

回答 1

Stack Overflow用户

发布于 2022-05-25 16:59:29

在您的例子中,看起来parse_multiline处理器可能会工作。它支持默认的Java日志记录行。

https://cloud.google.com/stackdriver/docs/solutions/agents/ops-agent/configuration#logging-processor-parse-multiline

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/71661285

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档