logstash字符转换
项目需求
request_time, upstream_response_time 等的数据类型需要改为float
1、nginx配置json格式日志
1 | http { |
2、filebeat收集日志
1 | filebeat.inputs: |
3、logstash配置
需java环境
配置startup.options文件
1 | LS_HOME=/opt/logstash-6.5.3 |
配置template_nginxlog.json模板
1 | { |
编写conf配置文件
1 | input { |
es报错信息,文件格式不匹配
1 | failed to put mappings on indices [[[nginx-2020-11-18/ueZB7rY1QPilUWjk3S9ykg]]], type [doc]java.lang.IllegalArgumentException: Rejecting mapping update to [nginx-2020-11-18] as the final mapping would have more than 1 type: [_doc, doc] |