{"action":"created","issue":{"url":"https://api.github.com/repos/logstash-plugins/logstash-codec-json/issues/2","labels_url":"https://api.github.com/repos/logstash-plugins/logstash-codec-json/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/logstash-plugins/logstash-codec-json/issues/2/comments","events_url":"https://api.github.com/repos/logstash-plugins/logstash-codec-json/issues/2/events","html_url":"https://github.com/logstash-plugins/logstash-codec-json/issues/2","id":54490660,"number":2,"title":"Optionally support handling of \\x escape codes","user":{"login":"jordansissel","id":131818,"avatar_url":"https://avatars.githubusercontent.com/u/131818?v=3","gravatar_id":"","url":"https://api.github.com/users/jordansissel","html_url":"https://github.com/jordansissel","followers_url":"https://api.github.com/users/jordansissel/followers","following_url":"https://api.github.com/users/jordansissel/following{/other_user}","gists_url":"https://api.github.com/users/jordansissel/gists{/gist_id}","starred_url":"https://api.github.com/users/jordansissel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jordansissel/subscriptions","organizations_url":"https://api.github.com/users/jordansissel/orgs","repos_url":"https://api.github.com/users/jordansissel/repos","events_url":"https://api.github.com/users/jordansissel/events{/privacy}","received_events_url":"https://api.github.com/users/jordansissel/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-01-15T19:12:03Z","updated_at":"2015-01-15T19:34:18Z","closed_at":null,"body":"Some clever ways of generating JSON are observed in nginx and apache httpd configs by using the log formatting function of these webservers to write json instead of plain text. The way this occurs is to use the normal log formatter functions of these programs.\r\n\r\nHowever, because nginx and apache try to log readable text, any non-printable text will be visible as a two-digit, hex-encoded escapes, like `\\x09`\r\n\r\nWe already make concessions for \"invalid json\" due to often-misconfigured nxlog json (via charset settings), so I think we can make another concession here for `\\xNN` codes.\r\n\r\nProposal:\r\n\r\n```\r\ninput {\r\n  redis {\r\n    codec => json { escaped_hex_codes => true }\r\n  }\r\n}\r\n```\r\n\r\nNew setting, `escaped_hex_codes`, when true, would automatically process `\\xNN` text before passing to the JSON parser."},"comment":{"url":"https://api.github.com/repos/logstash-plugins/logstash-codec-json/issues/comments/70146776","html_url":"https://github.com/logstash-plugins/logstash-codec-json/issues/2#issuecomment-70146776","issue_url":"https://api.github.com/repos/logstash-plugins/logstash-codec-json/issues/2","id":70146776,"user":{"login":"kurtado","id":1161427,"avatar_url":"https://avatars.githubusercontent.com/u/1161427?v=3","gravatar_id":"","url":"https://api.github.com/users/kurtado","html_url":"https://github.com/kurtado","followers_url":"https://api.github.com/users/kurtado/followers","following_url":"https://api.github.com/users/kurtado/following{/other_user}","gists_url":"https://api.github.com/users/kurtado/gists{/gist_id}","starred_url":"https://api.github.com/users/kurtado/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kurtado/subscriptions","organizations_url":"https://api.github.com/users/kurtado/orgs","repos_url":"https://api.github.com/users/kurtado/repos","events_url":"https://api.github.com/users/kurtado/events{/privacy}","received_events_url":"https://api.github.com/users/kurtado/received_events","type":"User","site_admin":false},"created_at":"2015-01-15T19:34:18Z","updated_at":"2015-01-15T19:34:18Z","body":"Another sample nginx log message with escaped double quotes. This is generated by logging the body of a JSON POST:\r\n\r\n```\r\n{\"time\":\"2015-01-15T19:29:42+00:00\",\"host\":\"www.sdlkjsdlkj.com\",\"remote\":\"10.20.30.40\",\"origin\":\"12.34.56.78\",\"request\":\"POST / HTTP/1.1\",\"code\":200,\"size\":0,\"referrer\":\"-\",\"agent\":\"curl/7.30.0\",\"body\":\"{\\x22foo\\x22:\\x22bar\\x22}\"}\r\n```"}}