{"action":"created","issue":{"url":"https://api.github.com/repos/elastic/logstash/issues/3489","labels_url":"https://api.github.com/repos/elastic/logstash/issues/3489/labels{/name}","comments_url":"https://api.github.com/repos/elastic/logstash/issues/3489/comments","events_url":"https://api.github.com/repos/elastic/logstash/issues/3489/events","html_url":"https://github.com/elastic/logstash/issues/3489","id":90348571,"number":3489,"title":"New filter plugin: Rest","user":{"login":"lucashenning","id":12414494,"avatar_url":"https://avatars.githubusercontent.com/u/12414494?v=3","gravatar_id":"","url":"https://api.github.com/users/lucashenning","html_url":"https://github.com/lucashenning","followers_url":"https://api.github.com/users/lucashenning/followers","following_url":"https://api.github.com/users/lucashenning/following{/other_user}","gists_url":"https://api.github.com/users/lucashenning/gists{/gist_id}","starred_url":"https://api.github.com/users/lucashenning/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lucashenning/subscriptions","organizations_url":"https://api.github.com/users/lucashenning/orgs","repos_url":"https://api.github.com/users/lucashenning/repos","events_url":"https://api.github.com/users/lucashenning/events{/privacy}","received_events_url":"https://api.github.com/users/lucashenning/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/elastic/logstash/labels/new-plugin","name":"new-plugin","color":"bfd4f2"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-06-23T10:28:29Z","updated_at":"2015-07-01T09:02:10Z","closed_at":null,"body":"Hi guys,\r\nI've created a new logstash filter plugin which can be used to handle complex rest calls. It supports custom headers and parameters as well as the logstash sprintf format to use event fields as configuration values.\r\n\r\nSample config:\r\n```sh\r\nrest {\r\n  url => \"http://example.com\"       # string (required, with field reference: \"http://example.com?id=%{id}\")\r\n  json => true                      # boolean (optional, default = false)\r\n  method => \"post\"                  # string (optional, default = \"get\")\r\n  sprintf => true                   # boolean (optional, default = false, set this to true if you want to use field references in url, header or params)\r\n  header => {                       # hash (optional)\r\n    \"key1\" => \"value1\"\r\n    \"key2\" => \"value2\"\r\n    \"key3\" => \"%{somefield}\"        # Please set sprintf to true if you want to use field references\r\n  }\r\n  params => {                       # hash (optional, only available for method => \"post\")\r\n    \"key1\" => \"value1\"\r\n    \"key2\" => \"value2\"\r\n    \"key3\" => \"%{somefield}\"        # Please set sprintf to true if you want to use field references\r\n  }\r\n}\r\n```\r\n\r\nGithub: https://github.com/lucashenning/logstash-filter-rest\r\nRubyGems: https://rubygems.org/gems/logstash-filter-rest\r\n\r\nI use it to gather environment information and to obtain a public encryption key for each event but I think there are several use cases. Currently the test makes sure that a json rest call works as expected.\r\n\r\nFeedback and suggestions are most welcome."},"comment":{"url":"https://api.github.com/repos/elastic/logstash/issues/comments/117551342","html_url":"https://github.com/elastic/logstash/issues/3489#issuecomment-117551342","issue_url":"https://api.github.com/repos/elastic/logstash/issues/3489","id":117551342,"user":{"login":"lucashenning","id":12414494,"avatar_url":"https://avatars.githubusercontent.com/u/12414494?v=3","gravatar_id":"","url":"https://api.github.com/users/lucashenning","html_url":"https://github.com/lucashenning","followers_url":"https://api.github.com/users/lucashenning/followers","following_url":"https://api.github.com/users/lucashenning/following{/other_user}","gists_url":"https://api.github.com/users/lucashenning/gists{/gist_id}","starred_url":"https://api.github.com/users/lucashenning/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lucashenning/subscriptions","organizations_url":"https://api.github.com/users/lucashenning/orgs","repos_url":"https://api.github.com/users/lucashenning/repos","events_url":"https://api.github.com/users/lucashenning/events{/privacy}","received_events_url":"https://api.github.com/users/lucashenning/received_events","type":"User","site_admin":false},"created_at":"2015-07-01T09:02:10Z","updated_at":"2015-07-01T09:02:10Z","body":"Hi @elvarb,\r\nthe plugin does support authentication. You can use the http basic auth url format (e.g. `http://user:pass@example.com`) or you can pass an authorization header with a base64 encoded password.\r\nYou might also consider looking at the new [logstash-input-http_poller](https://github.com/logstash-plugins/logstash-input-http_poller) plugin and its integrated interval function."}}