我已经安装了sematext logagent https://sematext.github.io/logagent-js/installation/ 配置它输出到elasticsearch和一切都很好,但有一件事我花了整整一天的努力。 0,null,没有关于如何调试解析器的信息。我开始与“logagent --config logagent.yml -v -j”,阳明海运文件logagent娄sematext logagent调试模式
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)
我预计(基于恐慌文档),这将测试文件中的每一行分成2,例如'ggff','gg'会是消息,'ff'会是严重性,但是我可以在我的kibana中看到的是'ggff'是一条消息,严重性默认为(?)信息。问题是,我不知道问题在哪里。它是否会跳过我的模式,在我的模式中匹配失败?任何帮助将非常感激。