# Need to create multiple logstash into the same server to monitor apache and nginx together

**URL:** https://discuss.elastic.co/t/need-to-create-multiple-logstash-into-the-same-server-to-monitor-apache-and-nginx-together/137290
**Category:** Logstash
**Created:** [June 25, 2018, 4:22pm UTC](https://discuss.elastic.co/t/need-to-create-multiple-logstash-into-the-same-server-to-monitor-apache-and-nginx-together/137290 "2018-06-25T16:22:51Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![m\_5amy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/m_5amy/32/32662_2.png) [@m\_5amy](https://discuss.elastic.co/u/m_5amy)
#### Post date: [June 25, 2018, 4:22pm UTC](https://discuss.elastic.co/t/need-to-create-multiple-logstash-into-the-same-server-to-monitor-apache-and-nginx-together/137290/1 "2018-06-25T16:22:52Z")

</div>

i'm trying to use ELK "Elasticsearch , logstash and kibana" to monitor apache and nginx logs  
and centralize logs into kibana.  
now I have got logs of apache into logstash and kibana so,  
what should i do to get ngnix logs too ??

Thanks.

---

<div class="post-metadata">

### Author: ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)
#### Post date: [June 25, 2018, 9:51pm UTC](https://discuss.elastic.co/t/need-to-create-multiple-logstash-into-the-same-server-to-monitor-apache-and-nginx-together/137290/2 "2018-06-25T21:51:17Z")

</div>

An exact answer depends on

- your exact configuration and
- whether your Apache logs and Nginx logs look the same (i.e. if they can be parsed with the same filter).

---

<div class="post-metadata">

### Author: ![m\_5amy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/m_5amy/32/32662_2.png) [@m\_5amy](https://discuss.elastic.co/u/m_5amy)
#### Post date: [June 26, 2018, 11:12am UTC](https://discuss.elastic.co/t/need-to-create-multiple-logstash-into-the-same-server-to-monitor-apache-and-nginx-together/137290/3 "2018-06-26T11:12:16Z")

</div>

Ok thanks @magnusbaeck but what about if there are multiple servers i want to monitor and the ELK into another server?  
what should i do to monitor all servers "different machines" into a single ELK ?

---

<div class="post-metadata">

### Author: ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)
#### Post date: [June 26, 2018, 12:29pm UTC](https://discuss.elastic.co/t/need-to-create-multiple-logstash-into-the-same-server-to-monitor-apache-and-nginx-together/137290/4 "2018-06-26T12:29:00Z")

</div>

Install Filebeat on all machines with logs and get them shipped to the machine where you want to run Logstash.

---

<div class="post-metadata">

### Author: ![m\_5amy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/m_5amy/32/32662_2.png) [@m\_5amy](https://discuss.elastic.co/u/m_5amy)
#### Post date: [June 26, 2018, 12:34pm UTC](https://discuss.elastic.co/t/need-to-create-multiple-logstash-into-the-same-server-to-monitor-apache-and-nginx-together/137290/5 "2018-06-26T12:34:00Z")

</div>

@magnusbaeck only filebeat or filebeat with logstash too ??

---

<div class="post-metadata">

### Author: ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)
#### Post date: [June 26, 2018, 1:07pm UTC](https://discuss.elastic.co/t/need-to-create-multiple-logstash-into-the-same-server-to-monitor-apache-and-nginx-together/137290/6 "2018-06-26T13:07:09Z")

</div>

That's up to you. I prefer using Filebeat and Logstash together since Logstash has more extensive filtering abilities.

---

<div class="post-metadata">

### Author: ![m\_5amy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/m_5amy/32/32662_2.png) [@m\_5amy](https://discuss.elastic.co/u/m_5amy)
#### Post date: [June 26, 2018, 1:10pm UTC](https://discuss.elastic.co/t/need-to-create-multiple-logstash-into-the-same-server-to-monitor-apache-and-nginx-together/137290/7 "2018-06-26T13:10:39Z")

</div>

Really thanks alot @magnusbaeck  
Is kibana can monitor apache request number , active workers and idle workers ?? if yse could you tell me how to make it into kibana ?

---

<div class="post-metadata">

### Author: ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)
#### Post date: [June 26, 2018, 1:41pm UTC](https://discuss.elastic.co/t/need-to-create-multiple-logstash-into-the-same-server-to-monitor-apache-and-nginx-together/137290/8 "2018-06-26T13:41:59Z")

</div>

Kibana can monitor any data you throw at it. I don't think there's anything built-in for what you're looking for. but check out Metricbeat and its modules.

---

<div class="post-metadata">

### Author: ![m\_5amy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/m_5amy/32/32662_2.png) [@m\_5amy](https://discuss.elastic.co/u/m_5amy)
#### Post date: [June 26, 2018, 2:46pm UTC](https://discuss.elastic.co/t/need-to-create-multiple-logstash-into-the-same-server-to-monitor-apache-and-nginx-together/137290/9 "2018-06-26T14:46:29Z")

</div>

@magnusbaeck my metricbeat.yml configuration attached and i followed this steps  
[https://www.elastic.co/guide/en/beats/metricbeat/current/metricbeat-configuration.html](https://www.elastic.co/guide/en/beats/metricbeat/current/metricbeat-configuration.html)

but never occurred and no merticbeat\* index added to kibana  
what should i do ?

###################### Metricbeat Configuration Example #######################

# This file is an example configuration file highlighting only the most common

# options. The metricbeat.reference.yml file from the same directory contains all the

# supported options with more comments. You can use it as a reference.

# 

# You can find the full configuration reference here:

# [https://www.elastic.co/guide/en/beats/metricbeat/index.html](https://www.elastic.co/guide/en/beats/metricbeat/index.html)

#========================== Modules configuration ============================

metricbeat.config.modules:

- module: system  
metricsets:

- module: apache  
metricsets: ["status"]  
enabled: true  
period: 1s  
hosts: ["my\_host"]

#==================== Elasticsearch template setting ==========================

setup.template.settings:  
index.number\_of\_shards: 1  
index.codec: best\_compression  
#\_source.enabled: false

#================================ General =====================================

# The name of the shipper that publishes the network data. It can be used to group

# all the transactions sent by a single shipper in the web interface.

#name:

# The tags of the shipper are included in their own field with each

# transaction published.

#tags: ["service-X", "web-tier"]

# Optional fields that you can specify to add additional information to the

# output.

#fields:

# env: staging

#============================== Dashboards =====================================

# These settings control loading the sample dashboards to the Kibana index. Loading

# the dashboards is disabled by default and can be enabled either by setting the

# options here, or by using the `-setup` CLI flag or the `setup` command.

#setup.dashboards.enabled: false

# The URL from where to download the dashboards archive. By default this URL

# has a value which is computed based on the Beat name and version. For released

# versions, this URL points to the dashboard archive on the [artifacts.elastic.co](http://artifacts.elastic.co)

# website.

#setup.dashboards.url:

#============================== Kibana =====================================

# Starting with Beats version 6.0.0, the dashboards are loaded via the Kibana API.

# This requires a Kibana endpoint configuration.

setup.kibana:  
host: "[http://myhost:5601](http://myhost:5601)"

# Kibana Host

# Scheme and port can be left out and will be set to the default (http and 5601)

# In case you specify and additional path, the scheme is required: [http://localhost:5601/path](http://localhost:5601/path)

# IPv6 addresses should always be defined as: https://[2001:db8::1]:5601

#host: "localhost:5601"

#============================= Elastic Cloud ==================================

# These settings simplify using metricbeat with the Elastic Cloud ([https://cloud.elastic.co/](https://cloud.elastic.co/)).

# The cloud.id setting overwrites the `output.elasticsearch.hosts` and

# `setup.kibana.host` options.

# You can find the `cloud.id` in the Elastic Cloud web UI.

#cloud.id:

# The cloud.auth setting overwrites the `output.elasticsearch.username` and

# `output.elasticsearch.password` settings. The format is `<user>:<pass>`.

#cloud.auth:

#================================ Outputs =====================================

# Configure what output to use when sending the data collected by the beat.

#-------------------------- Elasticsearch output ------------------------------  
output.elasticsearch:

# Array of hosts to connect to.

hosts: ["localhost:9200"]

# Optional protocol and basic auth credentials.

#protocol: "https"  
#username: "elastic"  
#password: "changeme"

#----------------------------- Logstash output --------------------------------  
#output.logstash:

# The Logstash hosts

#hosts: ["localhost:5044"]

# Optional SSL. By default is off.

# List of root certificates for HTTPS server verifications

#ssl.certificate\_authorities: ["/etc/pki/root/ca.pem"]

# Certificate for SSL client authentication

#ssl.certificate: "/etc/pki/client/cert.pem"

# Client Certificate Key

#ssl.key: "/etc/pki/client/cert.key"

#================================ Logging =====================================

# Sets log level. The default log level is info.

# Available log levels are: error, warning, info, debug

#logging.level: debug

# At debug level, you can selectively enable logging only for some components.

# To enable all selectors use ["\*"]. Examples of other selectors are "beat",

# "publish", "service".

#logging.selectors: ["\*"]

#============================== Xpack Monitoring ===============================

# metricbeat can export internal metrics to a central Elasticsearch monitoring

# cluster. This requires xpack monitoring to be enabled in Elasticsearch. The

# reporting is disabled by default.

# Set to true to enable the monitoring reporter.

#xpack.monitoring.enabled: false

# Uncomment to send the metrics to Elasticsearch. Most settings from the

# Elasticsearch output are accepted here as well. Any setting that is not set is

# automatically inherited from the Elasticsearch output configuration, so if you

# have the Elasticsearch output configured, you can simply uncomment the

# following line.

#xpack.monitoring.elasticsearch:

---

<div class="post-metadata">

### Author: ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)
#### Post date: [June 26, 2018, 4:23pm UTC](https://discuss.elastic.co/t/need-to-create-multiple-logstash-into-the-same-server-to-monitor-apache-and-nginx-together/137290/10 "2018-06-26T16:23:33Z")

</div>

The Metricbeat logs probably contain clues, especially if you crank up the loglevel. If that doesn't help, ask in the Beats category.

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [July 24, 2018, 4:29pm UTC](https://discuss.elastic.co/t/need-to-create-multiple-logstash-into-the-same-server-to-monitor-apache-and-nginx-together/137290/11 "2018-07-24T16:29:10Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
