Getting Started with Logstach 2

Parsing Logs with Logstash 之前,我们已经通过一个最基础的Logstash pipeline,验证了我们的Logstash环境已经准备就绪。在现实世界里,那样基础的pipeline没有什么存在的价值,我们需要更加复杂的pipeline:一般都会包含多个input、filter以及output插件。 在这个章节,我们会创建一个Logstash pipeline,使用Filebeat读取Apache的日志作为输入,并对日志进行解析、创建指定的命名字段信息,再将解析过的数据写入到Elasticsearch。这次不在命令行中配置pipeline,咱使用配置文件。 开始之前,下载sample数据,在接下来会用。 配置Filebeat,将日志信息发送给Logstash 开始创建Logstash pipeline前,得先配置Filebeat,负责将日志中的文本行发送给Logstash。Filebeat用来搜集服务器上的文件,并转发给Logstash示例进行处理。Filebeat具备可靠、低延迟的设计特性 默认的Logstash安装会包含Beats input插件。这个插件让Logstash具备接收Elastic Beats框架发来的 事件 ,诸如PacketBeat、MetricBeat都可以向Logstash发送 事件  本文略过Filebeat的安装过程。 安装好Filebeat后,需要为Filebeat提供配置文件。Filebeat配置文件使用YAML格式。创建filebeat.yml文件,内容如下: filebeat.prospectors: \- type: log paths: \- /path/to/file/logstash-tutorial.log output.logstash: hosts: \[“localhost:5043\] 为了简化配置,这里没有使用TLS/SSL设置——真实世界里,我们需要安全设置。 启动Filebeat: sudo ./filebeat -e -c filebeat.yml -d “publish” Filebeat会尝试连接5043端口,因为目前为止,Logstash以及Beats plugin还没有启动,所以不会从这个端口得到应答。 配置Logstash来接受Filebeat输入 下面是Logstash pipeline的配置文件主干: ``` The # character at the beginning of a line indicates a comment. Use

Getting Started with Logstash 1

Stashing your first event 让我们启动logstash的学习! 通过运行一个最最基础的Logstash pipeline来验证一下我们的Logstash安装。  pipeline: 管道, 这个就是Linux/Unix中管道的概念。此处不做解释 Logstash 管道需要两个元素: input、output,经常还会配置可选元素:filter。 输入、过滤、输出,这就是一个标准的信息处理组件、很多个这种组件chain起来,就可以完成复杂的功能需求。在Logstash中,input、output、filter分别有许多plugin(插件),通过输入插件,从数据源中读取数据,filter插件按照配置修改数据,输出插件将数据写入目标端…… 为了测试我们安装的Logstash,我们来运行一个最基础的Logstash管道: logstash -e 'input { stdin {} } output { stdout {} }' 上例中,-e 选项让我们直接从命令行中获取logstash配置(一般是用配置文件的),这个基础示例中,我们从标准输入(stdin)中获取输入数据,将数据输出到标准输出(stdout)—— 输出时会使用logstash结构化后的格式(最起码得添加个时间戳对、主机名吧?) Logstash启动并不迅捷,等到看到“Pipeline main stated”才表示启动完毕,我们输入 hello word [2017-11-19T22:32:20,445][INFO ][logstash.pipeline ] Pipeline started {"pipeline.id"=>"main"} The stdin plugin is now waiting for input: [2017-11-19T22:32:20,471][INFO ][logstash.agent ] Pipelines running {:count=>1,

使用curl操作ElasticSearch初步

1. 列明现有的所有index curl -XGET 'localhost:9200/_cat/indices?v’ health status index uuid pri rep docs.count docs.deleted store.size pri.store.size yellow open .kibana bndJD_c9RYGzu7XuWDyK9w 1 1 2 0 8.4kb 8.4kb 2. 创建新的index curl -XPUT 'localhost:9200/customer?pretty' { "acknowledged" : true, "shards_acknowledged" : true, "index" : "customer" } 3. 添加文档、查询文档 curl -XPUT 'localhost:9200/customer/doc/1?pretty&pretty' -H 'Content-Type: application/json' -d' > { > "name": "John

当下可用的SDS-软件定义存储

哪一个是和Excelero的解决方案类似的呢?以后是不是企业就可以自己攒数据库一体机了……目前信息全面、真正可用的可能还是EMC ScaleIO Software-Defined Storage Apache Cassandra Apache Cassandra is a scalable, high-availability database for mission-critical applications. It runs on commodity hardware or cloud infrastructure and replicates across multiple data centers for lower latency and fault tolerance. Cassandra on GitHub Ceph Ceph is Red Hat’s distributed, highly scalable block, object, and file storage platform for enterprises