{"id":16644828,"url":"https://github.com/toyama0919/fluent-plugin-http_shadow","last_synced_at":"2025-03-21T15:32:43.312Z","repository":{"id":26396328,"uuid":"29846020","full_name":"toyama0919/fluent-plugin-http_shadow","owner":"toyama0919","description":"copy http request. use shadow proxy server.","archived":false,"fork":false,"pushed_at":"2018-04-01T11:40:51.000Z","size":25,"stargazers_count":21,"open_issues_count":0,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-18T02:51:34.958Z","etag":null,"topics":["fluentd","fluentd-plugin","shadow-proxy-server"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/toyama0919.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-01-26T05:14:08.000Z","updated_at":"2019-03-03T14:36:47.000Z","dependencies_parsed_at":"2022-09-12T00:00:20.385Z","dependency_job_id":null,"html_url":"https://github.com/toyama0919/fluent-plugin-http_shadow","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/toyama0919%2Ffluent-plugin-http_shadow","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/toyama0919%2Ffluent-plugin-http_shadow/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/toyama0919%2Ffluent-plugin-http_shadow/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/toyama0919%2Ffluent-plugin-http_shadow/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/toyama0919","download_url":"https://codeload.github.com/toyama0919/fluent-plugin-http_shadow/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244822759,"owners_count":20516161,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["fluentd","fluentd-plugin","shadow-proxy-server"],"created_at":"2024-10-12T08:12:24.492Z","updated_at":"2025-03-21T15:32:43.017Z","avatar_url":"https://github.com/toyama0919.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# fluent-plugin-http_shadow\n[![Build Status](https://secure.travis-ci.org/toyama0919/fluent-plugin-http_shadow.png?branch=master)](http://travis-ci.org/toyama0919/fluent-plugin-http_shadow)\n[![Gem Version](https://badge.fury.io/rb/fluent-plugin-http_shadow.svg)](http://badge.fury.io/rb/fluent-plugin-http_shadow)\n\ncopy http request. use shadow proxy server.\n\n![Qiita](https://embed.gyazo.com/59d5fe9c4430325f6ad59c638971cc25.png \"Qiita\")\n\nrestored the http request from the logs that are sent to the fluentd.\n\n## Examples\n```\n\u003csource\u003e\n  type tail\n  format apache\n  path /var/log/httpd/access_log\n  pos_file /var/log/td-agent/access.pos\n  tag apache.access\n\u003c/source\u003e\n\n\u003cmatch apache.access\u003e\n  type http_shadow\n  host staging.exsample.com\n  path_format ${path}\n  method_key method\n  header_hash { \"Referer\": \"${referer}\", \"User-Agent\": \"${agent}\" }\n\u003c/match\u003e\n```\n\nAssume following input is coming:\n\n```\n  {\n    \"host\": \"exsample.com\",\n    \"ip_address\": \"127.0.0.1\",\n    \"server\": \"10.0.0.11\",\n    \"remote\": \"-\",\n    \"time\": \"22/Dec/2014:03:20:26 +0900\",\n    \"method\": \"GET\",\n    \"path\": \"/hoge/?id=1\",\n    \"code\": \"200\",\n    \"size\": \"1578\",\n    \"x_forwarded_proto\": \"http\",\n    \"referer\": \"http://exsample.com/other/\",\n    \"agent\": \"Mozilla/5.0 (Windows NT 6.1; Trident/7.0; rv:11.0) like Gecko\"\n  }\n```\n\nthen result becomes as below (indented):\n\n```\nGET http://staging.exsample.com/hoge/?id=1\n#=\u003e  HTTP HEADER\n#=\u003e  \"referer\": \"http://exsample.com/other/\"\n#=\u003e  \"agent\": \"Mozilla/5.0 (Windows NT 6.1; Trident/7.0; rv:11.0) like Gecko\"\n```\n\n## Examples(Virtual Host)\n```\n\u003cmatch http_shadow.exsample\u003e\n  type http_shadow\n  host_hash { \n    \"www.example.com\": \"staging.example.com\", \n    \"api.example.com\": \"api-staging.example.com\", \n    \"blog.ipros.jp\": \"blog-staging.ipros.jp\"\n  }\n  host_key host\n  path_format ${path}\n  method_key method\n  protocol_format ${x_forwarded_proto} # default: http\n  header_hash { \"Referer\": \"${referer}\", \"User-Agent\": \"${user_agent}\" }\n  no_send_header_pattern ^(-|)$\n\u003c/match\u003e\n```\n\n## Examples(use cookie)\n```\n\u003cmatch http_shadow.exsample\u003e\n  type http_shadow\n  host_hash { \n    \"www.example.com\": \"staging.example.com\", \n    \"api.example.com\": \"api-staging.example.com\", \n    \"blog.ipros.jp\": \"blog-staging.ipros.jp\"\n  }\n  host_key host\n  path_format ${path}\n  method_key method\n  header_hash { \"Referer\": \"${referer}\", \"User-Agent\": \"${user_agent}\" }\n  cookie_hash {\"rails-app_session\": \"${session_id}\"}\n\u003c/match\u003e\n```\n\n## Examples(use rate_per_method_hash)\n```\n\u003cmatch http_shadow.exsample\u003e\n  type http_shadow\n  host_hash {\n    \"www.example.com\": \"staging.example.com\",\n    \"api.example.com\": \"api-staging.example.com\",\n    \"blog.ipros.jp\": \"blog-staging.ipros.jp\"\n  }\n  host_key host\n  path_format ${path}\n  method_key method\n  header_hash { \"Referer\": \"${referer}\", \"User-Agent\": \"${user_agent}\" }\n  rate_per_method_hash {\n    \"get\": 30, # This means 30% requests of GET will be sent. Default(when not defined) value is 100.\n    \"post\": 90\n  }\n\u003c/match\u003e\n```\n\n## Examples(use support_methods)\n```\n\u003cmatch http_shadow.exsample\u003e\n  type http_shadow\n  host_hash {\n    \"www.example.com\": \"staging.example.com\",\n    \"api.example.com\": \"api-staging.example.com\",\n    \"blog.ipros.jp\": \"blog-staging.ipros.jp\"\n  }\n  host_key host\n  path_format ${path}\n  method_key method\n  header_hash { \"Referer\": \"${referer}\", \"User-Agent\": \"${user_agent}\" }\n  support_methods [ \"get\", \"post\" ] # It means that only GET and POST are sent. By default all methods are sent.\n\u003c/match\u003e\n```\n\n## note\n\ndefault GET Request.\n\n## parameter\n\nTODO\n\n## todo\n\nmore test\n\n\n## Installation\n```\nfluent-gem install fluent-plugin-http_shadow\n```\n\n## Contributing\n\n1. Fork it\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Add some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create new [Pull Request](../../pull/new/master)\n\n## Information\n\n* [Homepage](https://github.com/toyama0919/fluent-plugin-http_shadow)\n* [Issues](https://github.com/toyama0919/fluent-plugin-http_shadow/issues)\n* [Documentation](http://rubydoc.info/gems/fluent-plugin-http_shadow/frames)\n* [Email](mailto:toyama0919@gmail.com)\n\n## Copyright\n\nCopyright (c) 2015 Hiroshi Toyama\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftoyama0919%2Ffluent-plugin-http_shadow","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftoyama0919%2Ffluent-plugin-http_shadow","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftoyama0919%2Ffluent-plugin-http_shadow/lists"}