当前位置:网站首页>Installation and use of logstash
Installation and use of logstash
2022-06-26 18:34:00 【cc_ nanke dream】
Logstash It is a powerful data processing tool , It can realize data transmission , Format processing , Format output , There are also powerful plug-in functions , Commonly used for log processing
explain :logstash Collect diary for comparison Filebeat Very slowly , So collect diaries and use Filebeat, Don't have to logstash
One 、 download
Address :https://www.elastic.co/cn/downloads/logstash
Two 、 install
Depend on the environment :jdk1.8+
Upload and unzip the installation package
tar -xvf logstash-7.13.3-linux-x86_64.tar.gz


3、 ... and 、 verification
Get into bin perform logstash Start command , Let's go to the first logstash Example
# bin/logstash -e 'input { stdin { } } output { stdout { } }'

explain : This example is to do any processing . Output what you input .
After starting , Input hello And output

Four 、 To configure
The configuration has three parts as follows

1、input File read and filter Handle
【1】 create profile
vim itcast-log.conf
Content

input{
file{
path => "/opt/cc.log"
start_position => "beginning"
}
}
filter{
mutate {
split => {"message"=>"|"}
}
}
output{
stdout { codec => rubydebug }
}
【2】: establish cc.log, Prepare for the presentation

【3】 start-up
command :./bin/logstash -f itcast-log.conf

【4】 After startup, you will see that the log contents have been obtained , And has been processed
2、 Output to Elasticsearch
Modify profile output modular ,hosts Is an array , Cluster configuration is separated by commas , Just add .
output{
elasticsearch{
hosts => ["192.168.231.146:9200"]
}
}

stay cc.log Add a new record to

see ( View using kibana)

边栏推荐
猜你喜欢

Numpy's Matplotlib

项目实战五:搭建ELk日志收集系统

Get and set settings in 26class

(multi threading knowledge points that must be mastered) understand threads, create threads, common methods and properties of using threads, and the meaning of thread state and state transition

项目实战六:分布式事务-Seata

Boyun, standing at the forefront of China's container industry

Convex hull problem

爬取豆瓣读书Top250,导入sqlist数据库(或excel表格)中

Paging query and join Association query optimization

LeetCode 238 除自身以外数组的乘积
随机推荐
ROS的发布消息Publishers和订阅消息Subscribers
博云,站在中国容器潮头
Introduction to Ethereum Technology Architecture
tag动态规划-刷题预备知识-2. 0-1背包理论基础和二维数组解法模板
Do you know how to compare two objects
手机影像内卷几时休?
Get and set settings in 26class
CD-CompactDisk
Request method 'POST' not supported
Which securities company is better for a novice to open a stock trading account? How is it safer to speculate in stocks??
Chinese (Simplified) language pack
Commodity seckill system
JSONUtils工具类(基于alibaba fastjson)
判断某个序列是否为栈的弹出序列
Detailed explanation of MySQL mvcc mechanism
VCD-影音光碟
Yujun product methodology
Eigen库计算两个向量夹角
链游开发成品源码 链游系统开发详情说明
深度学习之Numpy篇