# Error in request on API

**URL:** https://community.graylog.org/t/error-in-request-on-api/8728
**Category:** Graylog Central (peer support)
**Created:** [February 6, 2019, 4:35pm UTC](https://community.graylog.org/t/error-in-request-on-api/8728 "2019-02-06T16:35:44Z")
**Posts on this page:** 12
**Page:** 1

<div class="post-metadata">

### Author: ![camilla-m](https://avatars.discourse-cdn.com/v4/letter/c/8491ac/32.png) [@camilla-m](https://community.graylog.org/u/camilla-m)
#### Post date: [February 6, 2019, 4:35pm UTC](https://community.graylog.org/t/error-in-request-on-api/8728/1 "2019-02-06T16:35:44Z")

</div>

Hello everybody,

I’m trying to configure a Graylog dashboard for Grafana and in the settings they ask for the API credentials.

> [Graylog Metrics | Grafana Labs](https://grafana.com/dashboards/2549)

```auto
username = "Your token here"
  password = "token"
  insecure_skip_verify = true

```

When I insert the url localhost:9000, and try to auth with username “my token generated here” and password token, I can’t access and view the informations in the panel.

I tested in Postman and when I try to request this endpoint with username “the token from Graylog API” and password “token” I receive a 405 method not authorized.

What this can be?

Thank you!

---

<div class="post-metadata">

### Author: ![macko003](https://sea2.discourse-cdn.com/flex016/user_avatar/community.graylog.org/macko003/32/3175_2.png) [@macko003](https://community.graylog.org/u/macko003)
#### Post date: [February 6, 2019, 6:26pm UTC](https://community.graylog.org/t/error-in-request-on-api/8728/2 "2019-02-06T18:26:14Z")

</div>

your link contains a graylog docs link.  
Have your read it?

---

<div class="post-metadata">

### Author: ![camilla-m](https://avatars.discourse-cdn.com/v4/letter/c/8491ac/32.png) [@camilla-m](https://community.graylog.org/u/camilla-m)
#### Post date: [February 6, 2019, 6:59pm UTC](https://community.graylog.org/t/error-in-request-on-api/8728/3 "2019-02-06T18:59:01Z")

</div>

Yes… I created the role to metrics for the token user, tested through telegraf --config telegraf.conf --test if is this working, read about two other messages in this forum:

> [@Graylog-Telegraf-Grafana](https://community.graylog.org/t/graylog-telegraf-grafana/6894/4):
>
> you notice the part where you actually need to place your token? The important is username = "Your token here" password = "token" The Password token does not need a change - the username needs to be the token.

> [@Grafana in Graylog](https://community.graylog.org/t/grafana-in-graylog/6430):
>
> I’d like to thank your help in advance. I am trying to integrate Grafana in Graylog. I have installed Telegraf, Grafana, and Influxdb. Also, I am using this config [https://grafana.com/dashboards/2549](https://grafana.com/dashboards/2549) When testing it, I am getting an error: E! Error in plugin [inputs.graylog]: Response from url “[https://X.X.X.X:9000/api/system/metrics/multiple](https://X.X.X.X:9000/api/system/metrics/multiple)” has status code 401 (Unauthorized), expected 200 (OK) When accessing it in the browser: {“type”:“ApiError”,“message”:“HTTP 405 Method Not Allowed”}

I tested in curl with the endpoint [http://localhost:9000/api/cluster](http://localhost:9000/api/cluster) and it returns me a correct JSON… but in Grafana I can´’t get the data and the graphics.

---

<div class="post-metadata">

### Author: ![jan](https://sea2.discourse-cdn.com/flex016/user_avatar/community.graylog.org/jan/32/11_2.png) [@jan](https://community.graylog.org/u/jan)
#### Post date: [February 7, 2019, 6:44am UTC](https://community.graylog.org/t/error-in-request-on-api/8728/4 "2019-02-07T06:44:19Z")

</div>

how does your configuration part of telegraf look like? what is the actuall error you have?

What means “I can’t get data” Did you understand that the data is stored in influx and Grafana pull that data from influx?

---

<div class="post-metadata">

### Author: ![camilla-m](https://avatars.discourse-cdn.com/v4/letter/c/8491ac/32.png) [@camilla-m](https://community.graylog.org/u/camilla-m)
#### Post date: [February 7, 2019, 1:54pm UTC](https://community.graylog.org/t/error-in-request-on-api/8728/5 "2019-02-07T13:54:05Z")

</div>

Looks like:

> (… all input graylog blah blah blah)  
> username = “my token from graylog”  
> password = “token”  
> insecure\_skip\_verify = true

inside “/etc/telegraf/telegraf.d/graylog.conf”

I saw after a “show measurement on grafana” that I don´t have nothing inside my influx database. I don´t know if a need to config the auth part in grafana or if only username and password is enough…

![image](https://us1.discourse-cdn.com/flex016/uploads/graylog/original/2X/4/433cb4135afe5f0cd1ec9cbeacf119b8095dd079.png)

But every other steps were made. I just can´t get the logs from Graylog inside influxdb.

---

<div class="post-metadata">

### Author: ![jan](https://sea2.discourse-cdn.com/flex016/user_avatar/community.graylog.org/jan/32/11_2.png) [@jan](https://community.graylog.org/u/jan)
#### Post date: [February 7, 2019, 4:04pm UTC](https://community.graylog.org/t/error-in-request-on-api/8728/6 "2019-02-07T16:04:47Z")

</div>

did you create a token in graylog and use that as username in the config like the dashboard readme advice?

---

<div class="post-metadata">

### Author: ![camilla-m](https://avatars.discourse-cdn.com/v4/letter/c/8491ac/32.png) [@camilla-m](https://community.graylog.org/u/camilla-m)
#### Post date: [February 7, 2019, 4:08pm UTC](https://community.graylog.org/t/error-in-request-on-api/8728/7 "2019-02-07T16:08:44Z")

</div>

yes, i created a user grafana and got the token, used that in the .conf and applied some roles of read metrics that i saw in a message of the forum.

---

<div class="post-metadata">

### Author: ![jan](https://sea2.discourse-cdn.com/flex016/user_avatar/community.graylog.org/jan/32/11_2.png) [@jan](https://community.graylog.org/u/jan)
#### Post date: [February 7, 2019, 4:10pm UTC](https://community.graylog.org/t/error-in-request-on-api/8728/8 "2019-02-07T16:10:00Z")

</div>

but that was not reflected by the given answer of yours

> [@Error in request on API](https://community.graylog.org/t/error-in-request-on-api/8728/5):
>
> Looks like: (… all input graylog blah blah blah) username = “my token from graylog” password = “token” insecure\_skip\_verify = true inside “/etc/telegraf/telegraf.d/graylog.conf” I saw after a “show measurement on grafana” that I don´t have nothing inside my influx database. I don´t know if a need to config the auth part in grafana or if only username and password is enough… [image] But every other steps were made. I just can´t get the logs from Graylog inside influxdb.

when you have nothing in influx, check your telegraf logs …

---

<div class="post-metadata">

### Author: ![camilla-m](https://avatars.discourse-cdn.com/v4/letter/c/8491ac/32.png) [@camilla-m](https://community.graylog.org/u/camilla-m)
#### Post date: [February 7, 2019, 4:47pm UTC](https://community.graylog.org/t/error-in-request-on-api/8728/9 "2019-02-07T16:47:45Z")

</div>

That´s what I have in the logs…

> 2019-02-06T14:39:13Z I! Starting Telegraf 1.9.4  
> 2019-02-06T14:39:13Z I! Loaded inputs: inputs.cpu inputs.disk inputs.diskio inputs.kernel inputs.mem inputs.processes inputs.swap inputs.system  
> 2019-02-06T14:39:13Z I! Loaded aggregators:  
> 2019-02-06T14:39:13Z I! Loaded processors:  
> 2019-02-06T14:39:13Z I! Loaded outputs: influxdb  
> 2019-02-06T14:39:13Z I! Tags enabled: host=graylog  
> 2019-02-06T14:39:13Z I! [agent] Config: Interval:10s, Quiet:false, Hostname:“graylog”, Flush Interval:10s

Seems to be correct. No?

---

<div class="post-metadata">

### Author: ![jan](https://sea2.discourse-cdn.com/flex016/user_avatar/community.graylog.org/jan/32/11_2.png) [@jan](https://community.graylog.org/u/jan)
#### Post date: [February 8, 2019, 8:41am UTC](https://community.graylog.org/t/error-in-request-on-api/8728/10 "2019-02-08T08:41:37Z")

</div>

come on - if that looks ‘ok-ish’ to you - check the next part in the chain. Influx - did you see the ingest? Did you have access to the data. You migh want to raise the log level of the telegraf to check if the scrapping of information happens…

Just follow that, debug each piecen in the chain if it works. BTW that question is now more linux debugging related and not Graylog …

---

<div class="post-metadata">

### Author: ![camilla-m](https://avatars.discourse-cdn.com/v4/letter/c/8491ac/32.png) [@camilla-m](https://community.graylog.org/u/camilla-m)
#### Post date: [February 13, 2019, 5:42pm UTC](https://community.graylog.org/t/error-in-request-on-api/8728/11 "2019-02-13T17:42:02Z")

</div>

I’m going to check this logs inside InfluxDB and Telegraf. Thank you

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex016/uploads/graylog/original/3X/c/7/c7c09c6b5099570133d6502b83f50ba4430de5b6.png) [@system](https://community.graylog.org/u/system)
#### Post date: [February 27, 2019, 5:42pm UTC](https://community.graylog.org/t/error-in-request-on-api/8728/12 "2019-02-27T17:42:05Z")

</div>

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