# Logstash: cookie file from POST to GET method

**URL:** https://discuss.elastic.co/t/logstash-cookie-file-from-post-to-get-method/141837
**Category:** Logstash
**Created:** [July 26, 2018, 7:29pm UTC](https://discuss.elastic.co/t/logstash-cookie-file-from-post-to-get-method/141837 "2018-07-26T19:29:17Z")
**Posts on this page:** 3
**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, 7:29pm UTC](https://discuss.elastic.co/t/logstash-cookie-file-from-post-to-get-method/141837/1 "2018-07-26T19:29:18Z")

</div>

Could you please help me? Here is my logstash.conf and it is working but for this I need to write a cookie manualy. How to login to [http://localhost:8080/api/zzzzz/login](http://localhost:8080/api/zzzzz/login) - make a POST request, get a cookie and than automaticaly put a it to [http://localhost:8080/api/xxxxx/yyyyy](http://localhost:8080/api/xxxxx/yyyyy) ?

```
input {
  http_poller {
    urls => {
      test2 => {
    url => "http://localhost:8080/api/xxxxx/yyyyy"
        method => "get"
    headers => {
          Accept => "application/json"
      Cookie => "JSESSIONID=xxxxxxx"
        } 
     }
    }
    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
  }
}
```

---

<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, 10:05pm UTC](https://discuss.elastic.co/t/logstash-cookie-file-from-post-to-get-method/141837/2 "2018-07-27T22:05:55Z")

</div>

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

---

<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, 10:06pm UTC](https://discuss.elastic.co/t/logstash-cookie-file-from-post-to-get-method/141837/3 "2018-08-24T22:06:16Z")

</div>

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