# Metricbeat on Openshift & Nginx

**URL:** https://discuss.elastic.co/t/metricbeat-on-openshift-nginx/327335
**Category:** Beats
**Tags:** filebeat, metricbeat
**Created:** [March 9, 2023, 8:45am UTC](https://discuss.elastic.co/t/metricbeat-on-openshift-nginx/327335 "2023-03-09T08:45:24Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Ivan\_Hosea](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ivan_hosea/32/117268_2.png) [@Ivan\_Hosea](https://discuss.elastic.co/u/Ivan_Hosea)
#### Post date: [March 9, 2023, 8:45am UTC](https://discuss.elastic.co/t/metricbeat-on-openshift-nginx/327335/1 "2023-03-09T08:45:24Z")

</div>

Hi, I was wondering if there's any way to monitor nginx inside openshift service with metricbeat & filebeat. Can anyone help me with this?

---

<div class="post-metadata">

### Author: ![amanv](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/amanv/32/118293_2.png) [@amanv](https://discuss.elastic.co/u/amanv)
#### Post date: [March 10, 2023, 9:25am UTC](https://discuss.elastic.co/t/metricbeat-on-openshift-nginx/327335/2 "2023-03-10T09:25:04Z")

</div>

Hi @Ivan_Hosea. You can refer the the official docs for running (file/metric)beat on OpenShift [here](https://www.elastic.co/guide/en/beats/metricbeat/master/running-on-kubernetes.html#_red_hat_openshift_configuration). Additionally, you may want to make use of the autodiscovery([here](https://www.elastic.co/guide/en/beats/filebeat/current/configuration-autodiscover.html)) to enable the proper modules. These should help you get started.

---

<div class="post-metadata">

### Author: ![Ivan\_Hosea](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ivan_hosea/32/117268_2.png) [@Ivan\_Hosea](https://discuss.elastic.co/u/Ivan_Hosea)
#### Post date: [March 14, 2023, 3:38am UTC](https://discuss.elastic.co/t/metricbeat-on-openshift-nginx/327335/3 "2023-03-14T03:38:07Z")

</div>

If for example I want to monitor redis for containers that have redis image plus their infrastructure, and just monitor infrastructure for the rest, do I need to create different templates? What do I need to add in this configuration below to do that?

```auto
metricbeat.autodiscover:
      providers:
        - type: kubernetes
          scope: cluster
          node: ${NODE_NAME}
          # In large Kubernetes clusters consider setting unique to false
          # to avoid using the leader election strategy and
          # instead run a dedicated Metricbeat instance using a Deployment in addition to the DaemonSet
          unique: true
          templates:
            - config:
                - module: kubernetes
                  hosts: ["kube-state-metrics:8080"]
                  period: 10s
                  add_metadata: true
                  metricsets:
                    - state_node
                    - state_deployment
                    - state_daemonset
                    - state_replicaset
                    - state_pod
                    - state_container
                    - state_job
                    - state_cronjob
                    - state_resourcequota
                    - state_statefulset
                    - state_service
                    - state_persistentvolume
                    - state_persistentvolumeclaim
                    - state_storageclass
                  # If `https` is used to access `kube-state-metrics`, uncomment following settings:
                  # bearer_token_file: /var/run/secrets/kubernetes.io/serviceaccount/token
                  # ssl.certificate_authorities:
                  # - /var/run/secrets/kubernetes.io/serviceaccount/service-ca.crt
                - module: kubernetes
                  metricsets:
                    - apiserver
                  hosts: ["https://${KUBERNETES_SERVICE_HOST}:${KUBERNETES_SERVICE_PORT}"]
                  bearer_token_file: /var/run/secrets/kubernetes.io/serviceaccount/token
                  ssl.certificate_authorities:
                    - /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
                  period: 30s
                # Uncomment this to get k8s events:
                #- module: kubernetes
                # metricsets:
                # - event
        # To enable hints based autodiscover uncomment this:
        #- type: kubernetes
        # node: ${NODE_NAME}
        # hints.enabled: true

```

The metricbeat autodiscover manifest above is from the default metricbeat kubernetes deployment file here: [https://raw.githubusercontent.com/elastic/beats/master/deploy/kubernetes/metricbeat-kubernetes.yaml](https://raw.githubusercontent.com/elastic/beats/master/deploy/kubernetes/metricbeat-kubernetes.yaml)

Also, does the metricbeat monitors all pods / service / deployments? If so, is there any way to filter it?

---

<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: [April 11, 2023, 5:38am UTC](https://discuss.elastic.co/t/metricbeat-on-openshift-nginx/327335/4 "2023-04-11T05:38:15Z")

</div>

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