Logstash cheat sheet: Difference between revisions

python beaver も 6.0 には対応できてない。
とりあえず type を送らないようにした。
 
<syntaxhighlight lang="diff" enclose="div">
--- ./beaver/transports/base_transport.py.orig 2017-11-30 10:57:01.546311555 +0900
+++ ./beaver/transports/base_transport.py 2017-11-24 11:40:34.962587490 +0900
@@ -36,21 +36,19 @@
self._logstash_version = beaver_config.get('logstash_version')
if self._logstash_version == 0:
self._fields = {
- 'type': '@type',
'tags': '@tags',
'message': '@message',
'file': '@source_path',
'host': '@source_host',
- 'raw_json_fields': ['@message', '@source', '@source_host', '@source_path', '@tags', '@timestamp', '@type'],
+ 'raw_json_fields': ['@message', '@source', '@source_host', '@source_path', '@tags', '@timestamp'],
}
elif self._logstash_version == 1:
self._fields = {
- 'type': 'type',
'tags': 'tags',
'message': 'message',
'file': 'file',
'host': 'host',
- 'raw_json_fields': ['message', 'host', 'file', 'tags', '@timestamp', 'type'],
+ 'raw_json_fields': ['message', 'host', 'file', 'tags', '@timestamp'],
}
def raw_formatter(data):
@@ -122,7 +120,6 @@
formatter = self._default_formatter
data = {
- self._fields.get('type'): kwargs.get('type'),
self._fields.get('tags'): kwargs.get('tags'),
'@timestamp': timestamp,
self._fields.get('host'): self._current_host,
</syntaxhighlight>
 
== Elastic Stack 5.0.0 upgrade memo ==