# When do I use unique: true?

**URL:** <https://discuss.elastic.co/t/when-do-i-use-unique-true/289492>\
**Category:** Beats\
**Tags:** beats-module, metricbeat\
**Created:** [November 17, 2021, 6:10pm UTC](https://discuss.elastic.co/t/when-do-i-use-unique-true/289492 "2021-11-17T18:10:15Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Laszlo\_Stahorszki](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/laszlo_stahorszki/32/97236_2.png) [@Laszlo\_Stahorszki](https://discuss.elastic.co/u/Laszlo_Stahorszki)\
**Post date:** [November 17, 2021, 6:10pm UTC](https://discuss.elastic.co/t/when-do-i-use-unique-true/289492/1 "2021-11-17T18:10:15Z")

</div>

Using kubernetes module for my metricbeat config, deployed as DaemonSet.

```auto
metricbeat.config.modules:
    # Mounted `metricbeat-daemonset-modules` configmap:
    path: ${path.config}/modules.yml
    # Reload module configs as they change:
    reload.enabled: false
metricbeat.autodiscover:
  providers:
    - type: kubernetes
      scope: cluster
      node: ${NODE_IP}
      unique: true
      templates:
        - config:
            - module: kubernetes
              metricsets:
                - container
                - node
                - pod
                - system
                - volume
              period: 60s
              enabled: true
              hosts: ["https://${NODE_IP}:10250"]
              bearer_token_file: /var/run/secrets/kubernetes.io/serviceaccount/token
              ssl.certificate_authorities:
                - /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
              add_metadata: true
processors:
  - add_cloud_metadata:
output.logstash:
  hosts: ["monitoring-logstash:5044"]

```

If `unique: true` is set, my metrics work as intended, when it's false, metrics act weird.

Now, this is unexpected, because the host is `NODE_IP` on all metricbeat instances, which is different for every instance for obvious reasons. Why does setting unique to true matter? Does this mean that I don't need to deploy metricbeat as a DaemonSet, but a simple Deployment is enough?

---

<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:** [December 15, 2021, 8:11pm UTC](https://discuss.elastic.co/t/when-do-i-use-unique-true/289492/2 "2021-12-15T20:11:01Z")

</div>

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