# Ingest logs from a web API that require auth in a separate request

**URL:** <https://discuss.elastic.co/t/ingest-logs-from-a-web-api-that-require-auth-in-a-separate-request/330113>\
**Category:** Beats\
**Tags:** filebeat\
**Created:** [April 17, 2023, 10:10am UTC](https://discuss.elastic.co/t/ingest-logs-from-a-web-api-that-require-auth-in-a-separate-request/330113 "2023-04-17T10:10:13Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Miguel\_Azorin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/miguel_azorin/32/99030_2.png) [@Miguel\_Azorin](https://discuss.elastic.co/u/Miguel_Azorin)\
**Post date:** [April 17, 2023, 10:10am UTC](https://discuss.elastic.co/t/ingest-logs-from-a-web-api-that-require-auth-in-a-separate-request/330113/1 "2023-04-17T10:10:13Z")

</div>

Hi!

We are currently facing a situation in which we need to request the logs to an external API. Our initial idea was to do this using Filebeat's `httpjson` plugin, but now we are uncertain that this can be achieved, given API usage, which goes as follows:

1. You send a request to "[example.com/v1.0/token](http://example.com/v1.0/token)" providing the user/password to get an auth token
2. You send the request to "[example.com/logs](http://example.com/logs)" providing said token to retrieve the logs

Since we are no Elastic experts, we are wondering which would be the best method to collect these logs

---

<div class="post-metadata">

**Author:** ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)\
**Post date:** [April 17, 2023, 12:02pm UTC](https://discuss.elastic.co/t/ingest-logs-from-a-web-api-that-require-auth-in-a-separate-request/330113/2 "2023-04-17T12:02:43Z")

</div>

I do not use Filebeat for this, but according to the [documentation](https://www.elastic.co/guide/en/beats/filebeat/current/filebeat-input-httpjson.html) it seems possible.

Plese, check the examples in the documentation.

---

<div class="post-metadata">

**Author:** ![Miguel\_Azorin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/miguel_azorin/32/99030_2.png) [@Miguel\_Azorin](https://discuss.elastic.co/u/Miguel_Azorin)\
**Post date:** [April 20, 2023, 7:46am UTC](https://discuss.elastic.co/t/ingest-logs-from-a-web-api-that-require-auth-in-a-separate-request/330113/3 "2023-04-20T07:46:09Z")

</div>

Hi leandrojmp,

You are right, it looks like I completely missed that example when browsing the documentation.

Thank you very much and excuse me for the trouble.

Best regards!

Miguel

---

<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:** [May 18, 2023, 7:46am UTC](https://discuss.elastic.co/t/ingest-logs-from-a-web-api-that-require-auth-in-a-separate-request/330113/4 "2023-05-18T07:46:13Z")

</div>

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