How to make automatically renewable login and cookie?

Hi,
how to make a to make login every 10 minutes automatically? To login my path is "http://localhost:8080/api/ses/login" and I have to enter login and password in a such JSON form

{
"login": "login",
"password": "password"
}

after that I get a cookie which I could manualy write to logstash, but after logout I need to copy again a cookie and past in a line Cookie => "blablabla",how to make it automatically?

Here is my logstash.conf file

input {
  http_poller {
    urls => {
      test2 => {
        url => "http://localhost:8080/api/my/path"
        method => "get"
        headers => {
          Accept => "application/json"
          Cookie => "blablabla"
        }
     }
    }
    request_timeout => 60
    # Supports "cron", "every", "at" and "in" schedules by rufus scheduler
    schedule => { cron => "* * * * * UTC"}
    codec => "json"
    # A hash of request metadata info (timing, response headers, etc.) will be sent here
    metadata_target => "http_poller_metadata"
  }
}
output {
  stdout {
    codec => rubydebug
    }
}                                                                                                                                1,7           Top

Duplicate of POST method http_poller.

yes, sorry my bad

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