Grok通过输入{stdin成功地进行了调试但是无法输出到elasticsearch

问题描述

input {
     file  {
    path => "C:/ELK/LocalLogs/*"
    start_position => beginning
       }
     }
    filter {
      grok{
       match => { "message" => ["%{GREEDYDATA:first}%{DATE_US:date_}-%{TIME:time_}%{GREEDYDATA:last}"]}
       }

      date {
       match => [ "timestamp","dd/MMM/yyyy:HH:mm:ss Z" ]
            }
     }

    output{
      elasticsearch {
        index => "tst-%{+YYYY.MM.dd}"
        hosts => ["localhost:9200"]
      }
      stdout { codec => rubydebug }
    }

这是输入示例:

library!WindowsService_3!2ec0!10/25/2020-00:00:26:: i INFO: Schedule ace8b126-f566-4324-aa48-a6123f81f28f executed at 10/21/2020 00:00:02.

在使用输入{stdin和任何grok调试器时,它无法输出到elasticsearch。 请帮忙。我在做什么错了?

解决方法

希望这会帮助某人... 所以我用notepad ++打开了日志文件,并在右下角显示了编码类型(附加)

然后我输入了此链接:https://www.elastic.co/guide/en/logstash/current/plugins-codecs-plain.html

,并在列表中找到最接近的名称-“ UCS-2BE” 然后,我将此行添加到输入{文件{ 编解码器=>普通{字符集=>“ UCS-2BE”} 现在可以了。

enter image description here