unable to send logs to ec2 logstash

209 Views Asked by At

I can not log data trhough AWS EC2 logstash instance to AWS ES, while I do can log data with docker logstash service using same logstash.conf configuration file to AWS ES

Security group for EC2 logstash instance: Security Group for EC2 Logstash instance

logstash.conf

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

running 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}

But running the logstash service with docker-compose.yml logs are sent to AWS ES. Below logstash service configuration from docker-compose.yml

  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

There are 0 best solutions below