In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-22 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly explains "how to configure Logstash file". Friends who are interested might as well take a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn how to configure Logstash files.
First, download
2. Install and start
[root@hftest0001 opt] # pwd/opt [root@hftest0001 opt] # ll...-rw- 1 root root 89916973 Jan 14 03:03 logstash-1.5.6.tar.gz... [root@hftest0001 opt] # tar-zxvf logstash-1.5.6.tar.gz [root@hftest0001 logstash-1.5.6] # pwd/opt/logstash-1.5.6 modify JAVA_ Home [root @ hftest0001 logstash-1.5.6] # vi bin/ Logstash...export JAVA_HOME=/usr/java/jdk1.7.0_67-cloudera... Add conf [root@hftest0001 logstash-1.5.6] # mkdir conf [root@hftest0001 logstash-1.5.6] # vi conf/input_file-output_file.confinput {file {path = > ["/ opt/logstash-data/input/1.log"]}} output {file {path = > ["/ opt/logstash-data/output/1.log"]}} [root@hftest0001 logstash-1.5.6] # mkdir-p / opt/logstash-data/ {input Output} [root@hftest0001 logstash-1.5.6] # touch / opt/logstash-data/input/1.log launch [root@hftest0001 logstash-1.5.6] #. / bin/logstash-f conf/ Test [root@hftest0001 logstash-1.5.6] # echo "1" > > / opt/logstash-data/input/1.log
III. Multiple configuration files
Profile segmentation. That is, divide the input,filter,output into different files.
a. One input, one output.
[root@hftest0001 logstash-1.5.6] # rm-rf. / conf/* [root@hftest0001 logstash-1.5.6] # vi conf/input_file.confinput {file {path = > ["/ opt/logstash-data/input/1.log"]}} [root@hftest0001 logstash-1.5.6] # vi conf/output_file.confoutput {file {path = > ["/ opt/logstash-data/output/1.log"] }} [root@hftest0001 logstash-1.5.6] #. / bin/logstash-f conf/ Test [root@hftest0001 logstash-1.5.6] # echo "1" > > / opt/logstash-data/input/1.log result [root@hftest0001 logstash-1.5.6] # cat / opt/logstash-data/output/1.log1
B two input (two input are exactly the same) one output
[root@hftest0001 logstash-1.5.6] # rm-rf. / conf/* [root@hftest0001 logstash-1.5.6] # vi conf/input_file.confinput {file {path = > ["/ opt/logstash-data/input/1.log"]}} [root@hftest0001 logstash-1.5.6] # vi conf/input_file2.confinput {file {path = > ["/ opt/logstash-data/input/1.log"] }} [root@hftest0001 logstash-1.5.6] # vi conf/output_file.confoutput {file {path = > ["/ opt/logstash-data/output/1.log"]}} [root@hftest0001 logstash-1.5.6] #. / bin/logstash-f conf/ Test [root@hftest0001 logstash-1.5.6] # echo "1" > > / opt/logstash-data/input/1.log Note! As a result, [root@hftest0001 logstash-1.5.6] # cat / opt/logstash-data/output/1.log1 continues to add data [root@hftest0001 logstash-1.5.6] # echo "2" > > / opt/logstash-data/input/1.log [root@hftest0001 logstash-1.5.6] # cat / opt/logstash-data/output/1.log112 = > into three pieces of data, that is, we can see that each of the two input produces a piece of data. Why aren't there two 2s? After kill logstash, [root@hftest0001 logstash-1.5.6] # cat / opt/logstash-data/output/1.log1122
C two input (two input are not the same) one output
[root@hftest0001 logstash-1.5.6] # rm-rf. / conf/* [root@hftest0001 logstash-1.5.6] # vi conf/input_file.confinput {file {path = > ["/ opt/logstash-data/input/1.log"]}} [root@hftest0001 logstash-1.5.6] # vi conf/input_file2.confinput {file {path = > ["/ opt/logstash-data/input/2.log"] }} [root@hftest0001 logstash-1.5.6] # vi conf/output_file.confoutput {file {path = > ["/ opt/logstash-data/output/1.log"]}} [root@hftest0001 logstash-1.5.6] #. / bin/logstash-f conf/ test [root@hftest0001 logstash-1.5.6] # echo "1" > > / opt/logstash-data/input/1.log result [root@hftest0001 logstash-1.5. 6] # cat / opt/logstash-data/output/1.log1 continue to add data [root@hftest0001 logstash-1.5.6] # echo "2" > > / opt/logstash-data/input/2.log [root@hftest0001 logstash-1.5.6] # cat / opt/logstash-data/output/1.log12
D one input, two output (two output are exactly the same)
[root@hftest0001 logstash-1.5.6] # rm-rf. / conf/* [root@hftest0001 logstash-1.5.6] # vi conf/input_file.confinput {file {path = > ["/ opt/logstash-data/input/1.log"]}} [root@hftest0001 logstash-1.5.6] # vi conf/output_file.confoutput {file {path = > ["/ opt/logstash-data/output/1.log"] }} [root@hftest0001 logstash-1.5.6] # vi conf/output_file2.confoutput {file {path = > ["/ opt/logstash-data/output/1.log"]}} [root@hftest0001 logstash-1.5.6] #. / bin/logstash-f conf/ Test [root@hftest0001 logstash-1.5.6] # echo "1" > > / opt/logstash-data/input/1.log Note! The result is that the same message is written to the same file by both output [root@hftest0001 logstash-1.5.6] # cat / opt/logstash-data/output/1.log11 to continue to add data [root@hftest0001 logstash-1.5.6] # echo "2" > > / opt/logstash-data/input/2.log [root@hftest0001 logstash-1.5.6] # cat / opt/logstash-data/output/1.log1122
E one input and two output (two output are different)
[root@hftest0001 logstash-1.5.6] # rm-rf. / conf/* [root@hftest0001 logstash-1.5.6] # vi conf/input_file.confinput {file {path = > ["/ opt/logstash-data/input/1.log"]}} [root@hftest0001 logstash-1.5.6] # vi conf/output_file.confoutput {file {path = > ["/ opt/logstash-data/output/1.log"] }} [root@hftest0001 logstash-1.5.6] # vi conf/output_file2.confoutput {file {path = > ["/ opt/logstash-data/output/2.log"]}} [root@hftest0001 logstash-1.5.6] #. / bin/logstash-f conf/ Test [root@hftest0001 logstash-1.5.6] # echo "1" > > / opt/logstash-data/input/1.log Note! The result is that the same message is written to different files by two output respectively [root@hftest0001 logstash-1.5.6] # cat / opt/logstash-data/output/1.log1 [root@hftest0001 logstash-1.5.6] # cat / opt/logstash-data/output/2.log1 to continue to add data [root@hftest0001 logstash-1.5.6] # echo "2" > > / opt/logstash-data/input/2.log [root@hftest0001 logstash-1.5.6 ] # cat / opt/logstash-data/output/1.log12 [root@hftest0001 logstash-1.5.6] # cat / opt/logstash-data/output/2.log12
F An Input, to be written to a different
At this point, I believe you have a deeper understanding of "how to configure Logstash file", might as well come to the actual operation of it! Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
Tgt_type-- The type of tgt. Allowed values: glob-Bash glob completion-Default pcre-P
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.