diff --git a/AUTHORS.en.txt b/AUTHORS.en.txt index 4ae292c2ef..66c01014cb 100644 --- a/AUTHORS.en.txt +++ b/AUTHORS.en.txt @@ -272,3 +272,4 @@ Contributors: - Antoine Boisier-Michaud - Alejandro Isaza - Laurent Voullemier +- Thiago Souza diff --git a/CHANGES.md b/CHANGES.md index 0c924be0f6..fe63538fe2 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -25,6 +25,10 @@ Improvements: ## Version 9.13.1 +New languages: + +- *Kibana* by [Thiago Souza][] + Improvements: - *C#* function declarations no longer include trailing whitespace, by [JeremyTCD][] @@ -38,6 +42,7 @@ Improvements: [Melissa Geels]: https://github.com/codecat [Antoine Boisier-Michaud]: https://github.com/Aboisier [Alejandro Isaza]: https://github.com/alejandro-isaza +[Thiago Souza]: https://github.com/tsouza ## Version 9.13.0 diff --git a/src/languages/kibana.js b/src/languages/kibana.js new file mode 100644 index 0000000000..63d80a6f7d --- /dev/null +++ b/src/languages/kibana.js @@ -0,0 +1,29 @@ +/* +Language: Kibana +Author: Thiago Souza +Requires: json.js +Description: Kibana Dev Tools syntax used to interact with Elasticsearch +Category: common, protocols +*/ + +function(hljs) { + return { + aliases: ['es', 'elasticsearch', 'elastic'], + case_insensitive: false, + contains: [ + { + beginKeywords: 'GET HEAD PUT POST DELETE PATCH', end: '$', + contains: [ + { + className: 'title', + begin: '/?.+' + } + ] + }, + { + begin: '^{$', end: '^}$', + subLanguage: 'json' + } + ] + }; +} \ No newline at end of file diff --git a/test/detect/kibana/default.txt b/test/detect/kibana/default.txt new file mode 100644 index 0000000000..eb00f17cdf --- /dev/null +++ b/test/detect/kibana/default.txt @@ -0,0 +1,12 @@ +GET _search?q=some text + +POST /logstash-*/_search +{ + "size": 100, + "query": { "match_all": {} }, + "aggs": { + "price_avg": { + "avg": { "field": "price" } + } + } +} \ No newline at end of file diff --git a/test/markup/kibana/multiple.expect.txt b/test/markup/kibana/multiple.expect.txt new file mode 100644 index 0000000000..1926a9c822 --- /dev/null +++ b/test/markup/kibana/multiple.expect.txt @@ -0,0 +1,12 @@ +GET _search?q=some text + +POST /logstash-*/_search +{ + "size": 100, + "query": { "match_all": {} }, + "aggs": { + "price_avg": { + "avg": { "field": "price" } + } + } +} \ No newline at end of file diff --git a/test/markup/kibana/multiple.txt b/test/markup/kibana/multiple.txt new file mode 100644 index 0000000000..eb00f17cdf --- /dev/null +++ b/test/markup/kibana/multiple.txt @@ -0,0 +1,12 @@ +GET _search?q=some text + +POST /logstash-*/_search +{ + "size": 100, + "query": { "match_all": {} }, + "aggs": { + "price_avg": { + "avg": { "field": "price" } + } + } +} \ No newline at end of file diff --git a/test/markup/kibana/single.expect.txt b/test/markup/kibana/single.expect.txt new file mode 100644 index 0000000000..5efaa77bec --- /dev/null +++ b/test/markup/kibana/single.expect.txt @@ -0,0 +1 @@ +GET _search?q=some text \ No newline at end of file diff --git a/test/markup/kibana/single.txt b/test/markup/kibana/single.txt new file mode 100644 index 0000000000..4816ee5a2f --- /dev/null +++ b/test/markup/kibana/single.txt @@ -0,0 +1 @@ +GET _search?q=some text \ No newline at end of file