{"action":"created","issue":{"url":"https://api.github.com/repos/elastic/kibana/issues/9433","repository_url":"https://api.github.com/repos/elastic/kibana","labels_url":"https://api.github.com/repos/elastic/kibana/issues/9433/labels{/name}","comments_url":"https://api.github.com/repos/elastic/kibana/issues/9433/comments","events_url":"https://api.github.com/repos/elastic/kibana/issues/9433/events","html_url":"https://github.com/elastic/kibana/pull/9433","id":194694902,"number":9433,"title":"Make Console Script Aware","user":{"login":"bleskes","id":1006375,"avatar_url":"https://avatars.githubusercontent.com/u/1006375?v=3","gravatar_id":"","url":"https://api.github.com/users/bleskes","html_url":"https://github.com/bleskes","followers_url":"https://api.github.com/users/bleskes/followers","following_url":"https://api.github.com/users/bleskes/following{/other_user}","gists_url":"https://api.github.com/users/bleskes/gists{/gist_id}","starred_url":"https://api.github.com/users/bleskes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bleskes/subscriptions","organizations_url":"https://api.github.com/users/bleskes/orgs","repos_url":"https://api.github.com/users/bleskes/repos","events_url":"https://api.github.com/users/bleskes/events{/privacy}","received_events_url":"https://api.github.com/users/bleskes/received_events","type":"User","site_admin":false},"labels":[{"id":470241342,"url":"https://api.github.com/repos/elastic/kibana/labels/:Operations","name":":Operations","color":"fef2c0","default":false},{"id":26198236,"url":"https://api.github.com/repos/elastic/kibana/labels/enhancement","name":"enhancement","color":"009800","default":true},{"id":135307740,"url":"https://api.github.com/repos/elastic/kibana/labels/review","name":"review","color":"eb6420","default":false}],"state":"open","locked":false,"assignee":{"login":"tylersmalley","id":40265,"avatar_url":"https://avatars.githubusercontent.com/u/40265?v=3","gravatar_id":"","url":"https://api.github.com/users/tylersmalley","html_url":"https://github.com/tylersmalley","followers_url":"https://api.github.com/users/tylersmalley/followers","following_url":"https://api.github.com/users/tylersmalley/following{/other_user}","gists_url":"https://api.github.com/users/tylersmalley/gists{/gist_id}","starred_url":"https://api.github.com/users/tylersmalley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tylersmalley/subscriptions","organizations_url":"https://api.github.com/users/tylersmalley/orgs","repos_url":"https://api.github.com/users/tylersmalley/repos","events_url":"https://api.github.com/users/tylersmalley/events{/privacy}","received_events_url":"https://api.github.com/users/tylersmalley/received_events","type":"User","site_admin":false},"assignees":[{"login":"tylersmalley","id":40265,"avatar_url":"https://avatars.githubusercontent.com/u/40265?v=3","gravatar_id":"","url":"https://api.github.com/users/tylersmalley","html_url":"https://github.com/tylersmalley","followers_url":"https://api.github.com/users/tylersmalley/followers","following_url":"https://api.github.com/users/tylersmalley/following{/other_user}","gists_url":"https://api.github.com/users/tylersmalley/gists{/gist_id}","starred_url":"https://api.github.com/users/tylersmalley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tylersmalley/subscriptions","organizations_url":"https://api.github.com/users/tylersmalley/orgs","repos_url":"https://api.github.com/users/tylersmalley/repos","events_url":"https://api.github.com/users/tylersmalley/events{/privacy}","received_events_url":"https://api.github.com/users/tylersmalley/received_events","type":"User","site_admin":false},{"login":"epixa","id":53814,"avatar_url":"https://avatars.githubusercontent.com/u/53814?v=3","gravatar_id":"","url":"https://api.github.com/users/epixa","html_url":"https://github.com/epixa","followers_url":"https://api.github.com/users/epixa/followers","following_url":"https://api.github.com/users/epixa/following{/other_user}","gists_url":"https://api.github.com/users/epixa/gists{/gist_id}","starred_url":"https://api.github.com/users/epixa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/epixa/subscriptions","organizations_url":"https://api.github.com/users/epixa/orgs","repos_url":"https://api.github.com/users/epixa/repos","events_url":"https://api.github.com/users/epixa/events{/privacy}","received_events_url":"https://api.github.com/users/epixa/received_events","type":"User","site_admin":false}],"milestone":null,"comments":4,"created_at":"2016-12-09T20:56:22Z","updated_at":"2016-12-09T21:18:54Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/elastic/kibana/pulls/9433","html_url":"https://github.com/elastic/kibana/pull/9433","diff_url":"https://github.com/elastic/kibana/pull/9433.diff","patch_url":"https://github.com/elastic/kibana/pull/9433.patch"},"body":"At the moment, Console understands HTTP methods, URLs and JSON. However ES has long had the  options to write inline scripts in its API and with the introduction of painless inline scripts become more and more popular. Sadly, writing them in JSON is a PITA as you must escape every single thing.\r\n\r\nThis PR adds the notion of literal strings to Console's flavor of JSON. This means that everything that is surrounded with `\"\"\"` will be JSON escaped before sending to ES. On top of that, if a literal string is found after `\"script\"` or `\"inline\"` tag it is treated as a script literal, which adds syntax highlighting and some Ace goodness. Script literal are a full blown Ace Mode, meaning we can extend it to do auto complete and similar in the future. Also, auto formatting works as well, automatically taking strings with more than 2 escaped characters and converting them literal strings. In similar fashion, the output pane also auto converts strings in the output.\r\n\r\nThis is how it all looks:\r\n\r\n### Script literal:\r\n\r\n![image](https://cloud.githubusercontent.com/assets/1006375/21064154/a0e6d318-be59-11e6-9b34-8325325fef4b.png)\r\n\r\n### String literals as fields in documents:\r\n\r\n![image](https://cloud.githubusercontent.com/assets/1006375/21064286/49fa065a-be5a-11e6-8abe-4d6949bbdbee.png)\r\n\r\nTo illustrate what happens when things are sent to ES, here is the Copy as Curl output of the last document:\r\n\r\n```\r\ncurl -XPUT \"http://localhost:9200/hockey/player/test\" -d'\r\n{\r\n  \"name\": \"player1\",\r\n  \"description\": \"  some long and explicit text with new lines, \\\\slashes\\\\ and\\n  {crazy} brackets :/\",\r\n  \"field_chars\": \"\"\"/regex/g\"\"\"\r\n}'\r\n```\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/elastic/kibana/issues/comments/266126104","html_url":"https://github.com/elastic/kibana/pull/9433#issuecomment-266126104","issue_url":"https://api.github.com/repos/elastic/kibana/issues/9433","id":266126104,"user":{"login":"nik9000","id":215970,"avatar_url":"https://avatars.githubusercontent.com/u/215970?v=3","gravatar_id":"","url":"https://api.github.com/users/nik9000","html_url":"https://github.com/nik9000","followers_url":"https://api.github.com/users/nik9000/followers","following_url":"https://api.github.com/users/nik9000/following{/other_user}","gists_url":"https://api.github.com/users/nik9000/gists{/gist_id}","starred_url":"https://api.github.com/users/nik9000/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nik9000/subscriptions","organizations_url":"https://api.github.com/users/nik9000/orgs","repos_url":"https://api.github.com/users/nik9000/repos","events_url":"https://api.github.com/users/nik9000/events{/privacy}","received_events_url":"https://api.github.com/users/nik9000/received_events","type":"User","site_admin":false},"created_at":"2016-12-09T21:18:54Z","updated_at":"2016-12-09T21:18:54Z","body":"`float` and `double` and `char` are all missing primitives. That list I pasted above is really just \"syntax\". `null` and `true` and `false` are also in the list, just hiding below."}}
{"actor":{"display_login":"nik9000"}}