Edit docker-compose.yml and add the following content: version: '3' services: logstash02: image: logstash:6.4.1 hostname: logstash02 container_name: logstash02 ports: - "5045: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 The contents of the ./logstash/logstash.conf file are as follows: version: '3' services: logstash02: image: logstash:6.4.1 hostname: logstash02 container_name: logstash02 ports: - "5045: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. When testing logstash, /usr/share/logstash/bin/logstash -e 'input { stdin{} } output { stdout{ codec => rubydebug }}' It will prompt that the logstash instance already exists. If you want to run multiple logstash instances, you need to define path.data through the command as follows: bin/logstash -f <config_file.conf> --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: Output to ES, file: /usr/share/logstash/bin/logstash --path.data /usr/share/logstash/data02 -e 'input { stdin{} } output { elasticsearch {hosts => ["127.0.0.1:9200"] index => "logstashtest_%{+YYYY.MM.dd}" }}' /usr/share/logstash/bin/logstash -e 'input { stdin{} } output { file { path => "/tmp/test_%{+YYYY.MM.dd}.log"}}' This is the end of this article about installing logstash with Docker. For more information about installing logstash with Docker, please search for previous articles on 123WORDPRESS.COM or continue to browse the following related articles. I hope you will support 123WORDPRESS.COM in the future! You may also be interested in:
|
>>: How to insert video into HTML and make it compatible with all browsers
login.html part: <!DOCTYPE html> <html l...
Table of contents Overview Code Implementation Su...
Installation Environment Centos Environment Depen...
Introduction: The configuration of Docker running...
Table of contents 1. Page Layout 2. Image upload ...
Vmware Installation Installing Packages Download ...
The current requirement is: there is a file uploa...
Overview The fundamental difference between async...
1. Problem The problems encountered when initiali...
MySQL database basic syntax DDL Operations Create...
About the tree display of Vue, the project is use...
First put a piece of code for(int i=0;i<1000;i...
1. Create users and authorize Creating users and ...
I solved a problem tonight that has been botherin...
CSS transformations, while cool, have not yet bee...