当前位置:网站首页>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)

边栏推荐
- Clion breakpoint single step debugging
- How about opening an account at Guojin securities? Is it safe to open an account?
- Preliminary analysis of serial port printing and stack for arm bare board debugging
- Several delete operations in SQL
- System table SQLite of SQLite database_ master
- 交叉编译环境出现.so链接文件找不到问题
- Handwritten numeral recognition based on tensorflow
- 商品秒杀系统
- 将字符串B插入字符串A,有多少种插入办法可以使新串是一个回文串
- To: seek truth from facts
猜你喜欢

When does the mobile phone video roll off?

博云,站在中国容器潮头

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

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

wm_ Concat() and group_ Concat() function

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

(几何) 凸包问题

DVD-数字通用光盘

品达通用权限系统(Day 3~Day 4)

Clion compiling catkin_ WS (short for ROS workspace package) loads cmakelists Txt problems
随机推荐
Micro service single sign on system (SSO)
LeetCode 128最长连续序列
Properties file garbled
DVD-数字通用光盘
Record of user behavior log in SSO microservice Engineering
Union, intersection and difference operations in SQL
JVM entry door (1)
Tree array
Get and set settings in 26class
知識點總結
成功解决之微服务@Value获取配置文件乱码问题
Development principle analysis and source code of dapp-lp single and dual currency liquidity pledge mining system
Crawl Douban to read top250 and import it into SqList database (or excel table)
(几何) 凸包问题
Insert string B into string A. how many insertion methods can make the new string a palindrome string
Leetcode interview question 29 clockwise print matrix
手机影像内卷几时休?
wm_ Concat() and group_ Concat() function
Conditional compilation in precompiling instructions
CD-CompactDisk