# Using leader election condition in fleet managed Custom Logs integration doesn't work

**URL:** <https://discuss.elastic.co/t/using-leader-election-condition-in-fleet-managed-custom-logs-integration-doesnt-work/314591>\
**Category:** Beats\
**Tags:** filebeat\
**Created:** [September 16, 2022, 5:05pm UTC](https://discuss.elastic.co/t/using-leader-election-condition-in-fleet-managed-custom-logs-integration-doesnt-work/314591 "2022-09-16T17:05:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![woodywoodsta](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/woodywoodsta/32/107962_2.png) [@woodywoodsta](https://discuss.elastic.co/u/woodywoodsta)\
**Post date:** [September 16, 2022, 5:05pm UTC](https://discuss.elastic.co/t/using-leader-election-condition-in-fleet-managed-custom-logs-integration-doesnt-work/314591/1 "2022-09-16T17:05:31Z")

</div>

I have a fleet managed Daemonset of agents which are assigned a policy including the Custom Logs integration. I want to collect logs which are duplicated across all nodes, so I'm only interested in one of the agents shipping the logs. The only "correct" way to do this seems to be to use leader-election.

In the configuration editor for the Custom Logs integration, I've added the following custom config which I assume will enable log shipping for the leader agent and none of the others:

```nohighlight
condition: '${kubernetes_leaderelection.leader} == true'

```

However, it always disables shipping on all agents. I've tried different quoting styles, no quotes, and `'true'`, but neither of the variations work. When I set `condition: true` they all ship, and when I set `condition: false`, they're all are disabled.

Thoughts?

(I was asked to post here rather than [Issues · elastic/beats · GitHub](https://github.com/elastic/beats/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc))

---

<div class="post-metadata">

**Author:** ![woodywoodsta](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/woodywoodsta/32/107962_2.png) [@woodywoodsta](https://discuss.elastic.co/u/woodywoodsta)\
**Post date:** [September 26, 2022, 5:07pm UTC](https://discuss.elastic.co/t/using-leader-election-condition-in-fleet-managed-custom-logs-integration-doesnt-work/314591/2 "2022-09-26T17:07:01Z")

</div>

Any thoughts? If not, will create a Github issue.

---

<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:** [October 24, 2022, 7:07pm UTC](https://discuss.elastic.co/t/using-leader-election-condition-in-fleet-managed-custom-logs-integration-doesnt-work/314591/3 "2022-10-24T19:07:07Z")

</div>

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