Hello,
I code own plugin for kibana, but am unable to read plugin-related configuration from kibana.yml
kibana.yml - custom attributes part
cleanup tool
kibanaVersion format: [major].[minor]
cleanup_tool.kibanaVersion: 4.6
cleanup_tool.enabled: true
cleanup_tool.debug: trueauditlog settings
cleanup_tool.auditlogRecordsPerPage: 20
cleanup_tool.auditlogDefaultSortField: timestamp
cleanup_tool.auditlogDefaultSortDirection: descscrollTime used in Scroll API on searching for documents for bulk processing
cleanup_tool.scrollTime: 3m
settings for scheduler connection to ES - prevents all Kibana features from using high priviledges needed for scheduler
cleanup_tool.schedulerESHost: 10.88.13.204
cleanup_tool.schedulerESPort: 9200
cleanup_tool.schedulerESUser: superClean
cleanup_tool.schedulerESPassword: password
cleanup_tool.schedulerESRequestTimeout: 30000
cleanup_tool.schedulerESPingTimeout: 3000
cleanup_tool.schedulerESKeepAlive: truems to wait before recall ES on failure
cleanup_tool.checkESTimeout: 30000
index.js (config(Joi) part)
config(Joi) {
const { array, boolean, number, object, string } = Joi;return Joi.object({ kibanaVersion: Joi.string().default('4.6'), enabled: Joi.boolean().default(true), debug: Joi.boolean().default(true), auditlogRecordsPerPage: Joi.number().integer().default(20), auditlogDefaultSortField: Joi.string().default('timestamp'), auditlogDefaultSortDirection: Joi.string().default('desc'), scrollTime: Joi.string().default('3m'), schedulerESHost: Joi.string().default('127.0.0.1'), schedulerESPort: Joi.number().integer().default(9200), schedulerESUser: Joi.string().default('elastic'), schedulerESPassword: Joi.string().default('changeme'), schedulerESRequestTimeout: Joi.number().integer().default(30000), schedulerESPingTimeout: Joi.number().integer().default(3000), schedulerESKeepAlive: Joi.boolean().default(true), checkESTimeout: Joi.number().default(30000) }).default(); }
I believe, configuration is read from here, when plugin starts ?
index.js (injectVars part)
injectVars: function(server, options) {
const config = server.config();
return {
kbnIndex: config.get('kibana.index'), // unused
elasticsearchUrl: config.get('elasticsearch.url'), // new
enabled: options.enabled,
debug: options.debug,
auditlogRecordsPerPage: options.auditlogRecordsPerPage,
auditlogDefaultSortField: options.auditlogDefaultSortField,
auditlogDefaultSortDirection: options.auditlogDefaultSortDirection,
scrollTime: options.scrollTime,
schedulerESHost: options.schedulerESHost,
schedulerESPort: options.schedulerESPort,
schedulerESUser: options.schedulerESUser,
schedulerESPassword: options.schedulerESPassword,
schedulerESRequestTimeout: options.schedulerESRequestTimeout,
schedulerESPingTimeout: options.schedulerESPingTimeout,
schedulerESKeepAlive: options.schedulerESKeepAlive
};
}¨
But when I later access
options.schedulerESUser
, it has default value 'elastic' rather than what I have specified in kibana.yml.
Does anybody know how to solve this ?
Thanks in advance.
P.S. - note that I am completely new to kibana plugin development.