无法将日志发送到ec2 logstash

时间:2020-10-19 00:47:22

标签: amazon-ec2 logstash aws-security-group aws-elasticsearch

我无法通过AWS EC2 logstash实例将数据记录到AWS ES,但是可以使用docker logstash服务使用相同的logstash.conf配置文件将数据记录到AWS ES

EC2 Logstash实例的安全组: Security Group for EC2 Logstash instance

logstash.conf

input {
  udp {
    port  => 8089
    codec => json
  }
  elasticsearch {
   ...
  }
}
...

运行logstash:

....
[INFO ] xxxxxxxxxxxxxxxx [[main]<udp] udp - Starting UDP listener {:address=>"0.0.0.0:8089"}
[INFO ] xxxxxxxxxxxxxxxx [[main]<udp] udp - UDP listener started {:address=>"0.0.0.0:8089", :receive_buffer_bytes=>"106496", :queue_size=>"2000"}
[INFO ] xxxxxxxxxxxxxxxx [Api Webserver] agent - Successfully started Logstash API endpoint {:port=>9600}

但是将带有docker-compose.yml的logstash服务运行日志发送到AWS ES。在docker-compose.yml中的logstash服务配置下方

  logstash:
    image: logstash:7.7.0
    container_name: logstash
    hostname: logstash
    ports:
      - 9600:9600
      - 8089:8089
    volumes:
      - ./etc/infrastructure/logstash:/usr/share/logstash/pipeline
    networks:
      - api

0 个答案:

没有答案