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
I slept late yesterday and was awake the whole da...
Table of contents 1. Problem Description 2. Probl...
1. Introduction Vagrant is a tool for building an...
We know that when using HTML on NetEase Blog, we ...
Even though it's not Halloween, it's wort...
Awk is an application for processing text files, ...
The Internet is an organism that is constantly ev...
Table of contents Scenario Analysis Development S...
This article shares the specific code for JavaScr...
1. Environment and related software Virtual Machi...
Table of contents The effect of mixed inheritance...
MyISAM storage engine The MyISAM storage engine i...
Installing Docker on CentOS requires the operatin...
one. Mysql Binlog format introduction Mysql binlo...
This article example shares the specific code of ...