在网上找到资料是基于6.2.4的版本,所以我也就用6.2.4的版本试一试,反正我的目的只是做一个了解,然后会用就可以了
官网链接 : https://www.elastic.co/cn/downloads/ 以elasticsearch为例找到历史版本: 下载完下图中的几个文件并解压就可以了:
1.配置 filebeat.yml 设置为true ,默认是false 配置日志文件位置,支持通配符
配置输入对象为logstash,默认是es 2. 启动logstash 进入到 filebeat的解压目录,执行一下命令
# -e: error 把错误日志 输出到控制台 # -c filebeat.yml: 指定配置文件 filebeat.yml 的路径 # -d "publish": debug模式启动,把publish相关的日志都在控制台输出, filebeat.exe -e -c filebeat.yml -d "publish"hello.conf 文件
# 通过beat 输入 input{ beats { port => 5044 } } # 配置日志文件解析规则 filter{ #83.149.9.216 - - [04/Jan/2015:05:13:46 +0000] "GET /presentations/logstash-monitorama-2013/images/redis.png HTTP/1.1" 200 25230 "http://semicomplete.com/presentations/logstash-monitorama-2013/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1700.77 Safari/537.36" grok { match => { "message" => "%{IP:client} .* \[%{DATA:timestamp}\] \"%{WORD: verb} %{URIPATHPARAM:request} .*\/%{GREEDYDATA:httpversion}\" %{NUMBER: response} %{NUMBER:duration:int} \"%{DATA:referrer}\" \"%{DATA:agent}\"" } } #04/Jan/2015:05:13:45 +0000 date{ match=> [ "timestamp", "dd/MMM/yyyy:HH:mm:ss Z" ] remove_field => [stimestamp] } } # 输出到 elasticsearch output{ elasticsearch { hosts => "http://localhost:9200" index => "logstash-hello2" } stdout{} }访问 kibana http://localhost:5601 配置一下 index ok 完工