Skip to content

Commit

Permalink
Merge pull request #67 from rashidkpc/master
Browse files Browse the repository at this point in the history
Fix for missing index error
  • Loading branch information
Rashid Khan committed May 6, 2013
2 parents e45c08f + 7be784b commit 9d021f4
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 34 deletions.
2 changes: 1 addition & 1 deletion config.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ If you need to configure the default dashboard, please see dashboards/default
var config = new Settings(
{
// By default this will attempt to reach ES at the same host you have
// elasticsearch installed on. You probable want to set it to the FQDN of your
// elasticsearch installed on. You probably want to set it to the FQDN of your
// elasticsearch host
elasticsearch: "http://"+window.location.hostname+":9200",
// elasticsearch: 'http://localhost:9200',
Expand Down
13 changes: 2 additions & 11 deletions dashboards/default
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,6 @@
"timezone": "browser",
"spyable": true,
"zoomlinks": true,
"index": [
"logstash-2013.04.11"
],
"fill": 0,
"linewidth": 2,
"bars": true,
Expand Down Expand Up @@ -161,10 +158,7 @@
"arrangement": "horizontal",
"chart": true,
"counters": true,
"count_pos": "above",
"index": [
"logstash-2013.04.11"
]
"count_pos": "above"
}
]
},
Expand Down Expand Up @@ -228,10 +222,7 @@
"@timestamp",
"@message"
],
"sortable": true,
"index": [
"logstash-2013.04.11"
]
"sortable": true
}
]
}
Expand Down
10 changes: 5 additions & 5 deletions panels/histogram/module.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,15 +101,15 @@ angular.module('kibana.histogram', [])
$scope.get_data = function(segment,query_id) {
delete $scope.panel.error
// Make sure we have everything for the request to complete
if(_.isUndefined($scope.panel.index) || _.isUndefined($scope.time))
if(_.isUndefined($scope.index) || _.isUndefined($scope.time))
return

if ($scope.panel.auto_int)
$scope.panel.interval = secondsToHms(calculate_interval($scope.time.from,$scope.time.to,50,0)/1000);

$scope.panel.loading = true;
var _segment = _.isUndefined(segment) ? 0 : segment
var request = $scope.ejs.Request().indices($scope.panel.index[_segment]);
var request = $scope.ejs.Request().indices($scope.index[_segment]);

// Build the question part of the query
var queries = [];
Expand Down Expand Up @@ -200,7 +200,7 @@ angular.module('kibana.histogram', [])
$scope.$emit('render')

// If we still have segments left, get them
if(_segment < $scope.panel.index.length-1) {
if(_segment < $scope.index.length-1) {
$scope.get_data(_segment+1,query_id)
}

Expand All @@ -219,7 +219,7 @@ angular.module('kibana.histogram', [])
$scope.modal = {
title: "Inspector",
body : "<h5>Last Elasticsearch Query</h5><pre>"+
'curl -XGET '+config.elasticsearch+'/'+$scope.panel.index+"/_search?pretty -d'\n"+
'curl -XGET '+config.elasticsearch+'/'+$scope.index+"/_search?pretty -d'\n"+
angular.toJson(JSON.parse(request.toString()),true)+
"'</pre>",
}
Expand All @@ -240,7 +240,7 @@ angular.module('kibana.histogram', [])
$scope.time = time;
// Should I be storing the index on the panel? It causes errors if the index
// goes away. Hmmm.
$scope.panel.index = time.index || $scope.panel.index
$scope.index = time.index || $scope.index
// Only calculate interval if auto_int is set, otherwise don't touch it

$scope.get_data();
Expand Down
8 changes: 4 additions & 4 deletions panels/map/module.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,11 @@ angular.module('kibana.map', [])

$scope.get_data = function() {
// Make sure we have everything for the request to complete
if(_.isUndefined($scope.panel.index) || _.isUndefined($scope.time))
if(_.isUndefined($scope.index) || _.isUndefined($scope.time))
return

$scope.panel.loading = true;
var request = $scope.ejs.Request().indices($scope.panel.index);
var request = $scope.ejs.Request().indices($scope.index);

// Then the insert into facet and make the request
var request = request
Expand Down Expand Up @@ -96,15 +96,15 @@ angular.module('kibana.map', [])
$scope.modal = {
title: "Inspector",
body : "<h5>Last Elasticsearch Query</h5><pre>"+
'curl -XGET '+config.elasticsearch+'/'+$scope.panel.index+"/_search?pretty -d'\n"+
'curl -XGET '+config.elasticsearch+'/'+$scope.index+"/_search?pretty -d'\n"+
angular.toJson(JSON.parse(request.toString()),true)+
"'</pre>",
}
}

function set_time(time) {
$scope.time = time;
$scope.panel.index = _.isUndefined(time.index) ? $scope.panel.index : time.index
$scope.index = _.isUndefined(time.index) ? $scope.index : time.index
$scope.get_data();
}

Expand Down
8 changes: 4 additions & 4 deletions panels/map2/module.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,11 @@ angular.module('kibana.map2', [])
$scope.get_data = function () {

// Make sure we have everything for the request to complete
if (_.isUndefined($scope.panel.index) || _.isUndefined($scope.time))
if (_.isUndefined($scope.index) || _.isUndefined($scope.time))
return

$scope.panel.loading = true;
var request = $scope.ejs.Request().indices($scope.panel.index);
var request = $scope.ejs.Request().indices($scope.index);


var metric = 'count';
Expand Down Expand Up @@ -149,13 +149,13 @@ angular.module('kibana.map2', [])
$scope.populate_modal = function (request) {
$scope.modal = {
title: "Inspector",
body: "<h5>Last Elasticsearch Query</h5><pre>" + 'curl -XGET ' + config.elasticsearch + '/' + $scope.panel.index + "/_search?pretty -d'\n" + angular.toJson(JSON.parse(request.toString()), true) + "'</pre>"
body: "<h5>Last Elasticsearch Query</h5><pre>" + 'curl -XGET ' + config.elasticsearch + '/' + $scope.index + "/_search?pretty -d'\n" + angular.toJson(JSON.parse(request.toString()), true) + "'</pre>"
}
};

function set_time(time) {
$scope.time = time;
$scope.panel.index = _.isUndefined(time.index) ? $scope.panel.index : time.index
$scope.index = _.isUndefined(time.index) ? $scope.index : time.index
$scope.get_data();
}

Expand Down
8 changes: 4 additions & 4 deletions panels/parallelcoordinates/module.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,14 @@ angular.module('kibana.parallelcoordinates', [])
$scope.get_data = function (segment,query_id) {

// Make sure we have everything for the request to complete
if (_.isUndefined($scope.panel.index) || _.isUndefined($scope.time))
if (_.isUndefined($scope.index) || _.isUndefined($scope.time))
return;

var _segment = _.isUndefined(segment) ? 0 : segment
$scope.segment = _segment;

$scope.panel.loading = true;
var request = $scope.ejs.Request().indices($scope.panel.index[_segment])
var request = $scope.ejs.Request().indices($scope.index[_segment])
.query(ejs.FilteredQuery(
ejs.QueryStringQuery($scope.panel.query || '*'),
ejs.RangeFilter($scope.time.field)
Expand Down Expand Up @@ -126,13 +126,13 @@ angular.module('kibana.parallelcoordinates', [])
$scope.populate_modal = function (request) {
$scope.modal = {
title: "Inspector",
body: "<h5>Last Elasticsearch Query</h5><pre>" + 'curl -XGET ' + config.elasticsearch + '/' + $scope.panel.index + "/_search?pretty -d'\n" + angular.toJson(JSON.parse(request.toString()), true) + "'</pre>"
body: "<h5>Last Elasticsearch Query</h5><pre>" + 'curl -XGET ' + config.elasticsearch + '/' + $scope.index + "/_search?pretty -d'\n" + angular.toJson(JSON.parse(request.toString()), true) + "'</pre>"
}
};

function set_time(time) {
$scope.time = time;
$scope.panel.index = _.isUndefined(time.index) ? $scope.panel.index : time.index
$scope.index = _.isUndefined(time.index) ? $scope.index : time.index
$scope.get_data();
}

Expand Down
8 changes: 4 additions & 4 deletions panels/pie/module.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,11 @@ angular.module('kibana.pie', [])

$scope.get_data = function() {
// Make sure we have everything for the request to complete
if(_.isUndefined($scope.panel.index) || _.isUndefined($scope.time))
if(_.isUndefined($scope.index) || _.isUndefined($scope.time))
return

$scope.panel.loading = true;
var request = $scope.ejs.Request().indices($scope.panel.index);
var request = $scope.ejs.Request().indices($scope.index);

// Terms mode
if ($scope.panel.mode == "terms") {
Expand Down Expand Up @@ -168,7 +168,7 @@ angular.module('kibana.pie', [])
$scope.modal = {
title: "Inspector",
body : "<h5>Last Elasticsearch Query</h5><pre>"+
'curl -XGET '+config.elasticsearch+'/'+$scope.panel.index+"/_search?pretty -d'\n"+
'curl -XGET '+config.elasticsearch+'/'+$scope.index+"/_search?pretty -d'\n"+
angular.toJson(JSON.parse(request.toString()),true)+
"'</pre>",
}
Expand All @@ -182,7 +182,7 @@ angular.module('kibana.pie', [])

function set_time(time) {
$scope.time = time;
$scope.panel.index = _.isUndefined(time.index) ? $scope.panel.index : time.index
$scope.index = _.isUndefined(time.index) ? $scope.index : time.index
$scope.get_data();
}

Expand Down
2 changes: 1 addition & 1 deletion panels/timepicker/module.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ angular.module('kibana.timepicker', [])
timefield : '@timestamp',
index : '_all',
defaultindex : "_all",
index_interval: "day",
index_interval: "none",
group : "default",
refresh : {
enable : false,
Expand Down

0 comments on commit 9d021f4

Please sign in to comment.