# How to make automatically renewable login and cookie?

**URL:** https://discuss.elastic.co/t/how-to-make-automatically-renewable-login-and-cookie/141794
**Category:** Logstash
**Created:** [July 26, 2018, 2:24pm UTC](https://discuss.elastic.co/t/how-to-make-automatically-renewable-login-and-cookie/141794 "2018-07-26T14:24:06Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![m.sereda](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/m.sereda/32/48232_2.png) [@m.sereda](https://discuss.elastic.co/u/m.sereda)
#### Post date: [July 26, 2018, 2:24pm UTC](https://discuss.elastic.co/t/how-to-make-automatically-renewable-login-and-cookie/141794/1 "2018-07-26T14:24:06Z")

</div>

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
```

---

<div class="post-metadata">

### Author: ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)
#### Post date: [July 27, 2018, 6:52pm UTC](https://discuss.elastic.co/t/how-to-make-automatically-renewable-login-and-cookie/141794/2 "2018-07-27T18:52:41Z")

</div>

Duplicate of [POST method http\_poller](https://discuss.elastic.co/t/post-method-http-poller/141940).

---

<div class="post-metadata">

### Author: ![m.sereda](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/m.sereda/32/48232_2.png) [@m.sereda](https://discuss.elastic.co/u/m.sereda)
#### Post date: [July 27, 2018, 6:53pm UTC](https://discuss.elastic.co/t/how-to-make-automatically-renewable-login-and-cookie/141794/3 "2018-07-27T18:53:33Z")

</div>

yes, sorry my bad

---

<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: [August 24, 2018, 6:53pm UTC](https://discuss.elastic.co/t/how-to-make-automatically-renewable-login-and-cookie/141794/4 "2018-08-24T18:53:47Z")

</div>

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