# Getting token using http\_poller to do some request

**URL:** https://discuss.elastic.co/t/getting-token-using-http-poller-to-do-some-request/319153
**Category:** Logstash
**Created:** [November 17, 2022, 9:20am UTC](https://discuss.elastic.co/t/getting-token-using-http-poller-to-do-some-request/319153 "2022-11-17T09:20:28Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![yuswanul](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/yuswanul/32/101662_2.png) [@yuswanul](https://discuss.elastic.co/u/yuswanul)
#### Post date: [November 17, 2022, 9:20am UTC](https://discuss.elastic.co/t/getting-token-using-http-poller-to-do-some-request/319153/1 "2022-11-17T09:20:28Z")

</div>

Hi there,

maybe this topic has been opened by many people, but I still haven't found the answer. so, i would like to ask. i have configuration like this:

```auto
 input{
 http_poller{
     test4 => {
       method => post
       url => "https://api.mangadex.org/auth/login"
       headers => {
          Accept => "application/json"
         }
       auth => {
          user => "user"
          password => "somepass"
         }
       }
    }
 }

```

originally I planned to use this input to get tokens and after I get the token I will make a request using the http filter below:

```auto
 filter{
 http {
   body_format => "json"
   follow_redirects => false
   url => "https://api.mangadex.org/manga?itle=Kanojyo%20to%20Himitsu%20to%20Koimoyou"
   verb => "GET"
   headers => ["Authorization", "Bearer ${my-token}"]
   target_body => "[@metadata][api_response]"
   target_headers => "[@metadata][api_headers]"
 }
 }

```

but the result is nothing. no data is thrown to elastic. is my configuration still wrong? if yes, how the configuration should look like? and if you have another method to do this, please tell me. you can try the API too because it's public but you must login first.

Thank you

---

<div class="post-metadata">

### Author: ![Rios](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rios/32/95745_2.png) [@Rios](https://discuss.elastic.co/u/Rios)
#### Post date: [November 17, 2022, 11:44am UTC](https://discuss.elastic.co/t/getting-token-using-http-poller-to-do-some-request/319153/2 "2022-11-17T11:44:48Z")

</div>

I think it's not supported. Try with [Filebeat](https://www.elastic.co/guide/en/beats/filebeat/current/filebeat-input-httpjson.html) plugin

I hope Elastic team members will help you with http\_poll

---

<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 15, 2022, 11:45am UTC](https://discuss.elastic.co/t/getting-token-using-http-poller-to-do-some-request/319153/3 "2022-12-15T11:45:09Z")

</div>

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