# POST method http\_poller

**URL:** <https://discuss.elastic.co/t/post-method-http-poller/141940>\
**Category:** Logstash\
**Created:** [July 27, 2018, 12:11pm UTC](https://discuss.elastic.co/t/post-method-http-poller/141940 "2018-07-27T12:11:37Z")\
**Posts on this page:** 1\
**Showing post:** 13

<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 31, 2018, 8:03am UTC](https://discuss.elastic.co/t/post-method-http-poller/141940/13 "2018-07-31T08:03:17Z")

</div>

OK, now I think I understand. I changed my logstash.conf as the following

```
input {
  exec {
        command => "python /home/maksym/PathFolder/pythonpractice/postsample.py"
        interval => 20
        id => "plugin_id"  
        }
   request_timeout => 60
   schedule => { cron => "* * * * * UTC"}
   codec => "json"
}
      
output {
   stdout { 
     codec => rubydebug
   }
}

```

and python.py like this:

```
import os
os.chdir("/home/maksym/PathFolder")
from cookielib import LWPCookieJar

import requests

s = requests.Session()
s.cookies = LWPCookieJar('cookiejar')
if not os.path.exists('cookiejar'):
    # Create a new cookies file and set our Session's cookies
    print('setting cookies')
    s.cookies.save()
    r = s.post('http://localhost:8080/api/sess/login', json={'login': 'login', 'password': 'pass'})
    print(r.text)
else:
    # Load saved cookies from the file and use them in a request
    print('loading saved cookies')
    s.cookies.load(ignore_discard=True)
    r = s.get('http://localhost:8080/api/dash/space')
print(r.text)
# Save the session's cookies back to the file
s.cookies.save(ignore_discard=True)

print(r.status_code)
#print(r.json())
print(r.cookies)

```

and when I running the script from the console it is working, but from logstash no - nothing showing in Kibana. Could you tell me where I have made a mistake?

---

_[View the full topic](https://discuss.elastic.co/t/post-method-http-poller/141940)._
