Getting token using http_poller to do some request

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:

 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:

 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

I think it's not supported. Try with Filebeat plugin

I hope Elastic team members will help you with http_poll

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