Hi,
Here my filebeat.yml
filebeat.prospectors:
- input_type: log
document_type: web_log
paths:
- /var/log/web.log
fields:
log_type: weblog
fields_under_root: true
- input_type: log
document_type: email_log
paths:
- /var/log/email.log
fields:
log_type: emaillog
fields_under_root: true
name: 10.0.0.0
output.logstash:
# The Logstash hosts
#hosts: ["localhost:5044"]
hosts: ["10.141.127.145:5443"]
bulk_max_size: 2048
#ssl.certificate_authorities: ["/etc/filebeat/logstash.crt"]
template.name: "filebeat"
template.path: "filebeat.template.json"
template.overwrite: false
While am restarting service throwing error as
ERR Connecting error publishing events (retrying): dial tcp 10.141.127.145:5443: getsockopt: connection refused
Telnet to 10.141.127.145:5443
is not working from filebeat, my ELK is running on 10.141.127.145 server, where my conf.d/ files as below
#input.conf
input {
beats {
host => "0.0.0.0"
port => 5443
type => weblog
#ssl => true
#ssl_certificate => "/etc/logstash/logstash.crt"
#ssl_key => "/etc/logstash/logstash.key"
}
}
#filter.conf
filter{
if [type] == "weblog" {
grok {
match => [ "message", "%{TIMESTAMP_ISO8601:timestamp} %{LOGLEVEL:loglevel} (?<logger>(?:[a-zA-Z0-9]+\.)*[-A-Za-z0-9$]+) %{GREEDYDATA:message}"]
overwrite => [ "message" ]
}
}
}
#output.conf
output {
elasticsearch { hosts => ["10.141.127.145:9200"]
hosts => "10.141.127.145:9200"
manage_template => false
index => "%{[@metadata][beat]}-%{+YYYY.MM.dd}"
document_type => "%{[@metadata][type]}"
}
}
Noticed process running under "logstash" user account instead of root.. see below
root@elk-ubuntu:/usr/share/logstash# ps -eaf | grep logstash
logstash 3364 1 16 18:26 ? 00:00:36 /usr/bin/java -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly -XX:+DisableExplicitGC -Djava.awt.headless=true -Dfile.encoding=UTF-8 -XX:+HeapDumpOnOutOfMemoryError -Xmx1g -Xms256m -Xss2048k -Djffi.boot.library.path=/usr/share/logstash/vendor/jruby/lib/jni -Xbootclasspath/a:/usr/share/logstash/vendor/jruby/lib/jruby.jar -classpath : -Djruby.home=/usr/share/logstash/vendor/jruby -Djruby.lib=/usr/share/logstash/vendor/jruby/lib -Djruby.script=jruby -Djruby.shell=/bin/sh org.jruby.Main /usr/share/logstash/lib/bootstrap/environment.rb logstash/runner.rb --path.settings /etc/logstash
root 3402 2485 0 18:29 pts/6 00:00:00 grep --color=auto logstash
I have restarted logstash stop & kill, but in ELK i couldn't see listening port on 5443 using netstat command, and filbeat not able to connect. May I know how to fix it.
No firewall issue, all ports are opened between ELK & Filebeat and it was working earlier.. i have restarted server thats it.
Thanks