随笔分类 -  Logstash

摘要:MySQL数据库 Driver ="path/to/jdbc-drivers/mysql-connector-java-5.1.35-bin.jar" //驱动程序Class ="com.mysql.jdbc.Driver"; URL ="jdbc:mysql://localhost:3306/db 阅读全文
posted @ 2016-05-27 19:46 弋痕夕的残影 阅读(5195) 评论(0) 推荐(1)
摘要:需求 多个文本文件需要存到 ES 中去。 每一个文件存放为一个 doc。 每一个文件都是多行的,行数不定,且没有固定的内容格式。 实现 可以通过 logstash-filter-multiline 插件,配置 pattern 为 "EOF",可以实现把每一个文档当作一个 Event 处理。 阅读全文
posted @ 2016-05-20 10:56 弋痕夕的残影 阅读(960) 评论(1) 推荐(0)
摘要:配置文件结构说明 https://www.elastic.co/guide/en/logstash/current/configuration-file-structure.html Event相关配置 https://www.elastic.co/guide/en/logstash/current 阅读全文
posted @ 2016-04-28 19:43 弋痕夕的残影 阅读(237) 评论(0) 推荐(0)
摘要:概要 今天在群里一个关于在 logstash 的配置目录存在多个配置文件时候如何处理的问题? 我说是加载所有配置文件并合并为一个。 下面,做个小实验用以说明。 文件说明 1. conf.d 目录说明 存在2个配置文件 1.conf 和 2.conf 其中 1.conf 配置了 input ,使用 f 阅读全文
posted @ 2016-04-28 14:49 弋痕夕的残影 阅读(16278) 评论(0) 推荐(0)
摘要:示例 以下配置能够实现从 SQL Server 数据库中查询数据,并增量式的把数据库记录导入到 ES 中。 1. 查询的 SQL 语句在 statement_filepath => "/etc/logstash/statement_file.d/my_info.sql" 参数指定的文件中给出。 2. 阅读全文
posted @ 2016-04-12 16:55 弋痕夕的残影 阅读(11247) 评论(1) 推荐(5)
摘要:使用 add_field 参数有两种需求: 1. 直接加入到 event 的 hash 顶级对象中 那么,结果会类似: 2. 加入到 event 的某个 tag 中 那么,结果会类似: 3. 由于 add_field 参数要求格式为 hash,我尝试如下用法结果发现满足不了需求。( ╯□╰ )为嘛? 阅读全文
posted @ 2016-04-11 17:34 弋痕夕的残影 阅读(10222) 评论(0) 推荐(0)
摘要:需求 为了开发新的 logstash 插件 问题 原以为只是很简单的 bundle install 就能搞定的事情,实际却遇到了一堆问题。 1. clone git git@github.com:logstash-plugins/logstash-filter-example.git 2. cd l 阅读全文
posted @ 2016-03-28 10:46 弋痕夕的残影 阅读(673) 评论(0) 推荐(0)
摘要:参数 close_older 参数 ignore_older 参数 start_position 阅读全文
posted @ 2016-03-08 00:00 弋痕夕的残影 阅读(2248) 评论(0) 推荐(0)