Skip to content

Commit

Permalink
6.0.0 support
Browse files Browse the repository at this point in the history
  • Loading branch information
Jason Greenberg authored and Jason Greenberg committed Nov 18, 2017
1 parent 446af7b commit 9733dd5
Show file tree
Hide file tree
Showing 16 changed files with 3,695 additions and 250 deletions.
5 changes: 5 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
* Nov 17 2017
* Versions
* 6.0.0
* Changes
* Total re-org for new visualization framework
* Nov 16 2017
* Versions
* 5.6.4
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ A Kibana visualization plugin that allows arbitrary query results to be processe
* [An example with Pre-processing](#an-example-with-pre-processing)
* [Debugging](#debugging)

Installation for Kibana 5.6.4:
Installation for Kibana 5.5.0:

```
bin/kibana-plugin install https://github.com/PhaedrusTheGreek/transform_vis/releases/download/5.6.4/transform_vis-5.6.4.zip
bin/kibana-plugin install https://github.com/PhaedrusTheGreek/transform_vis/releases/download/5.5.0/transform_vis-5.5.0.zip
```


Expand Down
14 changes: 10 additions & 4 deletions TESTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,16 @@ Result:
PUT /_bulk
{"index":{"_index":"test","_type":"doc"}}
{"test":1}
{"index":{"_index":".kibana","_type":"visualization","_id":"736d0290-2371-11e7-be0c-1bb0fbe2c940"}}
{"title":"Test #2 (Javascript Eval Security)","visState":"{\"title\":\"Test #2 (Javascript Eval Security)\",\"type\":\"transform\",\"params\":{\"outputs\":{\"formula\":\"\\n<hr>\\n{{meta.hello_world}}\\n<hr>\",\"indexpattern\":\"test\",\"meta\":\"({\\n hello_world: function() {\\n return \\\"Hello World\\\";\\n }\\n})\",\"querydsl\":\"{\\n \\\"query\\\": {\\n \\\"bool\\\": {\\n \\\"must\\\": [\\n \\\"_DASHBOARD_CONTEXT_\\\"\\n ]\\n }\\n }\\n}\"}},\"aggs\":[],\"listeners\":{}}","uiStateJSON":"{}","description":"","version":1,"kibanaSavedObjectMeta":{"searchSourceJSON":"{\"query\":{\"query_string\":{\"query\":\"*\"}},\"filter\":[],\"index\":\"test\"}"}}
{"index":{"_index":".kibana","_type":"visualization","_id":"3c633260-2371-11e7-be0c-1bb0fbe2c940"}}
{"title":"Test #1 (Style Tags Security)","visState":"{\"title\":\"Test #1 (Style Tags Security)\",\"type\":\"transform\",\"params\":{\"outputs\":{\"formula\":\"<style>\\n .myfont {\\n font-size: 40px;\\n }\\n</style>\\n\\n<hr>\\n<div class=\\\"myfont\\\">My Text</div>\\n<hr>\",\"indexpattern\":\"test\",\"meta\":\"({\\n count_hits: function() {\\n return this.response.hits.total;\\n }\\n})\",\"querydsl\":\"{\\n \\\"query\\\": {\\n \\\"bool\\\": {\\n \\\"must\\\": [\\n \\\"_DASHBOARD_CONTEXT_\\\"\\n ]\\n }\\n }\\n}\"}},\"aggs\":[],\"listeners\":{}}","uiStateJSON":"{}","description":"","version":1,"kibanaSavedObjectMeta":{"searchSourceJSON":"{\"query\":{\"query_string\":{\"query\":\"*\"}},\"filter\":[],\"index\":\"test\"}"}}
{"index":{"_index":".kibana","_type":"doc","_id":"index-pattern:de98ba40-cc5f-11e7-aadb-7b129851f054"}}
{"type":"index-pattern","index-pattern":{"title":"test","fields":"[{\"name\":\"_id\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":false},{\"name\":\"_index\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":false},{\"name\":\"_score\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"searchable\":false,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"_source\",\"type\":\"_source\",\"count\":0,\"scripted\":false,\"searchable\":false,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"_type\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":false},{\"name\":\"test\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true}]"}}
{"index":{"_index":".kibana","_type":"doc","_id":"visualization:12d5aed0-cc60-11e7-aadb-7b129851f054"}}
{"type":"visualization","visualization":{"title":"Style Tags Test","visState":"{\"title\":\"Style Tags Test\",\"type\":\"transform\",\"params\":{\"meta\":\"({\\n count_hits: function() {\\n return this.response.hits.total;\\n }\\n})\",\"querydsl\":\"{\\n \\\"query\\\": {\\n \\\"bool\\\": {\\n \\\"must\\\": [\\n \\\"_DASHBOARD_CONTEXT_\\\"\\n ]\\n }\\n }\\n}\",\"formula\":\"<style>\\n .myfont {\\n font-size: 40px;\\n }\\n</style>\\n\\n<hr>\\n<div class=\\\"myfont\\\">My Text</div>\\n<hr>\",\"indexpattern\":\"de98ba40-cc5f-11e7-aadb-7b129851f054\"},\"aggs\":[]}","uiStateJSON":"{}","description":"","version":1,"kibanaSavedObjectMeta":{"searchSourceJSON":"{}"}}}
{"index":{"_index":".kibana","_type":"doc","_id":"visualization:248ac390-cc60-11e7-aadb-7b129851f054"}}
{"type":"visualization","visualization":{"title":"Javascript Test","visState":"{\"title\":\"Javascript Test\",\"type\":\"transform\",\"params\":{\"meta\":\"({\\n hello_world: function() {\\n return \\\"Hello World!\\\";\\n }\\n})\",\"querydsl\":\"{\\n \\\"query\\\": {\\n \\\"bool\\\": {\\n \\\"must\\\": [\\n \\\"_DASHBOARD_CONTEXT_\\\"\\n ]\\n }\\n }\\n}\",\"formula\":\"<hr>\\n{{meta.hello_world}}\\n<hr>\",\"indexpattern\":\"de98ba40-cc5f-11e7-aadb-7b129851f054\"},\"aggs\":[]}","uiStateJSON":"{}","description":"","version":1,"kibanaSavedObjectMeta":{"searchSourceJSON":"{}"}}}
{"index":{"_index":".kibana","_type":"doc","_id":"index-pattern:80812210-cc61-11e7-8949-83d23621e0bf"}}
{"type":"index-pattern","index-pattern":{"title":"test-filters","timeFieldName":"@datetime","fields":"[{\"name\":\"@datetime\",\"type\":\"date\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"_id\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":false},{\"name\":\"_index\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":false},{\"name\":\"_score\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"searchable\":false,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"_source\",\"type\":\"_source\",\"count\":0,\"scripted\":false,\"searchable\":false,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"_type\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":false},{\"name\":\"colour\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"colour.keyword\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true}]"}}
{"index":{"_index":".kibana","_type":"doc","_id":"visualization:bab222e0-cc61-11e7-8949-83d23621e0bf"}}
{"type":"visualization","visualization":{"title":"Filters Test","visState":"{\"title\":\"Filters Test\",\"type\":\"transform\",\"params\":{\"meta\":\"({\\n count_hits: function() {\\n return this.response.hits.total;\\n }\\n})\",\"querydsl\":\"{\\n \\\"query\\\": {\\n \\\"bool\\\": {\\n \\\"must\\\": [\\n \\\"_DASHBOARD_CONTEXT_\\\"\\n ]\\n }\\n }\\n}\",\"formula\":\"<hr>\\n{{meta.count_hits}}\\n<hr>\",\"indexpattern\":\"80812210-cc61-11e7-8949-83d23621e0bf\"},\"aggs\":[]}","uiStateJSON":"{}","description":"","version":1,"kibanaSavedObjectMeta":{"searchSourceJSON":"{}"}}}
```

Create an index pattern called `test` and point it at the test index
13 changes: 3 additions & 10 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,30 +1,23 @@
import { resolve } from 'path';

var allow_unsafe = false;

export default function (kibana) {

return new kibana.Plugin({
require: ['elasticsearch'],
name: 'transform_vis',

uiExports: {
visTypes: [
'plugins/transform_vis/transform_vis'
'plugins/transform_vis/transform_vis'
],
injectDefaultVars(server, options) {
return {
transformVisOptions: options
};
}
},

config(Joi) {
return Joi.object({
enabled: Joi.boolean().default(true),
allow_unsafe: Joi.boolean().default(false)
}).default();
},


});
};
}
Loading

0 comments on commit 9733dd5

Please sign in to comment.