logstash安装
来源:互联网 发布:沥青抽提试验数据 编辑:程序博客网 时间:2024/05/16 01:46
https://www.elastic.co/guide/en/logstash/current/index.html
首先现在logstash,上传到服务器
logstash是用JRuby语言开发的,所以要安装JDK
tar -zxvf logstash-2.3.1.tar.gz -C /bigdata/
bin/logstash -e 'input { stdin {} } output { stdout{} }'
bin/logstash -e 'input { stdin {} } output { stdout{codec => rubydebug} }'
bin/logstash -e 'input { stdin {} } output { elasticsearch {hosts => ["172.16.0.14:9200"]} stdout{} }'
bin/logstash -e 'input { stdin {} } output { elasticsearch {hosts => ["172.16.0.15:9200", "172.16.0.16:9200"]} stdout{} }'
bin/logstash -e 'input { stdin {} } output { kafka { topic_id => "itcast" bootstrap_servers => "172.16.0.11:9092,172.16.0.12:9092,172.16.0.13:9092"} stdout{codec => rubydebug} }'
--------------------------------------------------------------------
以配置的形式
vi logstash.conf
input {
file {
type => "gamelog"
path => "/log/*/*.log"
discover_interval => 10
start_position => "beginning"
}
}
output {
elasticsearch {
index => "gamelog-%{+YYYY.MM.dd}"
hosts => ["172.16.0.14:9200", "172.16.0.15:9200", "172.16.0.16:9200"]
}
}
#启动logstack
bin/logstash -f logstash.conf
bin/logstash -e '
input { stdin {} }
filter {
grok {
match => { "message" => "%{IP:client} %{WORD:method} %{URIPATHPARAM:request} %{NUMBER:bytes} %{NUMBER:duration}" }
}
}
output { stdout{codec => rubydebug}
}'
首先现在logstash,上传到服务器
logstash是用JRuby语言开发的,所以要安装JDK
tar -zxvf logstash-2.3.1.tar.gz -C /bigdata/
bin/logstash -e 'input { stdin {} } output { stdout{} }'
bin/logstash -e 'input { stdin {} } output { stdout{codec => rubydebug} }'
bin/logstash -e 'input { stdin {} } output { elasticsearch {hosts => ["172.16.0.14:9200"]} stdout{} }'
bin/logstash -e 'input { stdin {} } output { elasticsearch {hosts => ["172.16.0.15:9200", "172.16.0.16:9200"]} stdout{} }'
bin/logstash -e 'input { stdin {} } output { kafka { topic_id => "itcast" bootstrap_servers => "172.16.0.11:9092,172.16.0.12:9092,172.16.0.13:9092"} stdout{codec => rubydebug} }'
--------------------------------------------------------------------
以配置的形式
vi logstash.conf
input {
file {
type => "gamelog"
path => "/log/*/*.log"
discover_interval => 10
start_position => "beginning"
}
}
output {
elasticsearch {
index => "gamelog-%{+YYYY.MM.dd}"
hosts => ["172.16.0.14:9200", "172.16.0.15:9200", "172.16.0.16:9200"]
}
}
#启动logstack
bin/logstash -f logstash.conf
bin/logstash -e '
input { stdin {} }
filter {
grok {
match => { "message" => "%{IP:client} %{WORD:method} %{URIPATHPARAM:request} %{NUMBER:bytes} %{NUMBER:duration}" }
}
}
output { stdout{codec => rubydebug}
}'
阅读全文
0 0
- logstash安装
- 安装logstash
- 安装logstash
- logstash安装
- 安装Logstash
- logstash安装
- 安装Logstash
- logstash安装
- Logstash官方文档中文版-安装Logstash
- logstash安装和logstash-input-jdbc插件
- logstash安装和使用
- ELK(二)安装logstash
- logstash 安装zabbix插件
- windows下安装logstash
- logstash安装文档
- elasticsearch, logstash 安装
- logstash安装与使用
- Logstash安装使用
- Linux服务管理
- 绘图控制
- Linux下(以RedHat为范本)添加开机自启动脚本有两种方法
- CSS从基础到高级
- IO
- logstash安装
- 状态栏编程
- 湖南长沙房卡麻将学习 二,场景初始化流程
- unity脚本因为系统原因报错问题
- javaScript系列之自定义对象(七)
- HRBUST 1186 青蛙过河(dp)
- 红米Note增强版出现”无法安装xxx ,请释放一些存储空间并重试“解决
- redis详解——redis集群搭建和使用(二)
- 工具栏编程