我正在使用带有 mssql 模块的 Filebeat 将 SQL Server ErrorLog 文件直接提取到 Elastic 搜索输出,但我收到这样的字符 \u00000\u00002\u00004\u0000-\u00000\u00004\u0000-\u00002\u00005\u0000 \u00002 \u00002\u0000:\u00001\u00000\u0000:\u00000\u00003\u0000。\u00002\u00005\u0000' 无法在消息字段中的索引 0 处解析。
我可以做些什么来解决这个问题,可以将这些日志逐行放入弹性搜索中。
我目前正在考虑将这些日志提取到 Logstash 中,然后将其发送到我的弹性搜索索引。
我的模块配置(mssql.yml)目前是这样的:
- module: mssql
# Fileset for native deployment
log:
enabled: true
# Set custom paths for the log files. If left empty,
# Filebeat will choose the paths depending on your OS.
var.paths: ['D:\path_to_log\Log\ERRORLOG*']
encoding: utf-16
我认为这应该有效。
- module: mssql
log:
enabled: true
var.paths: ['D:\path_to_log\Log\ERRORLOG*']
input:
encoding: utf-16le
exclude_files: [".gz$"]
multiline.pattern: '^\d\d'
multiline.negate: true
multiline.match: after
但是最好查看示例错误日志和您的弹性堆栈版本。