I am totally new with the ELK stack and not really a sysadmin either, just a web developer trying to figure this out.
I have two droplets:
- one where I installed the ELK stack successfully to some extent (managed to visualize syslogs with the filebeat system module)
- another where my openresty web server works. openresty is an nginx distribution.
I managed to configure filebeat in the openresty droplet to send the logs:
...
filebeat.inputs:
- type: log
enabled: true
paths:
- /home/scheduler/logs/openresty/access.log
- /home/scheduler/logs/openresty/error.log
fields:
type: nginx
...
# commented out Elasticsearch output
#output.elasticsearch:
...
output.logstash:
hosts: ["<ELK_DROPLET_PUBLIC_IP>:5044"]
...
And in the ELK droplet I have this logstash configuration file:
input {
beats {
port => 5044
}
}
output {
elasticsearch {
hosts => ["localhost:9200"]
index => "openresty-logs-%{+YYYY.MM.dd}"
pipeline => "openresty_log_type_pipeline"
}
}
This works and I have even set up a pipeline through Kibana to classify access/error entries.
Now, I am trying to get the Kibana dashboards for nginx to work with my openresty logs but after much research and effort I have hit a wall.
I have enabled the nginx module in the openresty droplet:
sudo filebeat modules enable nginx
And configured the filebeat module to use the openresty logs:
# /etc/filebeat/modules.d/nginx.yml
- module: nginx
access:
enabled: true
var.paths: ["/home/scheduler/logs/openresty/access.log"]
error:
enabled: true
var.paths: ["/home/scheduler/logs/openresty/error.log"]
ingress_controller:
enabled: false
But I am not even sure if this is working. Is there a way to tell whether the nginx data is being shipped with filebeat to logstash in the other droplet? Modules are imported by default in the filebeat config.
I am aware that I will probably need to take care of proper log formatting. But the first worry is not being able to get the openresty/nginx logs to Logstash and indexed properly for the dashboard to be able to take the data.
What do I need to do to have the Kibana nginx dashboards work with my openresty logs?