Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to install logstash on Docker

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

This article mainly explains "how to install logstash on Docker". The content in the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "how to install logstash on Docker".

Edit the docker-compose.yml as follows:

Version: '3'services: logstash02: image: logstash:6.4.1 hostname: logstash02 container_name: logstash02 ports:-"5045 restart 5045" # set port environment: XPACK_MONITORING_ENABLED: "false" pipeline.batch.size: 10 volumes: -. / logstash/logstash.conf:/usr/share/logstash/pipeline/logstash.conf network_mode: "host" restart: always

. / logstash/logstash.conf file is as follows:

Version: '3'services: logstash02: image: logstash:6.4.1 hostname: logstash02 container_name: logstash02 ports:-"5045 restart 5045" # set port environment: XPACK_MONITORING_ENABLED: "false" pipeline.batch.size: 10 volumes: -. / logstash/logstash.conf:/usr/share/logstash/pipeline/logstash.conf network_mode: "host" restart: always

Then run docker-compose up to start the logstash container, and during the logstash test

/ usr/share/logstash/bin/logstash-e 'input {stdin {} output {stdout {codec = > rubydebug}}'

You will be prompted that the logstash instance already exists. If you want to run multiple logstash instances, you need to define the path.data through the command, as follows:

Bin/logstash-f-- path.data PATH/usr/share/logstash/bin/logstash-- path.data / usr/share/logstash/data02-e 'input {stdin {} output {stdout {codec = > rubydebug}}'

The output is as follows:

Export to ES, file:

/ usr/share/logstash/bin/logstash-- path.data / usr/share/logstash/data02-e 'input {stdin {} output {elasticsearch {hosts = > ["127.0.0.1 YYYY.MM.dd 9200"] index = > "logstashtest_% {+ YYYY.MM.dd}"}' / usr/share/logstash/bin/logstash-e 'input {stdin {} output {file {path = > "/ tmp/test_% {+ YYYY.MM.dd} .log"}' Thank you for reading The above is the content of "how to install logstash on Docker". After the study of this article, I believe you have a deeper understanding of how to install logstash on Docker, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

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.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report