This panel has been removed and replaced with the new topN query type. Click the colored dot associated with a query to configure the, much improved, equivilent of a derived query.
--------------------------------------------------------------------------------
/src/vendor/bootstrap/less/responsive-768px-979px.less:
--------------------------------------------------------------------------------
1 | //
2 | // Responsive: Tablet to desktop
3 | // --------------------------------------------------
4 |
5 |
6 | @media (min-width: 768px) and (max-width: 979px) {
7 |
8 | // Fixed grid
9 | #grid > .core(@gridColumnWidth768, @gridGutterWidth768);
10 |
11 | // Fluid grid
12 | #grid > .fluid(@fluidGridColumnWidth768, @fluidGridGutterWidth768);
13 |
14 | // Input grid
15 | #grid > .input(@gridColumnWidth768, @gridGutterWidth768);
16 |
17 | // No need to reset .thumbnails here since it's the same @gridGutterWidth
18 |
19 | }
20 |
--------------------------------------------------------------------------------
/LICENSE.md:
--------------------------------------------------------------------------------
1 | Copyright 2012-2013 Elasticsearch BV
2 |
3 | Licensed under the Apache License, Version 2.0 (the "License"); you
4 | may not use this file except in compliance with the License. You may
5 | obtain a copy of the License at
6 |
7 | http://www.apache.org/licenses/LICENSE-2.0
8 |
9 | Unless required by applicable law or agreed to in writing, software
10 | distributed under the License is distributed on an "AS IS" BASIS,
11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
12 | implied. See the License for the specific language governing
13 | permissions and limitations under the License.
14 |
--------------------------------------------------------------------------------
/docs/index.asciidoc:
--------------------------------------------------------------------------------
1 | = Kibana
2 |
3 | == Introduction
4 |
5 | Kibana is an open source (Apache Licensed), browser based analytics and search dashboard for
6 | ElasticSearch. Kibana is a snap to setup and start using. Written entirely in HTML and Javascript
7 | it requires only a plain webserver, Kibana requires no fancy server side components.
8 | Kibana strives to be easy to get started with, while also being flexible and powerful, just like
9 | Elasticsearch.
10 |
11 | include::./tutorials/tutorials.asciidoc[]
12 |
13 | include::./kibana/configuration/config.js.asciidoc[]
14 |
15 | include::./kibana/panels.asciidoc[]
--------------------------------------------------------------------------------
/src/app/panels/query/help/regex.html:
--------------------------------------------------------------------------------
1 | The regex query allows you to use regular expressions to match terms in the _all field.
2 |
3 | A detailed overview of lucene's regex engine is available here: Regular expressions in Elasticsearch
4 |
5 |
A note on anchoring
6 | Lucene’s patterns are always anchored. The pattern provided must match the entire string. For string "abcde":
7 |
8 | ab.* will match
9 | abcd will not match
10 |
11 |
--------------------------------------------------------------------------------
/src/app/panels/query/editors/topN.html:
--------------------------------------------------------------------------------
1 |
11 |
--------------------------------------------------------------------------------
/kbnauth/cpanfile:
--------------------------------------------------------------------------------
1 | requires "perl", "5.10.0";
2 | requires "Digest::SHA";
3 | requires "Mojolicious";
4 | requires "Authen::Simple";
5 | requires "Authen::Simple::Passwd";
6 | requires "Authen::Simple::ActiveDirectory";
7 | requires "Authen::Simple::CDBI";
8 | requires "Authen::Simple::DBI";
9 | requires "Authen::Simple::FTP";
10 | requires "Authen::Simple::HTTP";
11 | requires "Authen::Simple::Kerberos";
12 | requires "Authen::Simple::LDAP";
13 | requires "Authen::Simple::NIS";
14 | requires "Authen::Simple::PAM";
15 | requires "Authen::Simple::POP3";
16 | requires "Authen::Simple::RADIUS";
17 | requires "Authen::Simple::SMTP";
18 | requires "Authen::Simple::SSH";
19 |
20 | #feature "smb", "authen for smb" => sub {
21 | # requires "Authen::Smb";
22 | # requires "Authen::Simple::SMB";
23 | #};
24 |
25 |
--------------------------------------------------------------------------------
/src/vendor/require/css.js:
--------------------------------------------------------------------------------
1 | /** `css` is a requirejs plugin
2 | that loads a css file and inject it into a page.
3 | note that this loader will return immediately,
4 | regardless of whether the browser had finished parsing the stylesheet.
5 | this css loader is implemented for file optimization and depedency managment
6 | */
7 |
8 | define({
9 | load: function (name, require, load, config) {
10 | function inject(filename)
11 | {
12 | var head = document.getElementsByTagName('head')[0];
13 | var link = document.createElement('link');
14 | link.href = filename;
15 | link.rel = 'stylesheet';
16 | link.type = 'text/css';
17 | head.appendChild(link);
18 | }
19 | inject(requirejs.toUrl(name));
20 | load(true);
21 | },
22 | pluginBuilder: '../vendor/require/css-build'
23 | });
24 |
--------------------------------------------------------------------------------
/src/vendor/bootstrap/less/close.less:
--------------------------------------------------------------------------------
1 | //
2 | // Close icons
3 | // --------------------------------------------------
4 |
5 |
6 | .close {
7 | float: right;
8 | font-size: 20px;
9 | font-weight: bold;
10 | line-height: @baseLineHeight;
11 | color: @black;
12 | text-shadow: 0 1px 0 rgba(255,255,255,1);
13 | .opacity(20);
14 | &:hover,
15 | &:focus {
16 | color: @black;
17 | text-decoration: none;
18 | cursor: pointer;
19 | .opacity(40);
20 | }
21 | }
22 |
23 | // Additional properties for button version
24 | // iOS requires the button element instead of an anchor tag.
25 | // If you want the anchor version, it requires `href="#"`.
26 | button.close {
27 | padding: 0;
28 | cursor: pointer;
29 | background: transparent;
30 | border: 0;
31 | -webkit-appearance: none;
32 | }
--------------------------------------------------------------------------------
/src/vendor/bootstrap/less/accordion.less:
--------------------------------------------------------------------------------
1 | //
2 | // Accordion
3 | // --------------------------------------------------
4 |
5 |
6 | // Parent container
7 | .accordion {
8 | margin-bottom: @baseLineHeight;
9 | }
10 |
11 | // Group == heading + body
12 | .accordion-group {
13 | margin-bottom: 2px;
14 | border: 1px solid #e5e5e5;
15 | .border-radius(@baseBorderRadius);
16 | }
17 | .accordion-heading {
18 | border-bottom: 0;
19 | }
20 | .accordion-heading .accordion-toggle {
21 | display: block;
22 | padding: 8px 15px;
23 | }
24 |
25 | // General toggle styles
26 | .accordion-toggle {
27 | cursor: pointer;
28 | }
29 |
30 | // Inner needs the styles because you can't animate properly with any styles on the element
31 | .accordion-inner {
32 | padding: 9px 15px;
33 | border-top: 1px solid #e5e5e5;
34 | }
35 |
--------------------------------------------------------------------------------
/docs/kibana/panels/goal.asciidoc:
--------------------------------------------------------------------------------
1 |
2 | == Goal
3 | Status: *Stable*
4 |
5 | The goal panel display progress towards a fixed goal on a pie chart
6 |
7 |
8 | === Parameters
9 | donut:: Draw a hole in the middle of the pie, creating a tasty donut.
10 | tilt:: Tilt the pie back into an oval shape
11 | legend:: The location of the legend, above, below or none
12 | labels:: Set to false to disable drawing labels inside the pie slices
13 | spyable:: Set to false to disable the inspect function.
14 |
15 | ==== Query
16 |
17 | query object::
18 | query.goal::: the fixed goal for goal mode
19 |
20 | ==== Queries
21 |
22 | queries object:: This object describes the queries to use on this panel.
23 | queries.mode::: Of the queries available, which to use. Options: +all, pinned, unpinned, selected+
24 | queries.ids::: In +selected+ mode, which query ids are selected.
25 |
--------------------------------------------------------------------------------
/src/app/services/timer.js:
--------------------------------------------------------------------------------
1 | define([
2 | 'angular',
3 | 'lodash'
4 | ],
5 | function (angular, _) {
6 | 'use strict';
7 |
8 | var module = angular.module('kibana.services');
9 |
10 | module.service('timer', function($timeout) {
11 | // This service really just tracks a list of $timeout promises to give us a
12 | // method for cancelling them all when we need to
13 |
14 | var timers = [];
15 |
16 | this.register = function(promise) {
17 | timers.push(promise);
18 | return promise;
19 | };
20 |
21 | this.cancel = function(promise) {
22 | timers = _.without(timers,promise);
23 | $timeout.cancel(promise);
24 | };
25 |
26 | this.cancel_all = function() {
27 | _.each(timers, function(t){
28 | $timeout.cancel(t);
29 | });
30 | timers = [];
31 | };
32 | });
33 |
34 | });
--------------------------------------------------------------------------------
/src/app/directives/arrayJoin.js:
--------------------------------------------------------------------------------
1 | define([
2 | 'angular',
3 | 'app',
4 | 'lodash'
5 | ],
6 | function (angular, app, _) {
7 | 'use strict';
8 |
9 | angular
10 | .module('kibana.directives')
11 | .directive('arrayJoin', function() {
12 | return {
13 | restrict: 'A',
14 | require: 'ngModel',
15 | link: function(scope, element, attr, ngModel) {
16 |
17 | function split_array(text) {
18 | return (text || '').split(',');
19 | }
20 |
21 | function join_array(text) {
22 | if(_.isArray(text)) {
23 | return (text || '').join(',');
24 | } else {
25 | return text;
26 | }
27 | }
28 |
29 | ngModel.$parsers.push(split_array);
30 | ngModel.$formatters.push(join_array);
31 | }
32 | };
33 | });
34 | });
35 |
--------------------------------------------------------------------------------
/src/app/panels/goal/module.html:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 | {{query.label}} ({{query.data[0][1]}})
7 |
8 |
9 |
10 |
11 |
12 |
13 | {{query.label}} ({{query.data[0][1]}})
14 |
15 |
--------------------------------------------------------------------------------
/sample/lighttpd_basic.conf:
--------------------------------------------------------------------------------
1 | $HTTP["host"] =~ "kibana" {
2 |
3 | server.document-root = "/var/ww/kibana/src"
4 | auth.backend = "plain"
5 | auth.backend.plain.userfile = "/etc/lighttpd/kibanapassword"
6 |
7 | index-file.names = ( "index.html", "index.htm" )
8 |
9 | auth.require = ( "/" => (
10 | "method" => "basic",
11 | "realm" => "Password Protected",
12 | "require" => "valid-user"
13 | )
14 | )
15 |
16 | $HTTP["url"] =~ "^/kibana-int/(dashboard/|temp).*$" {
17 | proxy.balance = "hash"
18 | proxy.server = ( "" => ( ( "host" => "127.0.0.1", "port" => "9200" ) ) )
19 | }
20 | $HTTP["url"] =~ "^.*/_(mapping|search|nodes|aliases)$" {
21 | proxy.balance = "hash"
22 | proxy.server = ( "" => ( ( "host" => "127.0.0.1", "port" => "9200" ) ) )
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/docs/kibana/panels/map.asciidoc:
--------------------------------------------------------------------------------
1 |
2 | == Map
3 | Status: *Stable*
4 |
5 | The map panel translates 2 letter country or state codes into shaded regions on a map. Currently
6 | available maps are world, usa and europe.
7 |
8 |
9 | === Parameters
10 |
11 | map:: Map to display. world, usa, europe
12 | colors:: An array of colors to use to shade the map. If 2 colors are specified, shades
13 | between them will be used. For example [`#A0E2E2', `#265656']
14 | size:: Max number of regions to shade
15 | exclude:: exclude this array of regions. For example [`US',`BR',`IN']
16 | spyable:: Setting spyable to false disables the inspect icon.
17 |
18 | ==== Queries
19 | queries object:: This object describes the queries to use on this panel.
20 | queries.mode::: Of the queries available, which to use. Options: +all, pinned, unpinned, selected+
21 | queries.ids::: In +selected+ mode, which query ids are selected.
22 |
--------------------------------------------------------------------------------
/tasks/distribute_task.js:
--------------------------------------------------------------------------------
1 | module.exports = function(grunt) {
2 |
3 | // build, then zip and upload to s3
4 | grunt.registerTask('distribute', [
5 | 'distribute:load_s3_config',
6 | 'build',
7 | 'compress:zip',
8 | 'compress:tgz',
9 | 's3:dist',
10 | 'clean:temp'
11 | ]);
12 |
13 | // build, then zip and upload to s3
14 | grunt.registerTask('release', [
15 | 'distribute:load_s3_config',
16 | 'build',
17 | 'compress:zip_release',
18 | 'compress:tgz_release',
19 | 's3:release',
20 | 'clean:temp'
21 | ]);
22 |
23 | // collect the key and secret from the .aws-config.json file, finish configuring the s3 task
24 | grunt.registerTask('distribute:load_s3_config', function () {
25 | var config = grunt.file.readJSON('.aws-config.json');
26 | grunt.config('s3.options', {
27 | key: config.key,
28 | secret: config.secret
29 | });
30 | });
31 | }
--------------------------------------------------------------------------------
/src/app/components/lodash.extended.js:
--------------------------------------------------------------------------------
1 | define([
2 | 'lodash-src'
3 | ],
4 | function (_) {
5 | 'use strict';
6 |
7 | /*
8 | Mixins :)
9 | */
10 | _.mixin({
11 | move: function (array, fromIndex, toIndex) {
12 | array.splice(toIndex, 0, array.splice(fromIndex, 1)[0] );
13 | return array;
14 | },
15 | remove: function (array, index) {
16 | array.splice(index, 1);
17 | return array;
18 | },
19 | // If variable is value, then return alt. If variable is anything else, return value;
20 | toggle: function (variable, value, alt) {
21 | return variable === value ? alt : value;
22 | },
23 | toggleInOut: function(array,value) {
24 | if(_.contains(array,value)) {
25 | array = _.without(array,value);
26 | } else {
27 | array.push(value);
28 | }
29 | return array;
30 | }
31 | });
32 |
33 | return _;
34 | });
35 |
--------------------------------------------------------------------------------
/src/app/panels/fields/module.js:
--------------------------------------------------------------------------------
1 | /*
2 | ## Fields (DEPRECATED)
3 | */
4 | define([
5 | 'angular',
6 | 'app',
7 | 'lodash'
8 | ],
9 | function (angular, app, _) {
10 | 'use strict';
11 |
12 | var module = angular.module('kibana.panels.fields', []);
13 | app.useModule(module);
14 |
15 | module.controller('fields', function($scope) {
16 |
17 | $scope.panelMeta = {
18 | status : "Deprecated",
19 | description : "You should not use this table, it does not work anymore. The table panel now"+
20 | "integrates a field selector. This module will soon be removed."
21 | };
22 |
23 |
24 | // Set and populate defaults
25 | var _d = {
26 | style : {},
27 | arrange : 'vertical',
28 | micropanel_position : 'right',
29 | };
30 | _.defaults($scope.panel,_d);
31 |
32 | $scope.init = function() {
33 | // Place holder until I remove this
34 | };
35 |
36 | });
37 | });
--------------------------------------------------------------------------------
/docs/kibana/panels/trends.asciidoc:
--------------------------------------------------------------------------------
1 |
2 | == trends
3 | Status: *Beta*
4 |
5 | A stock-ticker style representation of how queries are moving over time. For example, if the
6 | time is 1:10pm, your time picker was set to "Last 10m", and the "Time Ago" parameter was set to
7 | "1h", the panel would show how much the query results have changed since 12:00-12:10pm
8 |
9 |
10 | === Parameters
11 |
12 | ago:: A date math formatted string describing the relative time period to compare the
13 | queries to.
14 | arrangement:: `horizontal' or `vertical'
15 | reverse:: true or false. If true, use red for positive, green for negative
16 | spyable:: Set to false to disable the inspect icon
17 |
18 | ==== Queries
19 | queries object:: This object describes the queries to use on this panel.
20 | queries.mode::: Of the queries available, which to use. Options: +all, pinned, unpinned, selected+
21 | queries.ids::: In +selected+ mode, which query ids are selected.
22 |
--------------------------------------------------------------------------------
/src/vendor/bootstrap/less/pager.less:
--------------------------------------------------------------------------------
1 | //
2 | // Pager pagination
3 | // --------------------------------------------------
4 |
5 |
6 | .pager {
7 | margin: @baseLineHeight 0;
8 | list-style: none;
9 | text-align: center;
10 | .clearfix();
11 | }
12 | .pager li {
13 | display: inline;
14 | }
15 | .pager li > a,
16 | .pager li > span {
17 | display: inline-block;
18 | padding: 5px 14px;
19 | background-color: #fff;
20 | border: 1px solid #ddd;
21 | .border-radius(15px);
22 | }
23 | .pager li > a:hover,
24 | .pager li > a:focus {
25 | text-decoration: none;
26 | background-color: #f5f5f5;
27 | }
28 | .pager .next > a,
29 | .pager .next > span {
30 | float: right;
31 | }
32 | .pager .previous > a,
33 | .pager .previous > span {
34 | float: left;
35 | }
36 | .pager .disabled > a,
37 | .pager .disabled > a:hover,
38 | .pager .disabled > a:focus,
39 | .pager .disabled > span {
40 | color: @grayLight;
41 | background-color: #fff;
42 | cursor: default;
43 | }
--------------------------------------------------------------------------------
/tasks/options/less.js:
--------------------------------------------------------------------------------
1 | module.exports = function(config) {
2 | return {
3 | // this is the only task, other than copy, that runs on the src directory, since we don't really need
4 | // the less files in the dist. Everything else runs from on temp, and require copys everything
5 | // from temp -> dist
6 | dist:{
7 | expand: true,
8 | cwd:'<%= srcDir %>/vendor/bootstrap/less/',
9 | src: ['bootstrap.dark.less', 'bootstrap.light.less'],
10 | dest: '<%= tempDir %>/css/',
11 | },
12 | // Compile in place when not building
13 | src:{
14 | options: {
15 | paths: ["<%= srcDir %>/vendor/bootstrap/less"],
16 | yuicompress:true
17 | },
18 | files: {
19 | "<%= srcDir %>/css/bootstrap.dark.min.css": "<%= srcDir %>/vendor/bootstrap/less/bootstrap.dark.less",
20 | "<%= srcDir %>/css/bootstrap.light.min.css": "<%= srcDir %>/vendor/bootstrap/less/bootstrap.light.less"
21 | }
22 | }
23 | };
24 | };
--------------------------------------------------------------------------------
/src/app/directives/resizable.js:
--------------------------------------------------------------------------------
1 | define([
2 | 'angular',
3 | ],
4 | function (angular) {
5 | 'use strict';
6 |
7 | angular
8 | .module('kibana.directives')
9 | .directive('resizable', function() {
10 | return {
11 | restrict: 'A',
12 | link: function(scope, elem) {
13 |
14 | var getOpts = function() {
15 | return {
16 | maxWidth: elem.parent().width(),
17 | grid: elem.parent().width()/12,
18 | handles: 'e'
19 | };
20 | };
21 |
22 | // Re-render if the window is resized
23 | angular.element(window).bind('resize', function(){
24 | elem.resizable(getOpts());
25 | });
26 |
27 | elem.resizable(getOpts());
28 | elem.resize(function (event, ui) {
29 | scope.panel.span = Math.round(((ui.size.width / elem.parent().width()) * 100) * 1.2 / 10);
30 | });
31 | }
32 | };
33 | });
34 | });
35 |
--------------------------------------------------------------------------------
/src/app/panels/force/editor.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
8 |
9 |
10 |
14 |
15 |
16 |
17 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/docs/kibana/panels/hits.asciidoc:
--------------------------------------------------------------------------------
1 |
2 | == Hits
3 | Status: *Stable*
4 |
5 | The hits panel displays the number of hits for each of the queries on the dashboard in a
6 | configurable format specified by the `chart' property.
7 |
8 |
9 | === Parameters
10 |
11 | arrangement:: The arrangement of the legend. horizontal or vertical
12 | chart:: bar, pie or none
13 | counter_pos:: The position of the legend, above or below
14 | donut:: If the chart is set to pie, setting donut to true will draw a hole in the midle of it
15 | tilt:: If the chart is set to pie, setting tilt to true will tilt it back into an oval
16 | labels:: If the chart is set to pie, setting labels to true will draw labels in the slices
17 | spyable:: Setting spyable to false disables the inspect icon.
18 |
19 | ==== Queries
20 | queries object:: This object describes the queries to use on this panel.
21 | queries.mode::: Of the queries available, which to use. Options: +all, pinned, unpinned, selected+
22 | queries.ids::: In +selected+ mode, which query ids are selected.
23 |
--------------------------------------------------------------------------------
/docs/kibana/panels/sparklines.asciidoc:
--------------------------------------------------------------------------------
1 |
2 | == Sparklines
3 | Status: *Experimental*
4 |
5 | The sparklines panel shows tiny time charts. The purpose of these is not to give an exact value,
6 | but rather to show the shape of the time series in a compact manner
7 |
8 |
9 | === Parameters
10 | mode:: Value to use for the y-axis. For all modes other than count, +value_field+ must be
11 | defined. Possible values: count, mean, max, min, total.
12 | time_field:: x-axis field. This must be defined as a date type in Elasticsearch.
13 | value_field:: y-axis field if +mode+ is set to mean, max, min or total. Must be numeric.
14 | interval:: Sparkline intervals are computed automatically as long as there is a time filter
15 | present. In the absence of a time filter, use this interval.
16 | spyable:: Show inspect icon
17 |
18 | ==== Queries
19 | queries object:: This object describes the queries to use on this panel.
20 | queries.mode::: Of the queries available, which to use. Options: +all, pinned, unpinned, selected+
21 | queries.ids::: In +selected+ mode, which query ids are selected.
22 |
--------------------------------------------------------------------------------
/src/app/components/settings.js:
--------------------------------------------------------------------------------
1 | define(['lodash'],
2 | function (_) {
3 | "use strict";
4 |
5 | return function Settings (options) {
6 | /**
7 | * To add a setting, you MUST define a default. Also,
8 | * THESE ARE ONLY DEFAULTS.
9 | * They are overridden by config.js in the root directory
10 | * @type {Object}
11 | */
12 | var defaults = {
13 | elasticsearch : "http://"+window.location.hostname+":9200",
14 | api_version : "1.0",
15 | sniff : true,
16 | request_timeout : 30000,
17 | panel_names : [],
18 | kibana_index : 'kibana-int',
19 | default_route : '/dashboard/file/default.json'
20 | };
21 |
22 | // This initializes a new hash on purpose, to avoid adding parameters to
23 | // config.js without providing sane defaults
24 | var settings = {};
25 | _.each(defaults, function(value, key) {
26 | settings[key] = typeof options[key] !== 'undefined' ? options[key] : defaults[key];
27 | });
28 |
29 | return settings;
30 | };
31 | });
32 |
--------------------------------------------------------------------------------
/src/app/panels/multifieldhistogram/meta.html:
--------------------------------------------------------------------------------
1 |
38 |
39 |
--------------------------------------------------------------------------------
/src/vendor/bootstrap/less/responsive.less:
--------------------------------------------------------------------------------
1 | /*!
2 | * Bootstrap Responsive v2.3.2
3 | *
4 | * Copyright 2013 Twitter, Inc
5 | * Licensed under the Apache License v2.0
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Designed and built with all the love in the world by @mdo and @fat.
9 | */
10 |
11 |
12 | // Responsive.less
13 | // For phone and tablet devices
14 | // -------------------------------------------------------------
15 |
16 |
17 | // REPEAT VARIABLES & MIXINS
18 | // -------------------------
19 | // Required since we compile the responsive stuff separately
20 |
21 | @import "variables.less"; // Modify this for custom colors, font-sizes, etc
22 | @import "mixins.less";
23 |
24 |
25 | // RESPONSIVE CLASSES
26 | // ------------------
27 |
28 | @import "responsive-utilities.less";
29 |
30 |
31 | // MEDIA QUERIES
32 | // ------------------
33 |
34 | // Large desktops
35 | @import "responsive-1200px-min.less";
36 |
37 | // Tablets to regular desktops
38 | @import "responsive-768px-979px.less";
39 |
40 | // Phones to portrait tablets and narrow desktops
41 | @import "responsive-767px-max.less";
42 |
43 |
44 | // RESPONSIVE NAVBAR
45 | // ------------------
46 |
47 | // From 979px and below, show a button to toggle navbar contents
48 | @import "responsive-navbar.less";
49 |
--------------------------------------------------------------------------------
/sample/filtered-alias-example/generate-user-aliases.rb:
--------------------------------------------------------------------------------
1 | require 'elasticsearch'
2 | require 'hashie'
3 |
4 | # Connect to the ElasticSearch cluster
5 | client = Elasticsearch::Client.new
6 |
7 | # Get all the users and map them to an array
8 | resp = Hashie::Mash.new client.search index: "logstash-*",
9 | body: {
10 | size: 0,
11 | facets: { users: { terms: { field: 'user' } } }
12 | }
13 | users = resp.facets.users.terms.to_a.map { |f| f.term }
14 |
15 | # Get a list of all the indexes and aliases
16 | aliases = Hashie::Mash.new client.indices.get_aliases
17 | aliases.each_pair do |index,aliases|
18 | # Match the all the Logstash indexes and get the Logstash
19 | # date stamp from the index name.
20 | matches = /logstash-(\d{4}.\d{2}.\d{2})/.match index
21 | if matches
22 | # Loop through each user and check to see if the index exists
23 | # if it doesn't then create the new alias and add a term filter.
24 | users.each do |user|
25 | aliasName = "#{user}-#{matches[1]}"
26 | unless aliases.aliases[aliasName]
27 | puts "Creating alias #{aliasName} for #{index}"
28 | client.indices.put_alias index: index, name: aliasName,
29 | body: {
30 | filter: { term: { user: user } }
31 | }
32 | end
33 | end
34 | end
35 | end
36 |
--------------------------------------------------------------------------------
/tasks/build_task.js:
--------------------------------------------------------------------------------
1 | module.exports = function(grunt) {
2 |
3 | // Concat and Minify the src directory into dist
4 | grunt.registerTask('build', [
5 | 'jshint:source',
6 | 'clean:on_start',
7 | 'less:dist',
8 | 'copy:almost_everything_to_temp',
9 | 'htmlmin:build',
10 | 'cssmin:build',
11 | 'ngmin:build',
12 | 'requirejs:build',
13 | 'clean:temp',
14 | 'build:write_revision',
15 | 'uglify:dest'
16 | ]);
17 |
18 | // run a string replacement on the require config, using the latest revision number as the cache buster
19 | grunt.registerTask('build:write_revision', function() {
20 | grunt.event.once('git-describe', function (desc) {
21 | grunt.config('string-replace.config', {
22 | files: {
23 | '<%= destDir %>/app/components/require.config.js': '<%= destDir %>/app/components/require.config.js',
24 | '<%= destDir %>/app/app.js': '<%= destDir %>/app/app.js'
25 | },
26 |
27 | options: {
28 | replacements: [
29 | {
30 | pattern: /@REV@/g,
31 | replacement: grunt.config.data.pkg.version +"-"+ desc.object
32 | }
33 | ]
34 | }
35 | });
36 | grunt.task.run('string-replace:config');
37 | });
38 | grunt.task.run('git-describe');
39 | });
40 | };
--------------------------------------------------------------------------------
/src/app/panels/sparklines/editor.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
Values
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
Transform Series
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/docs/kibana/panels/bettermap.asciidoc:
--------------------------------------------------------------------------------
1 |
2 | == Bettermap
3 | Status: *Experimental*
4 |
5 | Bettermap is called bettermap for lack of a better name. Bettermap uses geographic coordinates to
6 | create clusters of markers on map and shade them orange, yellow and green depending on the
7 | density of the cluster.
8 |
9 | To drill down, click on a cluster. The map will be zoomed and the cluster broken into smaller cluster.
10 | When it no longer makes visual sense to cluster, individual markers will be displayed. Hover over
11 | a marker to see the tooltip value/
12 |
13 | IMPORTANT: bettermap requires an internet connection to download its map panels.
14 |
15 | === Parameters
16 |
17 | field:: The field that contains the coordinates, in geojson format. GeoJSON is
18 | +[longitude,latitude]+ in an array. This is different from most implementations, which use
19 | latitude, longitude.
20 | size:: The number of documents to use when drawing the map
21 | spyable:: Should the `inspect` icon be shown?
22 | tooltip:: Which field to use for the tooltip when hovering over a marker
23 |
24 | ==== Queries
25 | queries object:: This object describes the queries to use on this panel.
26 | queries.mode::: Of the queries available, which to use. Options: +all, pinned, unpinned, selected+
27 | queries.ids::: In +selected+ mode, which query ids are selected.
28 |
--------------------------------------------------------------------------------
/src/app/panels/query/help/topN.html:
--------------------------------------------------------------------------------
1 | The topN query uses an Elasticsearch terms facet to find the most common terms in a field and build queries from the result. The topN query uses LUCENE query string syntax
2 |
3 |
Parameters
4 |
5 |
6 | Field / The field to facet on. Fields with a large number of unique terms will use more memory to calculate.
7 |
8 |
9 | Count / How many queries to generate. The resulting queries will use brightness variations on the original query's color for their own.
10 |
11 |
12 | Union / The relation the generated queries have to the original. For example, if your field was set to 'extension', your original query was "user:B.Awesome" and your union was AND. Kibana might generate the following example query: extension:"html" AND (user:B.Awesome)
13 |
14 |
--------------------------------------------------------------------------------
/src/app/panels/bettermap/leaflet/leaflet.ie.css:
--------------------------------------------------------------------------------
1 | .leaflet-vml-shape {
2 | width: 1px;
3 | height: 1px;
4 | }
5 | .lvml {
6 | behavior: url(#default#VML);
7 | display: inline-block;
8 | position: absolute;
9 | }
10 |
11 | .leaflet-control {
12 | display: inline;
13 | }
14 |
15 | .leaflet-popup-tip {
16 | width: 21px;
17 | _width: 27px;
18 | margin: 0 auto;
19 | _margin-top: -3px;
20 |
21 | filter: progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678);
22 | -ms-filter: "progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678)";
23 | }
24 | .leaflet-popup-tip-container {
25 | margin-top: -1px;
26 | }
27 | .leaflet-popup-content-wrapper, .leaflet-popup-tip {
28 | border: 1px solid #999;
29 | }
30 | .leaflet-popup-content-wrapper {
31 | zoom: 1;
32 | }
33 |
34 | .leaflet-control-zoom,
35 | .leaflet-control-layers {
36 | border: 3px solid #999;
37 | }
38 | .leaflet-control-layers-toggle {
39 | }
40 | .leaflet-control-attribution,
41 | .leaflet-control-layers,
42 | .leaflet-control-scale-line {
43 | background: white;
44 | }
45 | .leaflet-zoom-box {
46 | filter: alpha(opacity=50);
47 | }
48 | .leaflet-control-attribution {
49 | border-top: 1px solid #bbb;
50 | border-left: 1px solid #bbb;
51 | }
52 |
--------------------------------------------------------------------------------
/src/app/panels/query/query.css:
--------------------------------------------------------------------------------
1 | .short-query {
2 | display:inline-block;
3 | margin-right: 10px;
4 | }
5 | .short-query input.search-query {
6 | width: 280px;
7 | }
8 | .begin-query {
9 | position:absolute;
10 | left:10px;
11 | top:5px;
12 | }
13 | .end-query {
14 | position:absolute;
15 | right:10px;
16 | top:5px;
17 | }
18 |
19 | .end-query i, .begin-query i {
20 | margin: 0px;
21 | }
22 |
23 | .panel-query {
24 | padding-left: 25px !important;
25 | height: 31px !important;
26 | -webkit-box-sizing: border-box; /* Safari/Chrome, other WebKit */
27 | -moz-box-sizing: border-box; /* Firefox, other Gecko */
28 | box-sizing: border-box; /* Opera/IE 8+ */
29 | }
30 |
31 | .query-disabled {
32 | opacity: 0.3;
33 | }
34 |
35 | .form-search:hover .has-remove {
36 | padding-left: 40px !important;
37 | }
38 | .remove-query {
39 | opacity: 0;
40 | }
41 | .last-query {
42 | padding-right: 45px !important;
43 | }
44 | .form-search:hover .remove-query {
45 | opacity: 1;
46 | }
47 | .query-panel .pinned {
48 | margin-right: 5px;
49 | }
50 |
51 | .myinput {
52 | height: 24px;
53 | background-color: #4D4D4D;
54 | border: 1px solid #666666;
55 | box-shadow: 0 1px 1px rgba(0, 0, 0, 0.075) inset;
56 | transition: border 0.2s linear 0s, box-shadow 0.2s linear 0s;
57 | color: #ADAFAE;
58 | position:relative;top:-4px;
59 | }
60 |
--------------------------------------------------------------------------------
/src/app/services/alertSrv.js:
--------------------------------------------------------------------------------
1 | define([
2 | 'angular',
3 | 'lodash'
4 | ],
5 | function (angular, _) {
6 | 'use strict';
7 |
8 | var module = angular.module('kibana.services');
9 |
10 | module.service('alertSrv', function($timeout) {
11 | var self = this;
12 |
13 | // List of all alert objects
14 | this.list = [];
15 |
16 | this.set = function(title,text,severity,timeout) {
17 | var
18 | _a = {
19 | title: title || '',
20 | text: text || '',
21 | severity: severity || 'info',
22 | },
23 | _ca = angular.toJson(_a),
24 | _clist = _.map(self.list,function(alert){return angular.toJson(alert);});
25 |
26 | // If we already have this alert, remove it and add a new one
27 | // Why do this instead of skipping the add because it resets the timer
28 | if(_.contains(_clist,_ca)) {
29 | _.remove(self.list,_.indexOf(_clist,_ca));
30 | }
31 |
32 | self.list.push(_a);
33 | if (timeout > 0) {
34 | $timeout(function() {
35 | self.list = _.without(self.list,_a);
36 | }, timeout);
37 | }
38 | return(_a);
39 | };
40 |
41 | this.clear = function(alert) {
42 | self.list = _.without(self.list,alert);
43 | };
44 |
45 | this.clearAll = function() {
46 | self.list = [];
47 | };
48 | });
49 | });
--------------------------------------------------------------------------------
/src/app/components/extend-jquery.js:
--------------------------------------------------------------------------------
1 | define(['jquery'],
2 | function ($) {
3 | 'use strict';
4 |
5 | /**
6 | * jQuery extensions
7 | */
8 | var $win = $(window);
9 |
10 | $.fn.place_tt = (function () {
11 | var defaults = {
12 | offset: 5,
13 | css: {
14 | position : 'absolute',
15 | top : -1000,
16 | left : 0,
17 | color : "#c8c8c8",
18 | padding : '10px',
19 | 'font-size': '11pt',
20 | 'font-weight' : 200,
21 | 'background-color': '#1f1f1f',
22 | 'border-radius': '5px',
23 | 'z-index': 9999
24 | }
25 | };
26 |
27 | return function (x, y, opts) {
28 | opts = $.extend(true, {}, defaults, opts);
29 | return this.each(function () {
30 | var $tooltip = $(this), width, height;
31 |
32 | $tooltip.css(opts.css);
33 | if (!$.contains(document.body, $tooltip[0])) {
34 | $tooltip.appendTo(document.body);
35 | }
36 |
37 | width = $tooltip.outerWidth(true);
38 | height = $tooltip.outerHeight(true);
39 |
40 | $tooltip.css('left', x + opts.offset + width > $win.width() ? x - opts.offset - width : x + opts.offset);
41 | $tooltip.css('top', y + opts.offset + height > $win.height() ? y - opts.offset - height : y + opts.offset);
42 | });
43 | };
44 | })();
45 |
46 | return $;
47 | });
48 |
--------------------------------------------------------------------------------
/docs/kibana/configuration/config.js.asciidoc:
--------------------------------------------------------------------------------
1 |
2 | == Configuration
3 | config.js is where you will find the core Kibana configuration. This file contains parameter that
4 | must be set before kibana is run for the first time.
5 |
6 | === Parameters
7 |
8 | ==== elasticsearch
9 |
10 | The URL to your elasticsearch server. You almost certainly don't
11 | want +http://localhost:9200+ here. Even if Kibana and Elasticsearch are on
12 | the same host. By default this will attempt to reach ES at the same host you have
13 | kibana installed on. You probably want to set it to the FQDN of your
14 | elasticsearch host
15 |
16 | ==== api_version
17 |
18 | The elasticsearch api version you want to use. This must match the version of your elasticsearch server.
19 |
20 | Valid version: 0.9, 1.0, 1.1, 1.2
21 |
22 | ==== default_route
23 |
24 | This is the default landing page when you don't specify a dashboard to load. You can specify
25 | files, scripts or saved dashboards here. For example, if you had saved a dashboard called
26 | `WebLogs' to elasticsearch you might use:
27 |
28 | default_route: '/dashboard/elasticsearch/WebLogs',
29 |
30 | ==== kibana-int
31 |
32 | The default ES index to use for storing Kibana specific object
33 | such as stored dashboards
34 |
35 | ==== panel_name
36 |
37 | An array of panel modules available. Panels will only be loaded when they are defined in the
38 | dashboard, but this list is used in the "add panel" interface.
39 |
--------------------------------------------------------------------------------
/src/vendor/bootstrap/less/thumbnails.less:
--------------------------------------------------------------------------------
1 | //
2 | // Thumbnails
3 | // --------------------------------------------------
4 |
5 |
6 | // Note: `.thumbnails` and `.thumbnails > li` are overriden in responsive files
7 |
8 | // Make wrapper ul behave like the grid
9 | .thumbnails {
10 | margin-left: -@gridGutterWidth;
11 | list-style: none;
12 | .clearfix();
13 | }
14 | // Fluid rows have no left margin
15 | .row-fluid .thumbnails {
16 | margin-left: 0;
17 | }
18 |
19 | // Float li to make thumbnails appear in a row
20 | .thumbnails > li {
21 | float: left; // Explicity set the float since we don't require .span* classes
22 | margin-bottom: @baseLineHeight;
23 | margin-left: @gridGutterWidth;
24 | }
25 |
26 | // The actual thumbnail (can be `a` or `div`)
27 | .thumbnail {
28 | display: block;
29 | padding: 4px;
30 | line-height: @baseLineHeight;
31 | border: 1px solid #ddd;
32 | .border-radius(@baseBorderRadius);
33 | .box-shadow(0 1px 3px rgba(0,0,0,.055));
34 | .transition(all .2s ease-in-out);
35 | }
36 | // Add a hover/focus state for linked versions only
37 | a.thumbnail:hover,
38 | a.thumbnail:focus {
39 | border-color: @linkColor;
40 | .box-shadow(0 1px 4px rgba(0,105,214,.25));
41 | }
42 |
43 | // Images and captions
44 | .thumbnail > img {
45 | display: block;
46 | max-width: 100%;
47 | margin-left: auto;
48 | margin-right: auto;
49 | }
50 | .thumbnail .caption {
51 | padding: 9px;
52 | color: @gray;
53 | }
54 |
--------------------------------------------------------------------------------
/kbnauth/lib/KbnAuth/Inspector/Example.pm:
--------------------------------------------------------------------------------
1 | package KbnAuth::Inspector::Example;
2 | use strict;
3 | use warnings;
4 | use Mojo::Base 'KbnAuth::Inspector';
5 |
6 | has prefix => 'logstash-mweibo-';
7 | has interval=> 5;
8 | has content => <<'EOF';
9 | {
10 | "facets": {
11 | "terms": {
12 | "terms": {
13 | "field": "jsoncontent.errmsg.raw",
14 | "size": 10,
15 | "order": "count",
16 | "exclude": []
17 | },
18 | "facet_filter": {
19 | "fquery": {
20 | "query": {
21 | "filtered": {
22 | "query": {
23 | "bool": {
24 | "should": [
25 | {
26 | "query_string": {
27 | "query": "*"
28 | }
29 | }
30 | ]
31 | }
32 | },
33 | "filter": {
34 | "bool": {
35 | "must": [
36 | {
37 | "range": {
38 | "@timestamp": {
39 | "from": 1419459071110,
40 | "to": 1419502271111
41 | }
42 | }
43 | }
44 | ]
45 | }
46 | }
47 | }
48 | }
49 | }
50 | }
51 | }
52 | },
53 | "size": 0
54 | }
55 | EOF
56 |
57 | sub determine {
58 |
59 | }
60 |
61 | 1;
62 |
--------------------------------------------------------------------------------
/test/unit/specs/lodash_extensions.js:
--------------------------------------------------------------------------------
1 | describe('Lodash mixins', function () {
2 | var _;
3 |
4 | before(function (done) {
5 | // load modules using require.js once we are ready to being
6 | require(['lodash'], function (__) {
7 | _ = __;
8 | done();
9 | });
10 | });
11 |
12 | describe('#move', function () {
13 | it('moves the specified element within the array', function() {
14 | var arr = [1,2,3];
15 | _.move(arr, 0, 1);
16 |
17 | expect(arr[0]).to.be(2);
18 | expect(arr[1]).to.be(1);
19 | });
20 | });
21 |
22 | describe('#remove', function () {
23 | it('removes an element from the array', function () {
24 | var arr = [1,2,3];
25 | _.remove(arr, 2);
26 | expect(arr).to.eql([1,2]);
27 | });
28 | });
29 |
30 | describe('#toggle', function () {
31 | it('returns either value or alt based on if the variable matches the standard value', function () {
32 | expect(_.toggle(1, 1, true)).to.be.ok();
33 | expect(_.toggle(1, 2, 1)).to.be(2);
34 | });
35 | });
36 |
37 | describe('#toggleInOut', function () {
38 | it('adds the value to an array if it is not already present', function () {
39 | var arr = _.toggleInOut([1,2,3,5,6], 4);
40 | expect(_.contains(arr, 4)).to.ok();
41 | });
42 | it('removes the value from an array if it is already present', function () {
43 | var arr = _.toggleInOut([1,2,3,4,5,6], 4);
44 | expect(_.contains(arr, 4)).to.not.be.ok();
45 | });
46 | });
47 | });
--------------------------------------------------------------------------------
/src/app/panels/derivequeries/module.js:
--------------------------------------------------------------------------------
1 | /*
2 | ## Derivequeries
3 |
4 | ### Parameters
5 | * label :: The label to stick over the field
6 | * query :: A string to use as a filter for the terms facet
7 | * field :: the field to facet on
8 | * rest :: include a filter that matches all other terms,
9 | * size :: how many queries to generate
10 | * fields :: a list of fields known to us
11 | * query_mode :: how to create query
12 |
13 | */
14 | define([
15 | 'angular',
16 | 'app',
17 | 'lodash'
18 | ],
19 | function (angular, app, _) {
20 | 'use strict';
21 |
22 | var module = angular.module('kibana.panels.derivequeries', []);
23 | app.useModule(module);
24 |
25 | module.controller('derivequeries', function($scope) {
26 | $scope.panelMeta = {
27 | status : "Deprecated",
28 | description : "This panel has been replaced with the 'topN' mode in the query pull down."
29 | };
30 |
31 | // Set and populate defaults
32 | var _d = {
33 | loading : false,
34 | label : "Search",
35 | query : "*",
36 | ids : [],
37 | field : '_type',
38 | fields : [],
39 | spyable : true,
40 | rest : false,
41 | size : 5,
42 | mode : 'terms only',
43 | exclude : [],
44 | history : [],
45 | remember: 10 // max: 100, angular strap can't take a variable for items param
46 | };
47 | _.defaults($scope.panel,_d);
48 |
49 | $scope.init = function() {
50 | $scope.editing = false;
51 | };
52 | });
53 | });
--------------------------------------------------------------------------------
/docs/kibana/panels.asciidoc:
--------------------------------------------------------------------------------
1 | [[panels]]
2 | = Panels
3 |
4 | [partintro]
5 | --
6 | *Kibana* dashboards are made up of blocks called +panels+. Panels are organized into rows
7 | and can serve many purposes, though most are designed to provide the results of a query or
8 | multiple queries as a visualization. Other panels may show collections of documents or
9 | allow you to insert instructions for your users.
10 |
11 | Panels can be configured easily via the Kibana web interface. For more advanced usage, such
12 | as templated or scripted dashboards, documentation of panel properties is available in this
13 | section. You may find settings here which are not exposed via the web interface.
14 |
15 | Each panel type has its own properties, hover there are several that are shared.
16 |
17 | span:: A number, 1-12, that describes the width of the panel.
18 | editable:: Enable or disable the edit button the the panel
19 | type:: The type of panel this object contains. Each panel type will require additional
20 | properties. See the panel types list to the right.
21 | --
22 |
23 | include::panels/bettermap.asciidoc[]
24 |
25 | include::panels/column.asciidoc[]
26 |
27 | include::panels/goal.asciidoc[]
28 |
29 | include::panels/histogram.asciidoc[]
30 |
31 | include::panels/hits.asciidoc[]
32 |
33 | include::panels/map.asciidoc[]
34 |
35 | include::panels/sparklines.asciidoc[]
36 |
37 | include::panels/table.asciidoc[]
38 |
39 | include::panels/terms.asciidoc[]
40 |
41 | include::panels/text.asciidoc[]
42 |
43 | include::panels/trends.asciidoc[]
44 |
--------------------------------------------------------------------------------
/src/app/panels/valuehistogram/editor.html:
--------------------------------------------------------------------------------
1 |
Possibility #1: Your elasticsearch server is down or unreachable
10 | This can be caused by a network outage, or a failure of the Elasticsearch process. If you have recently run a query that required a terms aggregation to be executed it is possible the process has run out of memory and stopped. Be sure to check your Elasticsearch logs for any sign of memory pressure.
11 |
Possibility #2: You are running Elasticsearch 1.4 or higher
12 | Elasticsearch 1.4 ships with a security setting that prevents Kibana from connecting. You will need to set the following in your elasticsearch.yml:
13 |
14 |
15 |
http.cors.enabled: true
16 |
http.cors.allow-origin to the correct protocol, hostname, and port (if not 80) that your access Kibana from. Note that if you are running Kibana in a sub-url, you should exclude the sub-url path and only include the protocol, hostname and port. For example, http://mycompany.com:8080, not http://mycompany.com:8080/kibana.
17 |
18 |
19 |
Click back, or the home button, when you have resolved the connection issue
--------------------------------------------------------------------------------
/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | If you have a bugfix or new feature that you would like to contribute to Kibana, please **find or open an issue about it before you start working on it.** Talk about what you would like to do. It may be that somebody is already working on it, or that there are particular issues that you should know about before implementing the change.
2 |
3 | We enjoy working with contributors to get their code accepted. There are many approaches to fixing a problem and it is important to find the best approach before writing too much code.
4 |
5 | The process for contributing to any of the Elasticsearch repositories is similar.
6 |
7 | 1. Sign the contributor license agreement
8 | Please make sure you have signed the [Contributor License Agreement](http://www.elasticsearch.org/contributor-agreement/). We are not asking you to assign copyright to us, but to give us the right to distribute your code without restriction. We ask this of all contributors in order to assure our users of the origin and continuing existence of the code. You only need to sign the CLA once.
9 |
10 | 2. Run the grunt build process and ensure it completes without errors with your changes.
11 |
12 | 3. Rebase your changes
13 | Update your local repository with the most recent code from the main Kibana repository, and rebase your branch on top of the latest master branch. We prefer your changes to be squashed into a single commit.
14 |
15 | 4. Submit a pull request
16 | Push your local changes to your forked copy of the repository and submit a pull request. In the pull request, describe what your changes do and mention the number of the issue where discussion has taken place, eg “Closes #123″.
17 |
18 | Then sit back and wait. There will probably be discussion about the pull request and, if any changes are needed, we would love to work with you to get your pull request merged into Kibana.
19 |
20 |
--------------------------------------------------------------------------------
/src/app/panels/hits/editor.html:
--------------------------------------------------------------------------------
1 |
12 | author field contains the exact phrase "john smith"
13 |
author:"John Smith"
14 |
15 |
16 |
Wildcard searches can be run on individual terms, using ? to replace
17 | a single character, and * to replace zero or more characters:
18 |
qu?ck bro*
19 |
20 |
21 |
22 | Numbers 1..5
23 |
count:[1 TO 5]
24 |
25 | Tags between alpha and omega, excluding alpha and omega:
26 |
tag:{alpha TO omega}
27 |
28 | Numbers from 10 upwards
29 |
count:[10 TO *]
30 |
31 |
--------------------------------------------------------------------------------
/src/app/factories/store.js:
--------------------------------------------------------------------------------
1 | define([
2 | 'angular',
3 | 'lodash'
4 | ],
5 | function (angular, _) {
6 | 'use strict';
7 |
8 | var module = angular.module('kibana.factories');
9 | module.factory('storeFactory', function() {
10 |
11 | return function storeFactory($scope, name, defaults) {
12 | if (!_.isFunction($scope.$watch)) {
13 | throw new TypeError('Invalid scope.');
14 | }
15 | if (!_.isString(name)) {
16 | throw new TypeError('Invalid name, expected a string that the is unique to this store.');
17 | }
18 | if (defaults && !_.isPlainObject(defaults)) {
19 | throw new TypeError('Invalid defaults, expected a simple object or nothing');
20 | }
21 |
22 | defaults = defaults || {};
23 |
24 | // get the current value, parse if it exists
25 | var current = localStorage.getItem(name);
26 | if (current != null) {
27 | try {
28 | current = JSON.parse(current);
29 | } catch (e) {
30 | current = null;
31 | }
32 | }
33 |
34 | if (current == null) {
35 | current = _.clone(defaults);
36 | } else if (_.isPlainObject(current)) {
37 | _.defaults(current, defaults);
38 | } else {
39 | throw new TypeError('Invalid store value' + current);
40 | }
41 |
42 | $scope[name] = current;
43 |
44 | // listen for changes and store them in localStorage.
45 | // delete the value to reset to the defaults, ie. `delete $scope[name]` -> digest cycle -> `$scope[name] == defaults`
46 | $scope.$watch(name, function (val) {
47 | if (val === void 0) {
48 | localStorage.removeItem(name);
49 | $scope[name] = _.clone(defaults);
50 | } else {
51 | localStorage.setItem(name, JSON.stringify(val));
52 | }
53 | }, true);
54 |
55 | return current;
56 | };
57 | });
58 |
59 | });
60 |
--------------------------------------------------------------------------------
/docs/kibana/panels/table.asciidoc:
--------------------------------------------------------------------------------
1 |
2 | == table
3 | Status: *Stable*
4 |
5 | The table panel contains a sortable, pagable view of documents that. It can be arranged into
6 | defined columns and offers several interactions, such as performing adhoc terms aggregations.
7 |
8 | === Parameters
9 |
10 | size:: The number of hits to show per page
11 | pages:: The number of pages available
12 | offset:: The current page
13 | sort:: An array describing the sort order of the table. For example [`@timestamp',`desc']
14 | overflow:: The css overflow property. `min-height' (expand) or `auto' (scroll)
15 | fields:: the fields used a columns of the table, in an array.
16 | highlight:: The fields on which to highlight, in an array
17 | sortable:: Set sortable to false to disable sorting
18 | header:: Set to false to hide the table column names
19 | paging:: Set to false to hide the paging controls of the table
20 | field_list:: Set to false to hide the list of fields. The user will be able to expand it,
21 | but it will be hidden by default
22 | all_fields:: Set to true to show all fields in the mapping, not just the current fields in
23 | the table.
24 | trimFactor:: The trim factor is the length at which to truncate fields takinging into
25 | consideration the number of columns in the table. For example, a trimFactor of 100, with 5
26 | columns in the table, would trim each column at 20 character. The entirety of the field is
27 | still available in the expanded view of the event.
28 | localTime:: Set to true to adjust the timeField to the browser's local time
29 | timeField:: If localTime is set to true, this field will be adjusted to the browsers local time
30 | spyable:: Set to false to disable the inspect icon
31 |
32 | ==== Queries
33 | queries object:: This object describes the queries to use on this panel.
34 | queries.mode::: Of the queries available, which to use. Options: +all, pinned, unpinned, selected+
35 | queries.ids::: In +selected+ mode, which query ids are selected.
36 |
--------------------------------------------------------------------------------
/src/app/panels/stats/module.html:
--------------------------------------------------------------------------------
1 |