From 631853acf37527056dee305c746b57ef2c2a252a Mon Sep 17 00:00:00 2001 From: Leonid Bugaev Date: Thu, 7 Jul 2016 16:41:23 +0300 Subject: [PATCH] Created Exporting to ElasticSearch (markdown) --- Exporting-to-ElasticSearch.md | 38 +++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 Exporting-to-ElasticSearch.md diff --git a/Exporting-to-ElasticSearch.md b/Exporting-to-ElasticSearch.md new file mode 100644 index 0000000..228ccdb --- /dev/null +++ b/Exporting-to-ElasticSearch.md @@ -0,0 +1,38 @@ +Gor can export requests and replayed response data to ElasticSearch: + +``` +./gor --input-raw :8000 --output-http http://staging.com --output-http-elasticsearch localhost:9200/gor +``` + +You don't have to create the index upfront. That will be done for you automatically. + +### Format + +Following structure represents ES format: + +``` +type ESRequestResponse struct { + ReqURL string `json:"Req_URL"` + ReqMethod string `json:"Req_Method"` + ReqUserAgent string `json:"Req_User-Agent"` + ReqAcceptLanguage string `json:"Req_Accept-Language,omitempty"` + ReqAccept string `json:"Req_Accept,omitempty"` + ReqAcceptEncoding string `json:"Req_Accept-Encoding,omitempty"` + ReqIfModifiedSince string `json:"Req_If-Modified-Since,omitempty"` + ReqConnection string `json:"Req_Connection,omitempty"` + ReqCookies string `json:"Req_Cookies,omitempty"` + RespStatus string `json:"Resp_Status"` + RespStatusCode string `json:"Resp_Status-Code"` + RespProto string `json:"Resp_Proto,omitempty"` + RespContentLength string `json:"Resp_Content-Length,omitempty"` + RespContentType string `json:"Resp_Content-Type,omitempty"` + RespTransferEncoding string `json:"Resp_Transfer-Encoding,omitempty"` + RespContentEncoding string `json:"Resp_Content-Encoding,omitempty"` + RespExpires string `json:"Resp_Expires,omitempty"` + RespCacheControl string `json:"Resp_Cache-Control,omitempty"` + RespVary string `json:"Resp_Vary,omitempty"` + RespSetCookie string `json:"Resp_Set-Cookie,omitempty"` + Rtt int64 `json:"RTT"` + Timestamp time.Time +} +``` \ No newline at end of file