Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/logging/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Debugging sematext logagent调试模式_Debugging_Logging - Fatal编程技术网

Debugging sematext logagent调试模式

Debugging sematext logagent调试模式,debugging,logging,Debugging,Logging,我已经安装了SematextLogAgent 将其配置为输出到elasticsearch,这一切都很好,但有一件事我花了一整天的时间试图去做。 关于如何调试解析器的信息为0,null,无。我用“logagent--config logagent.yml-v-j”启动logagent,yml文件如下 options: printStats: 30 # don't write parsed logs to stdout suppress: false # Enable/disable

我已经安装了SematextLogAgent 将其配置为输出到elasticsearch,这一切都很好,但有一件事我花了一整天的时间试图去做。 关于如何调试解析器的信息为0,null,无。我用“logagent--config logagent.yml-v-j”启动logagent,yml文件如下

options:
  printStats: 30
  # don't write parsed logs to stdout
  suppress: false
  # Enable/disable GeoIP lookups
  # Startup of logagent might be slower, when downloading the GeoIP database
  geoipEnabled: false
  # Directory to store Logagent status nad temporary files
  diskBufferDir: ./tmp

input:
  files:
      - '/var/log/messages'
      - '/var/log/test'

patterns:
  sourceName: !!js/regexp /test/
  match:
    - type: mysyslog
      regex: !!js/regexp /([a-z]){2}(.*)/
      fields: [message,severity]
      dateFormat: MMM DD HH:mm:ss

output:
  elasticsearch:.
    module: elasticsearch
    url: http://host:9200
    index: mysyslog
  stdout: yaml # use 'pretty' for pretty json and 'ldjson' for line delimited json (default)

我希望(根据scares文档)这会将测试文件的每一行分成2行,例如“ggff”,“gg”将是消息,“ff”将是严重性,但我在kibana中看到的只是“ggff”是消息,严重性默认(?)为信息。问题是,我不知道问题在哪里。它是否跳过我的模式,模式中的匹配是否失败?非常感谢您的帮助。

在模式中设置“debug:true”。yml打印有关匹配模式的详细信息。 关注Logagent问题#69(),了解更多改进

文档移到了。我建议www.regex101.com测试正则表达式(请使用JavaScript正则表达式语法)

/var/log中的Syslog消息示例位于默认模式库中:

在patterns.yml中设置“debug:true”将打印有关匹配模式的详细信息。 关注Logagent问题#69(),了解更多改进

文档移到了。我建议www.regex101.com测试正则表达式(请使用JavaScript正则表达式语法)

/var/log中的Syslog消息示例位于默认模式库中: