使用 Filebeat 和 mssql 模块提取 SQL Server 错误日志

问题描述 投票:0回答:1

我正在使用带有 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
elasticsearch logstash filebeat
1个回答
0
投票

我认为这应该有效。

- 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

但是最好查看示例错误日志和您的弹性堆栈版本。

© www.soinside.com 2019 - 2024. All rights reserved.