某喵的鱼塘 某喵的鱼塘

Action disabled: source
  • 显示源文件
  • 修订记录
  • 反向链接
  • 页面重命名

logstash -> elasticsearch 处理 bunyan(json format) log

filter {
    json {
        source => "message"
    }
    
    date {
        match => ["time", "ISO8601"]
        target => "@timestamp"
    }
}

output {
    elasticsearch {
        hosts => ["localhost"]
        index => "%{type}-%{dateStr}"
        codec => json
    }
}

Ref

  • https://www.elastic.co/guide/en/logstash/current/plugins-filters-json.html
  • https://www.elastic.co/guide/en/logstash/current/plugins-filters-date.html
  • 最后更改: 2018/05/10 16:04:54
  • (外部编辑)