# Filebeat - elasticsearch

**URL:** <https://discuss.elastic.co/t/filebeat-elasticsearch/378020>\
**Category:** Beats\
**Tags:** filebeat\
**Created:** [May 12, 2025, 6:11am UTC](https://discuss.elastic.co/t/filebeat-elasticsearch/378020 "2025-05-12T06:11:18Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![n0405](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/n0405/32/142967_2.png) [@n0405](https://discuss.elastic.co/u/n0405)\
**Post date:** [May 12, 2025, 6:11am UTC](https://discuss.elastic.co/t/filebeat-elasticsearch/378020/1 "2025-05-12T06:11:18Z")

</div>

Hello ,

I use filebeat to send logs to Elasticsearch , but my configuration wan't work . I use version 8.18.1.  
In Elasticsearch config file this is security settinges :

```auto
xpack.security.enabled: true

xpack.security.enrollment.enabled: true
xpack.security.http.ssl:
  enabled: true
  keystore.path: certs/http.p12
xpack.security.transport.ssl:
  enabled: true
  verification_mode: certificate
  keystore.path: certs/transport.p12
  truststore.path: certs/transport.p12
cluster.initial_master_nodes: ["node-1"]
http.host: 0.0.0.0

```

This is filebeat configuration

```auto
filebeat.inputs:
- type: filestream
  enabled: true
  id: test-input
  paths:
    - /var/log/test_logs/*.log

output.elasticsearch:
  hosts: ["https://localhost:9200"]
  api_key: "rty6v5YB6WaKLqtvBbKX:dhDckloIYuUMh6kXH2jiuy"
   ssl.certificate_authorities: ["/etc/elasticsearch/certs/http_ca.crt"]
  ssl.certificate: "/etc/elasticsearch/certs/http.p12"
  ssl.key: "/etc/elasticsearch/certs/http.p12"

```

Token for filebeat is generate with all privileges .  
When I test connection using token I am getting :

curl: (60) SSL certificate problem: self-signed certificate in certificate chain  
More details here: [curl - SSL CA Certificates](https://curl.se/docs/sslcerts.html)

curl failed to verify the legitimacy of the server and therefore could not  
establish a secure connection to it. To learn more about this situation and  
how to fix it, please visit the web page mentioned above.

I am new to ELK stack and I don't see what I am misconfigured, does someone help me 🙂

---

<div class="post-metadata">

**Author:** ![n0405](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/n0405/32/142967_2.png) [@n0405](https://discuss.elastic.co/u/n0405)\
**Post date:** [May 12, 2025, 6:55am UTC](https://discuss.elastic.co/t/filebeat-elasticsearch/378020/2 "2025-05-12T06:55:39Z")

</div>

I seams that "update-ca-certificates" solve this problem. but now is problem with token .

{"error":{"root\_cause":[{"type":"security\_exception","reason":"unable to authenticate with provided credentials and anonymous access is not allowed for this request","additional\_unsuccessful\_credentials":"API key: Illegal base64 character 5f","header":{"WWW-Authenticate":["Basic realm="security", charset="UTF-8"","Bearer realm="security"","ApiKey"]}}],"type":"security\_exception","reason":"unable to authenticate with provided credentials and anonymous access is not allowed for this request","additional\_unsuccessful\_credentials":"API key: Illegal base64 character 5f","header":{"WWW-Authenticate":["Basic realm="security", charset="UTF-8"","Bearer realm="security"","ApiKey"]}},"status":401}root
