Merge branch 'master' into fix/3441/visualizeTimeFromDiscover

This commit is contained in:
Khalah Jones-Golden 2015-03-26 10:55:37 -07:00
commit 4821f6d70d
22 changed files with 119 additions and 51 deletions

View file

@ -29,7 +29,22 @@ module.exports = function (grunt) {
'<%= package.homepage ? " * " + package.homepage + "\\n" : "" %>' +
' * Copyright (c) <%= grunt.template.today("yyyy") %> <%= package.author.company %>;' +
' Licensed <%= package.license %> */\n'
}
},
lessFiles: [
'<%= src %>/kibana/components/*/*.less',
'<%= src %>/kibana/styles/main.less',
'<%= src %>/kibana/components/vislib/styles/main.less',
'<%= plugins %>/dashboard/styles/main.less',
'<%= plugins %>/discover/styles/main.less',
'<%= plugins %>/settings/styles/main.less',
'<%= plugins %>/visualize/styles/main.less',
'<%= plugins %>/visualize/styles/visualization.less',
'<%= plugins %>/visualize/styles/main.less',
'<%= plugins %>/table_vis/table_vis.less',
'<%= plugins %>/metric_vis/metric_vis.less',
'<%= plugins %>/markdown_vis/markdown_vis.less'
]
};
grunt.config.merge(config);

View file

@ -24,7 +24,7 @@ If you are using Shield to authenticate Elasticsearch users, you need to provide
the Kibana server with credentials so it can access the `.kibana` index and monitor
the cluster.
To configure credentials the Kibana server, set the `kibana_elasticsearch_username` and
To configure credentials for the Kibana server, set the `kibana_elasticsearch_username` and
`kibana_elasticsearch_password` properties in `kibana.yml`:
----

View file

@ -16,7 +16,7 @@ NOTE: If your Elasticsearch installation is protected by http://www.elastic.co/o
=== Install and Start Kibana
To get Kibana up and running:
. Download the http://www.elastic.co/overview/kibana/installation/[Kibana 4 binary package] for your platform.
. Download the https://www.elastic.co/downloads/kibana[Kibana 4 binary package] for your platform.
. Extract the `.zip` or `tar.gz` archive file.
. Run Kibana from the install directory: `bin/kibana` (Linux/MacOSX) or `bin\kibana.bat` (Windows).
@ -35,7 +35,7 @@ To configure the Elasticsearch indices you want to access with Kibana:
+
image:images/Start-Page.jpg[Kibana start page]
+
. Specify an index pattern that matches the name of one or more of your Elasticsearch indices. By default, Kibana guesses that you're you're working with data being fed into Elasticsearch by Logstash. If that's the case, you can use the default `logstash-*` as your index pattern. The asterisk (*) matches zero or more characters in an index's name. If your Elasticsearch indices follow some other naming convention, enter an appropriate pattern. The "pattern" can also simply be the name of a single index.
. Specify an index pattern that matches the name of one or more of your Elasticsearch indices. By default, Kibana guesses that you're working with data being fed into Elasticsearch by Logstash. If that's the case, you can use the default `logstash-*` as your index pattern. The asterisk (*) matches zero or more characters in an index's name. If your Elasticsearch indices follow some other naming convention, enter an appropriate pattern. The "pattern" can also simply be the name of a single index.
. Select the index field that contains the timestamp that you want to use to perform time-based comparisons. Kibana reads the index mapping to list all of the fields that contain a timestamp. If your index doesn't have time-based data, disable the *Index contains time-based events* option.
. If new indices are generated periodically and have a timestamp appended to the name, select the *Use event times to create index names* option and select the *Index pattern interval*. This improves search performance by enabling Kibana to search only those indices that could contain data in the time range you specify. This is primarily applicable if you are using Logstash to feed data into Elasticsearch.
. Click *Create* to add the index pattern. This first pattern is automatically configured as the default. When you have more than one index pattern, you can designate which one to use as the default from *Settings > Indices*.

View file

