文章目录
- 如果出现国内某些原因无法安装homebrew的情况,推荐使用https://gitee.com/cunkai/HomebrewCN?_from=gitee_search 根据脚本提示进行安装并设置国内镜像加速
- brew install elasticsearch // 安装 brew info elasticsearch // 查看信息 brew services start elasticsearch // 启动访问9200端口
- brew install kibana brew info kibana brew services start kibana
- brew install logstash brew info logstash brew services start logstash接下来创建一个文本文件作为内容源数据例如本文的laravel框架日志 在任何文件夹中创建.conf文件作为配置文件vim log.conf填写内容:input { file { path => ["/Users/zhaohao/code/code/espier-bloated/storage/logs/lumen-2021-03-21.log"] } } output { elasticsearch{ hosts => ["http://localhost:9200"] index => "lumen-log" } }执行命令logstash -f log.conf访问localhost:9600之后需要在Kibana菜单Stack Management中创建索引之后就可以在Discover菜单中进行查找你要的内容啦
- 如果出现国内某些原因无法安装homebrew的情况,推荐使用https://gitee.com/cunkai/HomebrewCN?_from=gitee_search 根据脚本提示进行安装并设置国内镜像加速
brew install elasticsearch // 安装
brew info elasticsearch // 查看信息
brew services start elasticsearch // 启动
- 访问9200端口

brew install elasticsearch // 安装
brew info elasticsearch // 查看信息
brew services start elasticsearch // 启动

brew install kibana
brew info kibana
brew services start kibana

brew install kibana
brew info kibana
brew services start kibana
brew install logstash
brew info logstash
brew services start logstash
- 接下来创建一个文本文件作为内容源数据例如本文的laravel框架日志
- 在任何文件夹中创建.conf文件作为配置文件
vim log.conf
- 填写内容:
input {
file {
path => ["/Users/zhaohao/code/code/espier-bloated/storage/logs/lumen-2021-03-21.log"]
}
}
output {
elasticsearch{
hosts => ["http://localhost:9200"]
index => "lumen-log"
}
}
- 执行命令
logstash -f log.conf
- 访问localhost:9600

- 之后需要在Kibana菜单Stack Management中创建索引

- 之后就可以在Discover菜单中进行查找你要的内容啦

brew install logstash
brew info logstash
brew services start logstash
vim log.conf
input {
file {
path => ["/Users/zhaohao/code/code/espier-bloated/storage/logs/lumen-2021-03-21.log"]
}
}
output {
elasticsearch{
hosts => ["http://localhost:9200"]
index => "lumen-log"
}
}
logstash -f log.conf











