Logstash s3输入插件未处理gz文件,给出“非GZIP格式”错误

时间:2019-04-19 15:26:38

标签: logstash

使用logstash从s3中提取gz日志文件时出现以下错误。

{
  "Serilog": {
    "Enrich": [ "FromLogContext" ],
    "MinimumLevel": "Debug",
    "WriteTo": [
      {
        "Name": "Console"        
      }
    ]
  }
}

我的配置文件如下:

[2019-04-19T20:40:31,267][ERROR][logstash.inputs.s3       ] Failed to read the file. Skip processing. 
{:filename=>"C:/Users/mgurupr1/home/logstash/testdata.gz", :exception=>"Not in GZIP format"}

1 个答案:

答案 0 :(得分:0)

您可以尝试使用gzip编解码器吗?

        s3 {
      access_key_id => "access key"
      bucket => "bucketname"
      secret_access_key => "secret"
      endpoint => "endpoint"
     prefix => "prefix"
      add_field => { source => gzfiles }
additional_settings => {
      "force_path_style" => true
    }
      codec => gzip_lines
    }
}