@ -4,10 +4,10 @@ define(function (require) {
return function (aggConfig, key) {
var splits = key.split(/\-/);
var gte = Number(splits[0]);
var lte = Number(splits[1]);
var lt = Number(splits[1]);
return buildRangeFilter(aggConfig.params.field, {
gte: gte,
lte: lte
lt: lt
}, aggConfig.vis.indexPattern);
};
};

View file

@ -1,6 +1,6 @@
<div class="form-group">
<div ng-repeat="filter in agg.params.filters">
<label>Query {{$index + 1}}</label>
<label>Filter {{$index + 1}}</label>
<div class="form-group vis-editor-agg-form-row">
<input validate-query
ng-model="filter.input.query"
@ -21,5 +21,5 @@
click-focus="'filter'+(agg.params.filters.length-1)"
ng-click="agg.params.filters.push({input:{}})"
class="sidebar-item-button primary">
Add filter
Add Filter
</div>

View file

@ -4,7 +4,7 @@ define(function (require) {
return new MetricAggType({
name: 'cardinality',
title: 'Unique count',
title: 'Unique Count',
makeLabel: function (aggConfig) {
return 'Unique count of ' + aggConfig.params.field.displayName;
},

View file

@ -9,9 +9,9 @@ define(function (require) {
.get(filter.meta.index).then(function (indexPattern) {
key = _.keys(filter.range)[0];
field = indexPattern.fields.byName[key];
from = filter.range[key].gte || filter.range[key].gt;
to = filter.range[key].lte || filter.range[key].lt;
from = (filter.range[key].gte != null) ? filter.range[key].gte : filter.range[key].gt;
from = field.format.convert(from);
to = (filter.range[key].lte != null) ? filter.range[key].lte : filter.range[key].lt;
to = field.format.convert(to);
value = from + ' to ' + to;
return { key: key, value: value };

View file

@ -16,6 +16,6 @@ define(function (require) {
}
});
return hit.$$_flattened = _.merge(source, fields, _.pick(hit, self.metaFields));
return hit.$$_flattened = _.merge(source, fields, _.pick(hit, self.metaFields), _.pick(hit.fields, self.metaFields));
};
});

View file

@ -6,7 +6,6 @@ define(function (require) {
.get('app/dashboard')
.directive('dashboardPanel', function (savedVisualizations, savedSearches, Notifier, Private, $compile) {
var _ = require('lodash');
var filterBarClickHandler = Private(require('components/filter_bar/filter_bar_click_handler'));
var loadPanel = Private(require('plugins/dashboard/components/panel/lib/load_panel'));
var notify = new Notifier();

View file

@ -153,7 +153,8 @@ define(function (require) {
schema: 'segment',
params: {
field: field.name,
size: config.get('discover:aggs:terms:size', 20)
size: config.get('discover:aggs:terms:size', 20),
orderBy: '2'
}
};
}
@ -165,17 +166,12 @@ define(function (require) {
filters: $scope.state.filters || [],
query: $scope.state.query || undefined,
vis: {
type: type,
aggs: [
agg,
{schema: 'metric', type: 'count'}
{schema: 'metric', type: 'count', 'id': '2'}
]
},
metric: [{
agg: 'count',
}],
segment: [agg],
group: [],
split: [],
}
})
});
};

View file

@ -243,7 +243,7 @@ define(function (require) {
$scope.searchSource.onError(function (err) {
console.log(err);
notify.error('An error occured with your request. Reset your inputs and try again.');
notify.error('An error occurred with your request. Reset your inputs and try again.');
}).catch(notify.fatal);
function initForTime() {

View file

@ -93,13 +93,13 @@
<div ng-show="opts.timefield">
<p>
<h3>Expand your time range</h3>
<p>I see you are looking at an index with a date field. It is possible your query does not match anything in the current time range, or that there is not data at all in the currently selected time range. Click the button below to open the time picker. For future reference you can open the time picker by clicking the <a class="btn btn-xs navbtn" ng-click="toggleTimepicker(); toggledTimepicker = !toggledTimepicker" aria-expanded="{{toggledTimepicker}}" aria-label="time picker">time picker <i aria-hidden="true" class="fa fa-clock-o"></i></a> in the top right corner of your screen.
<p>I see you are looking at an index with a date field. It is possible your query does not match anything in the current time range, or that there is no data at all in the currently selected time range. Click the button below to open the time picker. For future reference you can open the time picker by clicking the <a class="btn btn-xs navbtn" ng-click="toggleTimepicker(); toggledTimepicker = !toggledTimepicker" aria-expanded="{{toggledTimepicker}}" aria-label="time picker">time picker <i aria-hidden="true" class="fa fa-clock-o"></i></a> in the top right corner of your screen.
</p>
</div>
<h3>Refine your query</h3>
<p>
The search bar at the top allows Kibana uses Elasticsearch's support for Lucene Query String syntax. Let's say we're searching web server logs that have been parsed into a few fields.
The search bar at the top uses Elasticsearch's support for Lucene Query String syntax. Let's say we're searching web server logs that have been parsed into a few fields.
</p>
<p>

View file

@ -1,6 +1,8 @@
define(function (require) {
var _ = require('lodash');
var configDefaults = require('components/config/defaults');
var getValType = require('plugins/settings/sections/advanced/lib/get_val_type');
require('plugins/settings/sections/advanced/advanced_row');
@ -38,7 +40,7 @@ define(function (require) {
var conf = {
name: name,
defVal: def.value,
type: (def.type || _.isArray(val) || typeof val),
type: getValType(def, val),
description: def.description,
value: val,
};

View file

@ -0,0 +1,22 @@
define(function (require) {
var _ = require('lodash');
/**
* @param {object} advanced setting definition object
* @param {?} current value of the setting
* @returns {string} the type to use for determining the display and editor
*/
function getValType(def, value) {
if (def.type) {
return def.type;
}
if (_.isArray(value) || _.isArray(def.value)) {
return 'array';
}
return (typeof def.value);
}
return getValType;
});

View file

@ -15,6 +15,7 @@ require.config({
'angular-route': 'bower_components/angular-route/angular-route',
'angular-ui-ace': 'bower_components/angular-ui-ace/ui-ace',
ace: 'bower_components/ace-builds/src-noconflict/ace',
'ace-json': 'bower_components/ace-builds/src-noconflict/mode-json',
angular: 'bower_components/angular/angular',
async: 'bower_components/async/lib/async',
bower_components: 'bower_components',
@ -46,7 +47,8 @@ require.config({
'elasticsearch': ['angular'],
'angular-bootstrap': ['angular'],
'angular-bindonce': ['angular'],
'angular-ui-ace': ['angular', 'ace'],
'ace-json': ['ace'],
'angular-ui-ace': ['angular', 'ace', 'ace-json'],
'ng-clip': ['angular', 'zeroclipboard'],
inflection: {
exports: 'inflection'

View file

@ -4,7 +4,7 @@ module.exports = function (grunt) {
'clean:target',
'clean:build',
'require_css_deps:copy',
'less',
'less:build',
'copy:kibana_src',
'clean:dev_only_plugins',
'touch_config',

View file

@ -1,26 +1,26 @@
var bc = require('path').join(__dirname, '../../src/kibana/bower_components');
module.exports = {
src: {
src: [
'<%= src %>/kibana/components/*/*.less',
'<%= src %>/kibana/styles/main.less',
'<%= src %>/kibana/components/vislib/styles/main.less',
'<%= plugins %>/dashboard/styles/main.less',
'<%= plugins %>/discover/styles/main.less',
'<%= plugins %>/settings/styles/main.less',
'<%= plugins %>/visualize/styles/main.less',
'<%= plugins %>/visualize/styles/visualization.less',
'<%= plugins %>/visualize/styles/main.less',
'<%= plugins %>/table_vis/table_vis.less',
'<%= plugins %>/metric_vis/metric_vis.less',
'<%= plugins %>/markdown_vis/markdown_vis.less'
],
options: {
sourceMapBasepath: '<%= src %>/kibana',
sourceMapRootpath: '/',
ieCompat: false,
paths: [
'<%= src %>/kibana/bower_components/lesshat/build/'
]
},
dev: {
src: '<%= lessFiles %>',
expand: true,
ext: '.css',
options: {
ieCompat: false,
paths: [bc + '/lesshat/build/']
sourceMap: true
}
},
build: {
src: '<%= lessFiles %>',
expand: true,
ext: '.css',
options: {
sourceMap: false
}
}
};

View file

@ -15,7 +15,7 @@ module.exports = function (grunt) {
'<%= app %>/**/components/**/*.less',
'<%= app %>/**/components/vislib/components/styles/**/*.less'
],
tasks: ['less']
tasks: ['less:dev']
},
jade: {

View file

@ -3,7 +3,7 @@ module.exports = function (grunt) {
grunt.registerTask('dev', function () {
var tasks = [
'less',
'less:dev',
'jade',
'esvm:dev',
'maybe_start_kibana',

View file

@ -28,7 +28,7 @@ module.exports = function (grunt) {
'jshint',
'maybe_start_kibana',
'jade',
'less'
'less:build'
];
addTestTask(tasks);
if (process.env.TRAVIS) tasks.unshift('esvm:dev');

View file

@ -38,7 +38,7 @@ define(function (require) {
expect(filter.meta).to.have.property('index', indexPattern.id);
expect(filter.range).to.have.property('bytes');
expect(filter.range.bytes).to.have.property('gte', 1024.0);
expect(filter.range.bytes).to.have.property('lte', 2048.0);
expect(filter.range.bytes).to.have.property('lt', 2048.0);
});
});

View file

@ -0,0 +1,32 @@
define(function (require) {
var getValType = require('plugins/settings/sections/advanced/lib/get_val_type');
describe('Settings', function () {
describe('Advanced', function () {
describe('getValType(def, val)', function () {
it('should be a function', function () {
expect(getValType).to.be.a(Function);
});
it('should return the explicitly defined type of a setting', function () {
expect(getValType({type: 'string'})).to.be('string');
expect(getValType({type: 'json'})).to.be('json');
expect(getValType({type: 'string', value: 5})).to.be('string');
});
it('should return array if the value is an Array and there is no defined type', function () {
expect(getValType({type: 'string'}, [1, 2, 3])).to.be('string');
expect(getValType({type: 'json', value: [1, 2, 3]})).to.be('json');
expect(getValType({value: 'someString'}, [1, 2, 3])).to.be('array');
expect(getValType({value: [1, 2, 3]}, 'someString')).to.be('array');
});
it('should return the type of the default value if there is no type and it is not an array', function () {
expect(getValType({value: 'someString'})).to.be('string');
expect(getValType({value: 'someString'}, 42)).to.be('string');
});
});
});
});
});