# Basic API Help with http output plugin

**URL:** https://discuss.elastic.co/t/basic-api-help-with-http-output-plugin/138258
**Category:** Logstash
**Created:** [July 2, 2018, 6:52pm UTC](https://discuss.elastic.co/t/basic-api-help-with-http-output-plugin/138258 "2018-07-02T18:52:54Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![terrik](https://avatars.discourse-cdn.com/v4/letter/t/a88e57/32.png) [@terrik](https://discuss.elastic.co/u/terrik)
#### Post date: [July 2, 2018, 6:52pm UTC](https://discuss.elastic.co/t/basic-api-help-with-http-output-plugin/138258/1 "2018-07-02T18:52:54Z")

</div>

Hi all,

I am completely new to Logstash, so please forgive my simple question. I am having a little trouble understanding how to use the http output plugin to send some apache logs to a SaaS cloud based log aggregation tool using a basic API key that the tool provides.

I went through the http output plugin documentation but it only references certs and keystores. All I have is an API key string (and URL) for the log aggregator.

Can anyone point me in the right direction or give me some documentation on the config file format I need to use to leverage an API key? I looked through these forums but couldnt find any good examples.

Thanks!

---

<div class="post-metadata">

### Author: ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)
#### Post date: [July 2, 2018, 7:37pm UTC](https://discuss.elastic.co/t/basic-api-help-with-http-output-plugin/138258/2 "2018-07-02T19:37:36Z")

</div>

How does the aggregator want you pass the key to it? If it wants it in the query string include it in the URL. If it wants a header set a header. What does it want?

---

<div class="post-metadata">

### Author: ![terrik](https://avatars.discourse-cdn.com/v4/letter/t/a88e57/32.png) [@terrik](https://discuss.elastic.co/u/terrik)
#### Post date: [July 2, 2018, 7:41pm UTC](https://discuss.elastic.co/t/basic-api-help-with-http-output-plugin/138258/3 "2018-07-02T19:41:18Z")

</div>

It looks like it wants it as a header. I guess that means I need:

headers =\> ["Authorization", "Basic "]

in the http output -\> http section of my config file?

---

<div class="post-metadata">

### Author: ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)
#### Post date: [July 2, 2018, 7:49pm UTC](https://discuss.elastic.co/t/basic-api-help-with-http-output-plugin/138258/4 "2018-07-02T19:49:22Z")

</div>

> [@terrik](#):
>
> I guess that means I need [...]

That's plausible.

---

<div class="post-metadata">

### Author: ![terrik](https://avatars.discourse-cdn.com/v4/letter/t/a88e57/32.png) [@terrik](https://discuss.elastic.co/u/terrik)
#### Post date: [July 2, 2018, 8:29pm UTC](https://discuss.elastic.co/t/basic-api-help-with-http-output-plugin/138258/5 "2018-07-02T20:29:18Z")

</div>

Looks like I had to go to the actual log aggregators documentation to get what the header needed to be: Authorization:Bearer key

I assumed there was some standard header to authenticate using an API key that I was missing. (Shows how green I am at this.)

Im all set now. Thank you.

---

<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: [July 30, 2018, 8:29pm UTC](https://discuss.elastic.co/t/basic-api-help-with-http-output-plugin/138258/6 "2018-07-30T20:29:21Z")

</div>

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