繁体   English   中英

Logstash Grok错误

[英]Logstash Grok error

My logstash configuration is giving me this error:

每当我运行以下命令时:/ opt / logstash / bin / logstash -f /etc/logstash/conf.d/logstash.conf --auto-reload --debug

reason=>"Expected one of #, {, ,, ] at line 27, column 95 (byte 677) after filter {\n\n\tif [type] == \"s3\" {\n\t\tgrok {\n\t\n  \t\t\tmatch => [\"message\", \"%{IP:client} %{USERNAME} %{USERNAME} \\[%{HTTPDATE:timestamp}\\] (?:\"", :level=>:error, :file=>"logstash/agent.rb", :line=>"430", :method=>"create_pipeline"}

这与我的模式有关。但是当我在Grok在线调试器中检查它时,它给了我所需的答案。请帮助。

Here is my logstash configuration: 

input {
    s3 {
      access_key_id => ""
      bucket => ""
      region => ""
      secret_access_key => ""
      prefix => "access"
      type => "s3"
      add_field => { source => gzfiles }
      sincedb_path => "/dev/null"
      #path => "/home/shubham/logstash.json"
      #temporary_directory => "/home/shubham/S3_temp/"

      backup_add_prefix => "logstash-backup"
      backup_to_bucket => "logstash-nginx-overcart"


}

}

 filter {

        if [type] == "s3" {
                grok {

                        match => ["message", "%{IP:client} %{USERNAME} %{USERNAME} \[%{HTTPDATE:timestamp}\] (?:"%{WORD:request} 
        %{URIPATHPARAM:path} HTTP/%{NUMBER:version}" %{NUMBER:reponse} %{NUMBER:bytes} "%{USERNAME}" %{GREEDYDATA:responseMessage})"]
        }
        }
        }

 output {
    elasticsearch {
    hosts => ''
    index => "accesslogs"
}
  }

在您的比赛分配中,您有几个未转义的“”字符(例如,用户名var左右),它们使解析器跳了起来。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM