How to calculate Net Promoter Score and display in Kibana?

(Rob) #1

Is there a way I can calculate and display NPS in Kibana?

I can see that I can add scripted fields that allow me to manipulate the value from a single document field, but is there a way to display the result of a calculation based on the results from multiple queries? I have a feeling that this can only be done by building a Kibana plugin?

For example, if I have a field (call it score) can I calculate a result based on all scores from 3 queries:


Query 1 - Count all scores in date range
Query 2 - Count all scores > 8 in date range
Query 3 - Count all scores < 7 in date range

Display result of:

(query 2 * 100 / query 1) - (query 3 * 100 / query 1)

If this does require a plugin then let me know if you're available to write one for me!


(Joe Fleming) #2

We don't currently have a way to combine multiple queries together, so I can't think of a way to make this happen without writing a plugin.

There's a plugin generator available to help you get started with that, if it's something you do want to take on.

(Rob) #3

Hi Joe,

Thanks for taking the time to respond.

I know my way around Ember but have no experience of Angular. I'm probably going to need to find a freelance dev to help. do you know anybody? It's a simple plugin so hopefully should not take much effort.



(Joe Fleming) #4

If you were able to pick up Ember, you should also be able to pick up Angular. Between the generator and all the code in Kibana, you've got a ton of examples to work with, and the core devs, as well as some very experienced and helpful community members, are in the IRC channel (#kibana on freenode) to answer questions as well. Assuming you've got the time, of course.

(Rob) #5

Hi Joe,

Thanks again for responding.

Yes, time is the issue! I think I'm going to have to take the plunge though as there are quite a few changes that will be required to support the new functionality that I need.



(Rob) #6

Hi Joe,

OK, tried to install kibana 4.2 and 4.3 dev environment (mac with node v0.12.7). Kibana starts without issue but I get a whole load of CSS errors - looks like less is not being compiled.

Is this similar to the issue you have raised here:

Any hints as to what I'm doing wrong? Can you recommend best forum to go to to get help with this?

Here's the first of many errors that I see:

ERROR in ./src/ui/public/styles/dark-variables.less Module build failed: ModuleBuildError: Module build failed: URIError: URI malformed at decodeURIComponent (native) at /Users/rbennett/kibana/node_modules/autoprefixer-loader/node_modules/loader-utils/index.js:101:12 at Array.forEach (native) at Object.parseQuery (/Users/rbennett/kibana/node_modules/autoprefixer-loader/node_modules/loader-utils/index.js:78:12) at Object.module.exports (/Users/rbennett/kibana/node_modules/autoprefixer-loader/index.js:12:30) at DependenciesBlock.onModuleBuildFailed (/Users/rbennett/kibana/node_modules/webpack/node_modules/webpack-core/lib/NormalModuleMixin.js:315:19) at nextLoader (/Users/rbennett/kibana/node_modules/webpack/node_modules/webpack-core/lib/NormalModuleMixin.js:270:31) at /Users/rbennett/kibana/node_modules/webpack/node_modules/webpack-core/lib/NormalModuleMixin.js:292:15 at runSyncOrAsync (/Users/rbennett/kibana/node_modules/webpack/node_modules/webpack-core/lib/NormalModuleMixin.js:173:4) at nextLoader (/Users/rbennett/kibana/node_modules/webpack/node_modules/webpack-core/lib/NormalModuleMixin.js:290:3) at /Users/rbennett/kibana/node_modules/webpack/node_modules/webpack-core/lib/NormalModuleMixin.js:292:15 at context.callback (/Users/rbennett/kibana/node_modules/webpack/node_modules/webpack-core/lib/NormalModuleMixin.js:148:14) at /Users/rbennett/kibana/node_modules/less-loader/index.js:80:3 at /Users/rbennett/kibana/node_modules/less/lib/less/render.js:35:17 at /Users/rbennett/kibana/node_modules/less/lib/less/parse.js:63:17 at Object.finish [as _finish] (/Users/rbennett/kibana/node_modules/less/lib/less/parser/parser.js:183:28) at Object.ImportVisitor._onSequencerEmpty (/Users/rbennett/kibana/node_modules/less/lib/less/visitors/import-visitor.js:35:14) at ImportSequencer.tryRun (/Users/rbennett/kibana/node_modules/less/lib/less/visitors/import-sequencer.js:50:14) at (/Users/rbennett/kibana/node_modules/less/lib/less/visitors/import-visitor.js:29:25) at Object.Parser.parse (/Users/rbennett/kibana/node_modules/less/lib/less/parser/parser.js:189:22) at Object.parse (/Users/rbennett/kibana/node_modules/less/lib/less/parse.js:61:18) @ ./optimize/bundles/kibana.entry.js 70:0-40

(Juan Ignacio Carniglia) #7

You don't really need the dev environment, you can also build a new plugin and test it on a non-dwv setup.

Anyway, I could work on your plugin. I have developed a number of them (check to see them).

Let me know

(Rob) #8

Hi Juan,

Thanks - I've sent an email to your j*********** address as found on Github.

(system) #9