# Does Filebeat have to use 'beats\_system' or 'elastic' to connect to ElasticSearch?

**URL:** <https://discuss.elastic.co/t/does-filebeat-have-to-use-beats-system-or-elastic-to-connect-to-elasticsearch/255434>\
**Category:** Beats\
**Tags:** filebeat\
**Created:** [November 15, 2020, 11:42am UTC](https://discuss.elastic.co/t/does-filebeat-have-to-use-beats-system-or-elastic-to-connect-to-elasticsearch/255434 "2020-11-15T11:42:25Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![houmie](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/houmie/32/78999_2.png) [@houmie](https://discuss.elastic.co/u/houmie)\
**Post date:** [November 15, 2020, 11:42am UTC](https://discuss.elastic.co/t/does-filebeat-have-to-use-beats-system-or-elastic-to-connect-to-elasticsearch/255434/1 "2020-11-15T11:42:25Z")

</div>

Sorry, which one is the best practice? Because when we run `elasticsearch-setup-passwords auto` it generates passwords for `beats_system` and `elastic` for us.

```auto
output.elasticsearch:
  hosts: ["localhost:9200"]
  protocol: "https"
  username: "elastic"
  password: "${ES_PASSWORD}"

```

Or

```auto
output.elasticsearch:
  hosts: ["localhost:9200"]
  protocol: "https"
  username: "beats_system"
  password: "${BEATS_SYSTEM_PASSWD}"

```

If the former is correct, then in which circumstances do we use beats\_system?

Many Thanks,  
Houman

---

<div class="post-metadata">

**Author:** ![aaron-nimocks](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aaron-nimocks/32/73965_2.png) [@aaron-nimocks](https://discuss.elastic.co/u/aaron-nimocks)\
**Post date:** [November 15, 2020, 3:14pm UTC](https://discuss.elastic.co/t/does-filebeat-have-to-use-beats-system-or-elastic-to-connect-to-elasticsearch/255434/2 "2020-11-15T15:14:19Z")

</div>

`beats_system` doesn't have the correct privileges. It's for monitoring and not ingesting data.

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/d/6/d668b571f09b48df1653b54bfeff229ae99f9eff.png)

`elastic` has too many privileges you wouldn't want someone getting access to so not using it if not needed is the best practice.

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/3/a/3ab4eb77482d878049a58cd46ae652a0506a4636.png)

I'd recommend [creating a custom user/role](https://www.elastic.co/guide/en/beats/filebeat/current/privileges-to-publish-events.html) that has the exact but minimum privileges enabled. Also you could [generate an API key](https://www.elastic.co/guide/en/beats/filebeat/current/beats-api-keys.html) vs having to use keystore for the password.

---

<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 13, 2020, 5:14pm UTC](https://discuss.elastic.co/t/does-filebeat-have-to-use-beats-system-or-elastic-to-connect-to-elasticsearch/255434/3 "2020-12-13T17:14:23Z")

</div>

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