【问题标题】:Logstash _grokparsefailure error windowsLogstash _grokparsefailure 错误窗口
【发布时间】:2017-06-20 18:11:59
【问题描述】:

新手警报!

我正在学习在 Windows 上使用 logstash 来向团队演示。 请看以下配置和结果:

1)

 file content : 123

配置文件:

input {
file {
    path => "C:\Users\xyz\Desktop\Demo\WriteText.txt"
    start_position => "beginning"
    }
    }

filter {
grok {
match => { "@message" => "%{GREEDYDATA:data}"}
}
}
output {
stdout { codec => rubydebug }
}

我的命令行显示以下输出:

{
"path" => "C:\Users\xyz\Desktop\Demo\WriteText.txt",
"@timestamp" => 2017-06-20T16:18:33.956Z,
"@version" => "1",
"host" => "ABC",
"message" => "123"
}

//上述输出中没有显示数据字段

2) 输入文本的内容: 789

配置2:

grok {
 match => { "@message" => "%{NUMBER:data}"}
 }

命令行输出:

output
{
"path" => "C:\Users\xyz\Desktop\Demo\WriteText.txt",
"@timestamp" => 2017-06-20T16:22:56.167Z,
"@version" => "1",
"host" => "ABC",
"message" => "789",
"tags" => [
[0] "_grokparsefailure"
]
}

我收到简单数字输入的解析错误。所以我想知道问题是否出在 Windows .txt 文件和编码或其他方面,因为 grok 能够将其解析为 GREEDYDATA 但不能解析为 NUMBER。并且两个输出中都没有字段标签。 请帮助我确定问题。

【问题讨论】:

    标签: windows logstash-grok logstash-configuration logstash-file


    【解决方案1】:

    我的 grok 过滤器正在尝试解析 @message 字段。但是没有这样的字段。

    匹配 => [ "消息","%{GREEDYDATA:data}"] 成功了。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2016-07-29
      • 1970-01-01
      • 2023-03-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-07-07
      相关资源
      最近更新 更多