Skip to content

Commit c644ba4

Browse files
authored
Merge pull request #258 from sivasamyk/v6.2.2_0.1.27
V6.2.2 0.1.27
2 parents 150b00a + 9175310 commit c644ba4

File tree

5 files changed

+12
-12
lines changed

5 files changed

+12
-12
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Installation
2525
- Download and install Elasticsearch , Logstash and Kibana
2626
- Logtrail is supported and tested with Kibana 6.x and 5.x
2727
- Install logtrail plugin (requires restart of Kibana after install)
28-
- Kibana 6.2.2 : `./bin/kibana-plugin install https://github.com/sivasamyk/logtrail/releases/download/v0.1.26/logtrail-6.2.2-0.1.26.zip`
28+
- Kibana 6.2.2 : `./bin/kibana-plugin install https://github.com/sivasamyk/logtrail/releases/download/v0.1.27/logtrail-6.2.2-0.1.27.zip`
2929
- Kibana 5.6.5 : `./bin/kibana-plugin install https://github.com/sivasamyk/logtrail/releases/download/v0.1.23/logtrail-5.6.5-0.1.23.zip`
3030
- Other versions : [https://github.com/sivasamyk/logtrail/releases](https://github.com/sivasamyk/logtrail/releases)
3131
- Kibana requires exact match of plugin version to the Kibana version. If you can't find logtrail plugin release for a Kibana release, follow the instrcutions [here](docs/how_to.md#2-update-kibanaversion-in-logtrail-plugin-archive) to update Kibana version in your logtrail plugin archive.

logtrail.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@
2626
}
2727
}
2828
]
29-
}
29+
}

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "logtrail",
3-
"version": "0.1.26",
3+
"version": "0.1.27",
44
"description": "Plugin to view, search & tail logs in Kibana",
55
"main": "index.js",
66
"kibana": {

server/routes/init_server_context.js

+7-7
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,16 @@ function loadConfigFromES(server,context) {
2222
});
2323
}
2424

25-
function updateKeywordInfo(server,indexPattern, fieldKey) {
25+
function updateKeywordInfo(request, server, indexPattern, fieldKey) {
2626
return new Promise((resolve,reject) => {
2727
var field = indexPattern.fields.mapping[fieldKey];
2828
//check if the direct field is of type keyword
29-
checkIfFieldIsKeyword(server,indexPattern, field).then(async function(result) {
29+
checkIfFieldIsKeyword(request, server,indexPattern, field).then(async function(result) {
3030
if (result) {
3131
indexPattern.fields.mapping[fieldKey + ".keyword"] = field;
3232
} else {
3333
//else check if we have .keyword mapping added by logstash template.
34-
result = await checkIfFieldIsKeyword(server,indexPattern, field + ".keyword");
34+
result = await checkIfFieldIsKeyword(request, server,indexPattern, field + ".keyword");
3535
if (result) {
3636
indexPattern.fields.mapping[fieldKey + ".keyword"] = field + ".keyword";
3737
}
@@ -41,15 +41,15 @@ function updateKeywordInfo(server,indexPattern, fieldKey) {
4141
});
4242
}
4343

44-
function checkIfFieldIsKeyword(server, indexPattern, fieldToCheck) {
44+
function checkIfFieldIsKeyword(request, server, indexPattern, fieldToCheck) {
4545
return new Promise((resolve, reject) => {
46-
const adminCluster = server.plugins.elasticsearch.getCluster('admin');
47-
var request = {
46+
const { callWithRequest } = server.plugins.elasticsearch.getCluster('data');
47+
var payload = {
4848
index: indexPattern.es.default_index,
4949
fields: fieldToCheck,
5050
ignoreUnavailable: true
5151
};
52-
var resp = adminCluster.callWithInternalUser('fieldCaps',request).then(function(resp) {
52+
var resp = callWithRequest(request, 'fieldCaps', payload).then(function(resp) {
5353
resolve(resp.fields[fieldToCheck].keyword != null);
5454
}).catch(function(error) {
5555
server.log (['info','status'],`Cannot load keyword field for ${fieldToCheck}. will use non-keyword field ${error}`);

server/routes/server.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -299,8 +299,8 @@ module.exports = function (server) {
299299
for (var i = config.index_patterns.length - 1; i >= 0; i--) {
300300
var selected_config = config.index_patterns[i];
301301
if (selected_config.fields.mapping['hostname.keyword'] == null) {
302-
await updateKeywordInfo(server, selected_config, "hostname");
303-
await updateKeywordInfo(server, selected_config, "program");
302+
await updateKeywordInfo(request, server, selected_config, "hostname");
303+
await updateKeywordInfo(request, server, selected_config, "program");
304304
}
305305
}
306306
reply({

0 commit comments

Comments
 (0)