标签:pipeline lte 自我 span 场景 down cpu last www.
自我认为:logstash就是日志的采集收集,日志的搬运工,实时去采集日志。读取不同的数据源,并进行过滤,开发者自定义规范输出到目的地。日志的来源很多,如系统日志,应用日志等等(同类软件:filebeat)
官方文档:https://www.elastic.co/guide/en/logstash/current/index.htm
工作传输流程
下载 logstash-6.2.4.tar.gz wget https://artifacts.elastic.co/downloads/logstash/logstash-6.2.4.tar.gz tar -xvf logstash-6.2.4.tar.gz cd logstash-6.2.4/ 修改配置文件:(基本配置) logstash.yml 修改 pipeline.workers,根据CPU核数增加1到2即可 jvm.options 修改 xms和xmx为相同,一般是系统内存三份之二
logstash配置文件vim logstash.conf
input { file { # 从文件读取日志信息 path => "/var/log/messages" #文件所在的路径 type => "system" #类型是system类型
codec => "json" #日志格式时json格式时打开 start_position => "beginning" #从哪里开始读,beginning } } filter {
mutate{ #切割插件
split => ["message","|"] #通过|切割为message的数组
} } output { elasticsearch {
#stdout { codec => rubydebug } #格式化控制台输出 hosts => ["localhost:9200"] #输出到es中 index => "logstash-test-%{type}-%{host}" #输出到哪个索引中去 } }
input插件:https://www.elastic.co/guide/en/logstash/current/input-plugins.html
filter插件:https://www.elastic.co/guide/en/logstash/current/filter-plugins.html
output插件:https://www.elastic.co/guide/en/logstash/current/output-plugins.html
目录文件说明:https://www.elastic.co/guide/en/logstash/6.2/dir-layout.html
配置详解:https://www.elastic.co/guide/en/logstash/6.2/logstash-settings-file.html
elastic search&logstash&kibana 学习历程(三)Logstash使用场景和安装部署
标签:pipeline lte 自我 span 场景 down cpu last www.
原文地址:https://www.cnblogs.com/both/p/9072900.html