@timestamp format string error

my kafka config is

output.kafka:
# Boolean flag to enable or disable the output module.
  enabled: true
  codec.format: 
     string: ' %{[@timestamp]} ' 

When start reading the nginx log.
It will appear this error

2017/04/25 11:05:12.569834 formatevents.go:409: WARN Can not convert key '{63628715107 562862910 0xd425c0}' value to string
2017/04/25 11:05:12.569873 format.go:42: ERR Fail to format event (can not convert to string): common.MapStr{"input_type":"log", "message":"127.0.0.1 - - [25/Apr/2017:19:05:04 +0800] \"GET /update_ban_dict HTTP/1.1\" 200 5 \"-\" \"curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.19.1 Basic ECC zlib/1.2.8 libidn/1.18 libssh2/1.4.2\" \"-\" \"wangbin.test\" \"8360\" 0.000 \"-\"", "beat":common.MapStr{"name":"dev03.test.com", "hostname":"dev03.test.com", "version":"5.3.1"}, "@timestamp":common.Time{sec:63628715107, nsec:562862910, loc:(*time.Location)(0xd425c0)}, "source":"/data/logs/nginx/wangbin.test/201704/25/access_19.log", "offset":1428, "type":"nginx_log"}
2017/04/25 11:05:12.569883 client.go:123: ERR Dropping event: can not convert to string

This looks like a bug to me. I couldn't reproduce with the snapshot release from master so maybe it was fixed in master.

Let's see if @steffens is familiar with this issue.

Problem is, the @timestamp field is not readable from codec.format.string. It's currently fixed in master by this PR.

Yes, in the master version has been repaired this problem. I downloaded the source code compiled and found that there is no such problem

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.