+
+
+
+
+
+ You've entered an invalid index pattern. Please adjust it to match any of your {{stepIndexPattern.allIndices.length}} indices, below.
+
+
+
+
+
+
+
+
+
+ Your index pattern can match any of your {{stepIndexPattern.allIndices.length}} indices, below.
+
+
+
+
+
+
+
+
+
+ The index pattern you've entered doesn't match any indices. You can match any of your {{stepIndexPattern.allIndices.length}} indices, below.
+
+
+
+
+
+
+
+
+
+ Your index pattern doesn't match any indices, but you have {{stepIndexPattern.partialMatchingIndices.length}} {{stepIndexPattern.partialMatchingIndices.length > 1 ? 'indices' : 'index'}} which {{stepIndexPattern.partialMatchingIndices.length > 1 ? 'look' : 'looks'}} similar.
+
+
+
+
diff --git a/src/core_plugins/kibana/public/management/sections/indices/index.js b/src/core_plugins/kibana/public/management/sections/indices/index.js
index f53024a762411..6613d590755fe 100644
--- a/src/core_plugins/kibana/public/management/sections/indices/index.js
+++ b/src/core_plugins/kibana/public/management/sections/indices/index.js
@@ -1,5 +1,5 @@
import { management } from 'ui/management';
-import './create_index_pattern';
+import './create_index_pattern_wizard';
import './edit_index_pattern';
import uiRoutes from 'ui/routes';
import { uiModules } from 'ui/modules';
diff --git a/src/core_plugins/kibana/translations/en.json b/src/core_plugins/kibana/translations/en.json
index 54af102ae8f5c..e2824c99b3a27 100644
--- a/src/core_plugins/kibana/translations/en.json
+++ b/src/core_plugins/kibana/translations/en.json
@@ -1,52 +1,40 @@
{
"UI-WELCOME_MESSAGE": "Loading Kibana",
"UI-WELCOME_ERROR": "Kibana did not load properly. Check the server output for more information.",
- "KIBANA-CONFIGURE_INDEX_PATTERN": "Configure an index pattern",
- "KIBANA-MUST_CONFIGURE_INDEX_PATTERN": "In order to use Kibana you must configure at least one index pattern. Index patterns are used to identify the Elasticsearch index to run search and analytics against. They are also used to configure fields.",
- "KIBANA-INDEX_NAME_CREATED_BY_EVENT_TIMES": "Use event times to create index names ",
- "KIBANA-DEPRECATED": "[DEPRECATED]",
- "KIBANA-ALERT_INDEX_PATTERN_DEPRECATED": "Time-interval based index patterns are deprecated!",
- "KIBANA-WE": " We",
- "KIBANA-STRONGLY_RECOMMEND": " strongly recommend",
- "KIBANA-WILD_CARD_PATTERN": " using wildcard pattern names instead of time-interval based index patterns.",
- "KIBANA-RECOMMEND_WILD_CARD_PATTERN_DETAILS": "Kibana is now smart enough to automatically determine which indices to search against within the current time range for wildcard index patterns. This means that wildcard index patterns now get the same performance optimizations when searching within a time range as time-interval patterns.",
- "KIBANA-INDEX_PATTERN_INTERVAL": "Index pattern interval",
- "KIBANA-INDEX_NAME_OR_PATTERN": "Index name or pattern",
- "KIBANA-WILDCARD_DYNAMIC_INDEX_PATTERNS": "Patterns allow you to define dynamic index names using * as a wildcard. Example: logstash-*",
- "KIBANA-STATIC_TEXT_IN_DYNAMIC_INDEX_PATTERNS": "Patterns allow you to define dynamic index names. Static text in an index name is denoted using brackets. Example: [logstash-]YYYY.MM.DD. Please note that weeks are setup to use ISO weeks which start on Monday.",
- "KIBANA-NOTE_COLON": "Note:",
- "KIBANA-WEEKLY_ISO_NOTICE": "I noticed you are using weekly indices. Kibana requires ISO weeks be used in your index creation.",
- "KIBANA-EXPAND_INDEX_PATTERN": "Expand index pattern when searching",
- "KIBANA-WILDCARD_DEFAULT_EXPANDED_TO_CURRENT_TIME_RANGE": "With this option selected, searches against any time-based index pattern that contains a wildcard will automatically be expanded to query only the indices that contain data within the currently selected time range.",
- "KIBANA-SEARCH_AGAINST_INDEX_PATTERN": "Searching against the index pattern ",
- "KIBANA-LOGSTASH_WILDCARD": "logstash-*",
- "KIBANA-ACTUALLY_QUERY": " will actually query Elasticsearch for the specific matching indices (e.g. ",
- "KIBANA-EXAMPLE_TIME_RANGE": "logstash-2015.12.21",
- "KIBANA-FALL_WITHIN_CURRENT_TIME_RANGE": ") that fall within the current time range.",
- "KIBANA-EXPAND_INDEX_PATTERN_DEPRECATION": "With recent changes to Elasticsearch, this option should no longer be necessary and will likely be removed in future versions of Kibana.",
- "KIBANA-SAMPLE_ALERT": "Attempted to match the following indices and aliases:",
- "KIBANA-EXPAND_SEARCH": "Expand Search",
- "KIBANA-EXISTING_MATCH_PERCENT": "Pattern matches {{indexExistingMatchPercent}} of existing indices and aliases",
- "KIBANA-NON_MATCHING_INDICES_AND_ALIASES": "Indices and aliases that were found, but did not match the pattern:",
- "KIBANA-MORE": "more",
- "KIBANA-TIME_FILTER_FIELD_NAME": "Time Filter field name",
- "KIBANA-NO_DATE_FIELD_DESIRED": "I don't want to use the Time Filter",
- "KIBANA-REFRESH_FIELDS": "refresh fields",
- "KIBANA-INDICES_DONT_CONTAIN_TIME_FIELDS": "The indices which match this index pattern don't contain any time fields.",
- "KIBANA-INVALID_INDEX_PATTERN": "Invalid index name pattern.",
- "KIBANA-DATE_FORMAT_DOCS": "Date Format Documentation",
- "KIBANA-WIKI_ISO_WEEK_DATE": "Wikipedia: ISO Week Date",
- "KIBANA-NO_INDICES_MATCHING_PATTERN": "Could not locate any indices matching that pattern. Please add the index to Elasticsearch",
- "KIBANA-PATTERN_DOES_NOT_MATCH_EXIST_INDICES": "Pattern does not match any existing indices",
- "KIBANA-INVALID_NON_UNIQUE_INDEX_NAME_CREATED": "Invalid pattern, interval does not create unique index names",
- "KIBANA-FIELD_FILTER_EVENTS_GLOBAL_TIME" : "This field will be used to filter events with the global time filter",
- "KIBANA-INTERVAL_INDEX_NAMES_ROTATE" : "The interval at which index names rotate.",
+ "KIBANA-CREATE_INDEX_PATTERN_TITLE": "Create index pattern",
+ "KIBANA-CREATE_INDEX_PATTERN_INTRO": "Kibana uses index patterns to retrieve data from Elasticsearch, for things like visualizations.",
+ "KIBANA-CREATE_INDEX_PATTERN_INCLUDE_SYSTEM_INDICES_CHECKBOX_LABEL": "Include system indices",
+ "KIBANA-CREATE_INDEX_PATTERN_LOADING_DATA_TITLE": "Checking for Elasticsearch data",
+ "KIBANA-CREATE_INDEX_PATTERN_LOADING_DATA_BODY": "Reticulating splines...",
+ "KIBANA-CREATE_INDEX_PATTERN_NO_DATA_TITLE": "Couldn't find any Elasticsearch data",
+ "KIBANA-CREATE_INDEX_PATTERN_NO_DATA_BODY": "You'll need to index some data into Elasticsearch before you can create an index pattern.",
+ "KIBANA-CREATE_INDEX_PATTERN_NO_DATA_LEARN_LINK": "Learn how.",
+ "KIBANA-CREATE_INDEX_PATTERN_NO_DATA_LEARN_LINK_ALT": "Learn how to index data into Elasticsearch",
+ "KIBANA-CREATE_INDEX_PATTERN_NO_DATA_RELOAD_BUTTON": "Check for new data",
+ "KIBANA-CREATE_INDEX_PATTERN_STEP_1_TITLE": "Step 1 of 2: Define index pattern",
+ "KIBANA-CREATE_INDEX_PATTERN_STEP_1_INDEX_PATTERN_LABEL": "Index pattern",
+ "KIBANA-CREATE_INDEX_PATTERN_STEP_1_SEARCH_SINGLE_INDEX": "You only have a single index. You can create an index pattern to match it.",
+ "KIBANA-CREATE_INDEX_PATTERN_STEP_1_SEARCHING_TITLE": "Looking for matching indices",
+ "KIBANA-CREATE_INDEX_PATTERN_STEP_1_SEARCHING_BODY": "Just a sec...",
+ "KIBANA-CREATE_INDEX_PATTERN_STEP_1_SUBMIT_BUTTON" : "Next step",
+ "KIBANA-CREATE_INDEX_PATTERN_STEP_2_TITLE": "Step 2 of 2: Optional settings",
+ "KIBANA-CREATE_INDEX_PATTERN_STEP_2_TIME_FIELD_LABEL": "Choose optional Time Filter field name",
+ "KIBANA-CREATE_INDEX_PATTERN_STEP_2_TIME_FIELD_LOADING": "Please wait while we fetch your time field options",
+ "KIBANA-CREATE_INDEX_PATTERN_STEP_2_TIME_FIELD_HELP": "The Time Filter will use this field to filter your data by time.",
+ "KIBANA-CREATE_INDEX_PATTERN_STEP_2_ADVANCED_OPTIONS_BUTTON": "Advanced Time Field filter options",
+ "KIBANA-CREATE_INDEX_PATTERN_STEP_2_EXPAND_LABEL": "Expand index pattern (DEPRECATED)",
+ "KIBANA-CREATE_INDEX_PATTERN_STEP_2_EXPAND_CHECKBOX_LABEL": "Expand index pattern when searching",
+ "KIBANA-CREATE_INDEX_PATTERN_STEP_2_EXPAND_HELP_1": "With this option selected, searches against any time-based index pattern which contains a wildcard will automatically expand to query only the indices which contain data within the currently selected time range.",
+ "KIBANA-CREATE_INDEX_PATTERN_STEP_2_EXPAND_HELP_2": "Searching against the index pattern 'logstash-*' will actually query Elasticsearch for the specific matching indices (e.g. 'logstash-2015.12.21') that fall within the current time range.",
+ "KIBANA-CREATE_INDEX_PATTERN_STEP_2_EXPAND_HELP_3": "With recent changes to Elasticsearch, this option should no longer be necessary and will likely be removed in future versions of Kibana.",
+ "KIBANA-CREATE_INDEX_PATTERN_STEP_2_NO_DATE_FIELD_OPTION": "I don't want to use the Time Filter",
+ "KIBANA-CREATE_INDEX_PATTERN_STEP_2_REFRESH_FIELDS_BUTTON": "Refresh",
+ "KIBANA-CREATE_INDEX_PATTERN_STEP_2_NO_TIME_FIELDS": "The indices which match this index pattern don't contain any time fields.",
+ "KIBANA-CREATE_INDEX_PATTERN_STEP_2_INDICES_DONT_MATCH_PATTERN": "Could not locate any indices matching that pattern. Please add the index to Elasticsearch",
+ "KIBANA-CREATE_INDEX_PATTERN_STEP_2_BACK_BUTTON" : "Back",
+ "KIBANA-CREATE_INDEX_PATTERN_STEP_2_SUBMIT_BUTTON" : "Create index pattern",
+ "KIBANA-CREATE_INDEX_PATTERN_STEP_2_NO_MAPPING_ERROR" : "Unable to fetch mapping. Do you have indices matching the pattern?",
"KIBANA-WARNING" : "Warning",
"KIBANA-NO_DEFAULT_INDEX_PATTERN" : "No default index pattern. You must select or create one to continue.",
- "KIBANA-LOADING": "Loading",
- "KIBANA-INDICES_MATCH_PATTERN" : "Unable to fetch mapping. Do you have indices matching the pattern?",
- "KIBANA-ADD_NEW" : "Create Index Pattern",
- "KIBANA-SEE" : "See",
- "KIBANA-CREATE" : "Create",
- "KIBANA-FIELD_IS_REQUIRED": "{{fieldName}} is required"
+ "KIBANA-CREATE_INDEX_PATTERN_BUTTON" : "Create Index Pattern"
}
diff --git a/src/ui/public/directives/__tests__/validate_index_name.js b/src/ui/public/directives/__tests__/validate_index_pattern.js
similarity index 91%
rename from src/ui/public/directives/__tests__/validate_index_name.js
rename to src/ui/public/directives/__tests__/validate_index_pattern.js
index 72667f91a89f6..6ac547cb74e92 100644
--- a/src/ui/public/directives/__tests__/validate_index_name.js
+++ b/src/ui/public/directives/__tests__/validate_index_pattern.js
@@ -1,14 +1,14 @@
import expect from 'expect.js';
import ngMock from 'ng_mock';
-import 'ui/directives/validate_index_name';
+import 'ui/directives/validate_index_pattern';
// Load the kibana app dependencies.
-describe('Validate index name directive', function () {
+describe('Validate index pattern directive', function () {
let $compile;
let $rootScope;
- const noWildcardHtml = '';
- const allowWildcardHtml = '';
+ const noWildcardHtml = '';
+ const allowWildcardHtml = '';
beforeEach(ngMock.module('kibana'));
diff --git a/src/ui/public/directives/info.js b/src/ui/public/directives/info.js
index ee0ccbf1eb0ef..5099c72fba922 100644
--- a/src/ui/public/directives/info.js
+++ b/src/ui/public/directives/info.js
@@ -1,4 +1,4 @@
-import html from 'ui/partials/info.html';
+import template from 'ui/partials/info.html';
import { uiModules } from 'ui/modules';
uiModules
@@ -10,7 +10,7 @@ uiModules
info: '@',
placement: '@'
},
- template: html,
+ template,
link: function ($scope) {
$scope.placement = $scope.placement || 'top';
}
diff --git a/src/ui/public/directives/validate_index_name.js b/src/ui/public/directives/validate_index_pattern.js
similarity index 73%
rename from src/ui/public/directives/validate_index_name.js
rename to src/ui/public/directives/validate_index_pattern.js
index 9d727885f5272..9c3c29d8d55c6 100644
--- a/src/ui/public/directives/validate_index_name.js
+++ b/src/ui/public/directives/validate_index_pattern.js
@@ -4,13 +4,17 @@ import { uiModules } from 'ui/modules';
uiModules
.get('kibana')
- .directive('validateIndexName', function () {
+ .directive('validateIndexPattern', function () {
return {
restrict: 'A',
require: 'ngModel',
link: function ($scope, elem, attr, ngModel) {
const illegalCharacters = ['\\', '/', '?', '"', '<', '>', '|', ' ', ','];
- const allowWildcard = !_.isUndefined(attr.allowWildcard) && attr.allowWildcard !== 'false';
+
+ const allowWildcard =
+ !_.isUndefined(attr.validateIndexPatternAllowWildcard)
+ && attr.validateIndexPatternAllowWildcard !== 'false';
+
if (!allowWildcard) {
illegalCharacters.push('*');
}
@@ -24,7 +28,7 @@ uiModules
return !match;
};
- ngModel.$validators.indexNameInput = function (modelValue, viewValue) {
+ ngModel.$validators.indexPattern = function (modelValue, viewValue) {
return isValid(viewValue);
};
}
diff --git a/src/ui/public/documentation_links/documentation_links.js b/src/ui/public/documentation_links/documentation_links.js
index 4c8c72bbe0ee5..70989a24a4c4f 100644
--- a/src/ui/public/documentation_links/documentation_links.js
+++ b/src/ui/public/documentation_links/documentation_links.js
@@ -21,6 +21,10 @@ export const documentationLinks = {
painlessSyntax: `${ELASTIC_WEBSITE_URL}guide/en/elasticsearch/reference/${DOC_LINK_VERSION}/modules-scripting-painless-syntax.html`,
luceneExpressions: `${ELASTIC_WEBSITE_URL}guide/en/elasticsearch/reference/${DOC_LINK_VERSION}/modules-scripting-expression.html`
},
+ indexPatterns: {
+ loadingData: `${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/tutorial-load-dataset.html`,
+ introduction: `${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/index-patterns.html`,
+ },
query: {
luceneQuerySyntax:
`${ELASTIC_WEBSITE_URL}guide/en/elasticsearch/reference/${DOC_LINK_VERSION}/query-dsl-query-string-query.html#query-string-syntax`,
diff --git a/src/ui/public/partials/info.html b/src/ui/public/partials/info.html
index 01a0670fb7a6a..65091ced75b09 100644
--- a/src/ui/public/partials/info.html
+++ b/src/ui/public/partials/info.html
@@ -1,4 +1,10 @@
-
\ No newline at end of file
+
diff --git a/test/functional/apps/management/_create_index_pattern_wizard.js b/test/functional/apps/management/_create_index_pattern_wizard.js
new file mode 100644
index 0000000000000..0637fbb548ac6
--- /dev/null
+++ b/test/functional/apps/management/_create_index_pattern_wizard.js
@@ -0,0 +1,37 @@
+import expect from 'expect.js';
+
+export default function ({ getService, getPageObjects }) {
+ const kibanaServer = getService('kibanaServer');
+ const PageObjects = getPageObjects(['settings', 'common']);
+
+ describe('"Create Index Pattern" wizard', function () {
+ beforeEach(function () {
+ // delete .kibana index and then wait for Kibana to re-create it
+ return kibanaServer.uiSettings.replace({})
+ .then(function () {
+ return PageObjects.settings.navigateTo();
+ })
+ .then(function () {
+ return PageObjects.settings.clickKibanaIndices();
+ });
+ });
+
+ describe('step 1 next button', function () {
+ it('is disabled by default', function () {
+ return PageObjects.settings.getCreateIndexPatternGoToStep2Button().isEnabled()
+ .then(function (isEnabled) {
+ expect(isEnabled).not.to.be.ok();
+ });
+ });
+
+ it('is enabled once an index pattern with matching indices has been entered', async function () {
+ await PageObjects.settings.setIndexPatternField();
+ await PageObjects.common.sleep(2000);
+ return PageObjects.settings.getCreateIndexPatternGoToStep2Button().isEnabled()
+ .then(function (isEnabled) {
+ expect(isEnabled).to.be.ok();
+ });
+ });
+ });
+ });
+}
diff --git a/test/functional/apps/management/_creation_form_changes.js b/test/functional/apps/management/_creation_form_changes.js
deleted file mode 100644
index 66bafe4bebd26..0000000000000
--- a/test/functional/apps/management/_creation_form_changes.js
+++ /dev/null
@@ -1,32 +0,0 @@
-import expect from 'expect.js';
-
-export default function ({ getService, getPageObjects }) {
- const kibanaServer = getService('kibanaServer');
- const screenshots = getService('screenshots');
- const PageObjects = getPageObjects(['settings', 'common']);
-
- describe('user input reactions', function () {
- beforeEach(function () {
- // delete .kibana index and then wait for Kibana to re-create it
- return kibanaServer.uiSettings.replace({})
- .then(function () {
- return PageObjects.settings.navigateTo();
- })
- .then(function () {
- return PageObjects.settings.clickKibanaIndices();
- });
- });
-
- it('should enable creation after selecting time field', function () {
- // select a time field and check that Create button is enabled
- return PageObjects.settings.selectTimeFieldOption('@timestamp')
- .then(function () {
- return PageObjects.settings.getCreateButton().isEnabled()
- .then(function (enabled) {
- screenshots.take('Settings-indices-enable-creation');
- expect(enabled).to.be.ok();
- });
- });
- });
- });
-}
diff --git a/test/functional/apps/management/_index_pattern_create_delete.js b/test/functional/apps/management/_index_pattern_create_delete.js
index 5f55e744c94b5..523c763bdacf9 100644
--- a/test/functional/apps/management/_index_pattern_create_delete.js
+++ b/test/functional/apps/management/_index_pattern_create_delete.js
@@ -82,7 +82,7 @@ export default function ({ getService, getPageObjects }) {
it('should return to index pattern creation page', function returnToPage() {
return retry.try(function tryingForTime() {
- return PageObjects.settings.getCreateButton();
+ return PageObjects.settings.getCreateIndexPatternGoToStep2Button();
});
});
diff --git a/test/functional/apps/management/_initial_state.js b/test/functional/apps/management/_initial_state.js
deleted file mode 100644
index 50601a33f3462..0000000000000
--- a/test/functional/apps/management/_initial_state.js
+++ /dev/null
@@ -1,44 +0,0 @@
-import expect from 'expect.js';
-
-export default function ({ getService, getPageObjects }) {
- const kibanaServer = getService('kibanaServer');
- const log = getService('log');
- const PageObjects = getPageObjects(['settings', 'common']);
-
- describe('initial state', function () {
- before(function () {
- // delete .kibana index and then wait for Kibana to re-create it
- return kibanaServer.uiSettings.replace({})
- .then(function () {
- return PageObjects.settings.navigateTo();
- })
- .then(function () {
- return PageObjects.settings.clickKibanaIndices();
- });
- });
-
- it('should contain default index pattern', function () {
- const defaultPattern = 'logstash-*';
-
- return PageObjects.settings.getIndexPatternField().getProperty('value')
- .then(function (pattern) {
- expect(pattern).to.be(defaultPattern);
- });
- });
-
- it('should not select the time field', function () {
- return PageObjects.settings.getTimeFieldNameField().isSelected()
- .then(function (timeFieldIsSelected) {
- log.debug('timeField isSelected = ' + timeFieldIsSelected);
- expect(timeFieldIsSelected).to.not.be.ok();
- });
- });
-
- it('should not enable creation', function () {
- return PageObjects.settings.getCreateIndexPatternButton().isEnabled()
- .then(function (enabled) {
- expect(enabled).to.not.be.ok();
- });
- });
- });
-}
diff --git a/test/functional/apps/management/index.js b/test/functional/apps/management/index.js
index afaea2d42cff7..df5de51c23572 100644
--- a/test/functional/apps/management/index.js
+++ b/test/functional/apps/management/index.js
@@ -15,8 +15,7 @@ export default function ({ getService, loadTestFile }) {
await esArchiver.unload('empty_kibana');
});
- loadTestFile(require.resolve('./_initial_state'));
- loadTestFile(require.resolve('./_creation_form_changes'));
+ loadTestFile(require.resolve('./_create_index_pattern_wizard'));
loadTestFile(require.resolve('./_index_pattern_create_delete'));
loadTestFile(require.resolve('./_index_pattern_results_sort'));
loadTestFile(require.resolve('./_index_pattern_popularity'));
diff --git a/test/functional/page_objects/settings_page.js b/test/functional/page_objects/settings_page.js
index 533c9d2374a6d..518b5ba648cb0 100644
--- a/test/functional/page_objects/settings_page.js
+++ b/test/functional/page_objects/settings_page.js
@@ -89,15 +89,6 @@ export function SettingsPageProvider({ getService, getPageObjects }) {
.findDisplayedByCssSelector('option[label="' + selection + '"]');
}
- getCreateIndexPatternButton() {
- return testSubjects.find('createIndexPatternCreateButton');
- }
-
- getCreateButton() {
- return remote.setFindTimeout(defaultFindTimeout)
- .findDisplayedByCssSelector('[type="submit"]');
- }
-
async clickDefaultIndexButton() {
await testSubjects.find('setDefaultIndexPatternButton').click();
await PageObjects.header.waitUntilLoadingHasFinished();
@@ -272,13 +263,16 @@ export function SettingsPageProvider({ getService, getPageObjects }) {
await PageObjects.header.waitUntilLoadingHasFinished();
}
- async createIndexPattern(indexPatternName = 'logstash-*', timefield = '@timestamp') {
+ async createIndexPattern(indexPatternName, timefield = '@timestamp') {
await retry.try(async () => {
await this.navigateTo();
await this.clickKibanaIndices();
await this.setIndexPatternField(indexPatternName);
+ await PageObjects.common.sleep(2000);
+ await this.getCreateIndexPatternGoToStep2Button().click();
+ await PageObjects.common.sleep(2000);
await this.selectTimeFieldOption(timefield);
- await this.getCreateButton().click();
+ await this.getCreateIndexPatternCreateButton().click();
});
await PageObjects.header.waitUntilLoadingHasFinished();
await retry.try(async () => {
@@ -292,12 +286,19 @@ export function SettingsPageProvider({ getService, getPageObjects }) {
});
}
- async setIndexPatternField(pattern) {
- log.debug(`setIndexPatternField(${pattern})`);
- return testSubjects.find('createIndexPatternNameInput')
- .clearValue().type(pattern);
+ async setIndexPatternField(indexPatternName = 'logstash-*') {
+ log.debug(`setIndexPatternField(${indexPatternName})`);
+ return this.getIndexPatternField()
+ .clearValue().type(indexPatternName);
+ }
+
+ getCreateIndexPatternGoToStep2Button() {
+ return testSubjects.find('createIndexPatternGoToStep2Button');
}
+ getCreateIndexPatternCreateButton() {
+ return testSubjects.find('createIndexPatternCreateButton');
+ }
async removeIndexPattern() {
let alertText;
diff --git a/ui_framework/components/info_button/_info_button.scss b/ui_framework/components/info_button/_info_button.scss
index 104dbb9d7cbde..0bd55d7506ddc 100644
--- a/ui_framework/components/info_button/_info_button.scss
+++ b/ui_framework/components/info_button/_info_button.scss
@@ -1,5 +1,6 @@
.kuiInfoButton {
font-size: 16px;
+ line-height: 0;
background-color: transparent;
color: $globalLinkColor;
cursor: pointer;
diff --git a/ui_framework/components/panel/_panel.scss b/ui_framework/components/panel/_panel.scss
index cf8e398fab2fb..bd0e55b41f563 100644
--- a/ui_framework/components/panel/_panel.scss
+++ b/ui_framework/components/panel/_panel.scss
@@ -3,12 +3,29 @@
border-radius: $globalBorderRadius;
}
+.kuiPanel--prompt {
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ text-align: center;
+ justify-content: center;
+ min-height: 300px;
+
+ .kuiPanelBody {
+ padding: 30px;
+ max-width: 500px;
+ }
+}
+
+.kuiPanel--noBorder {
+ border: none;
+}
+
.kuiPanel--withToolBar {
border-top: none;
border-radius: 0;
}
-
.kuiPanel--centered {
display: flex;
justify-content: center;
@@ -25,9 +42,13 @@
border-bottom: $globalBorderThin;
}
+ /**
+ * 1. This way we can use h1, h2, etc.
+ */
.kuiPanelHeader__title {
font-size: $globalTitleFontSize;
line-height: $globalLineHeight;
+ margin: 0; /* 1 */
}
/**
diff --git a/ui_framework/components/table/_controlled_table.scss b/ui_framework/components/table/_controlled_table.scss
index 57993e52bdced..8d8d241685bad 100644
--- a/ui_framework/components/table/_controlled_table.scss
+++ b/ui_framework/components/table/_controlled_table.scss
@@ -1,5 +1,5 @@
/**
- * 1. Make seamless transition from ToolBar to Table header.
+ * 1. Make seamless transition from ToolBar to Table header and contained Menu.
* 1. Make seamless transition from Table to ToolBarFooter header.
*/
.kuiControlledTable {
@@ -10,4 +10,8 @@
.kuiToolBarFooter {
border-top: none; /* 2 */
}
+
+ .kuiMenu--contained {
+ border-top: none; /* 1 */
+ }
}
diff --git a/ui_framework/dist/ui_framework.css b/ui_framework/dist/ui_framework.css
index 9938b1eb38df5..99b2785037246 100644
--- a/ui_framework/dist/ui_framework.css
+++ b/ui_framework/dist/ui_framework.css
@@ -1450,6 +1450,7 @@ body {
.kuiInfoButton {
font-size: 16px;
+ line-height: 0;
background-color: transparent;
color: #0079a5;
cursor: pointer;
@@ -2568,6 +2569,33 @@ body {
border: 1px solid #D9D9D9;
border-radius: 4px; }
+.kuiPanel--prompt {
+ display: -webkit-box;
+ display: -webkit-flex;
+ display: -ms-flexbox;
+ display: flex;
+ -webkit-box-orient: vertical;
+ -webkit-box-direction: normal;
+ -webkit-flex-direction: column;
+ -ms-flex-direction: column;
+ flex-direction: column;
+ -webkit-box-align: center;
+ -webkit-align-items: center;
+ -ms-flex-align: center;
+ align-items: center;
+ text-align: center;
+ -webkit-box-pack: center;
+ -webkit-justify-content: center;
+ -ms-flex-pack: center;
+ justify-content: center;
+ min-height: 300px; }
+ .kuiPanel--prompt .kuiPanelBody {
+ padding: 30px;
+ max-width: 500px; }
+
+.kuiPanel--noBorder {
+ border: none; }
+
.kuiPanel--withToolBar {
border-top: none;
border-radius: 0; }
@@ -2644,9 +2672,14 @@ body {
outline: none;
border-color: #0079a5; }
+/**
+ * 1. This way we can use h1, h2, etc.
+ */
.kuiPanelHeader__title {
font-size: 18px;
- line-height: 1.5; }
+ line-height: 1.5;
+ margin: 0;
+ /* 1 */ }
/**
* 1. Undo what barSection mixin does.
@@ -2759,7 +2792,7 @@ body {
/* 2 */ }
/**
- * 1. Make seamless transition from ToolBar to Table header.
+ * 1. Make seamless transition from ToolBar to Table header and contained Menu.
* 1. Make seamless transition from Table to ToolBarFooter header.
*/
.kuiControlledTable .kuiTable {
@@ -2770,6 +2803,10 @@ body {
border-top: none;
/* 2 */ }
+.kuiControlledTable .kuiMenu--contained {
+ border-top: none;
+ /* 1 */ }
+
/**
* 1. Prevent cells from expanding based on content size. This substitutes for table-layout: fixed.
*/
From 4a73c23970dc958cd6d76fa716ef4b15b8b7bf0a Mon Sep 17 00:00:00 2001
From: CJ Cenizal
Date: Thu, 6 Jul 2017 13:16:36 -0700
Subject: [PATCH 2/9] Remove all translations.
---
.../create_index_pattern_wizard.html | 54 +++++++++--------
.../create_index_pattern_wizard.js | 9 ++-
.../matching_indices_list.html | 14 ++---
.../step_index_pattern.html | 24 ++++----
.../step_time_field/step_time_field.html | 60 ++++++++++---------
.../step_time_field/step_time_field.js | 6 +-
.../edit_index_pattern.html | 3 +-
.../management/sections/indices/index.html | 7 ++-
src/core_plugins/kibana/translations/en.json | 37 +-----------
9 files changed, 89 insertions(+), 125 deletions(-)
diff --git a/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/create_index_pattern_wizard.html b/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/create_index_pattern_wizard.html
index 9a5a543ce988c..32043dcc26f6f 100644
--- a/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/create_index_pattern_wizard.html
+++ b/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/create_index_pattern_wizard.html
@@ -8,10 +8,9 @@
-
+
+ Create index pattern
+
@@ -26,18 +25,16 @@
ng-change="controller.onIncludeSystemIndicesChange()"
>
-
+
+ Include system indices
+
-
+
+ Kibana uses index patterns to retrieve data from Elasticsearch, for things like visualizations.
+
-
+
+ Next step
+
-
+
+ You only have a single index. You can create an index pattern to match it.
+
Your index pattern can match any of your {{stepIndexPattern.allIndices.length}} indices, below.
diff --git a/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/step_time_field/step_time_field.html b/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/step_time_field/step_time_field.html
index 49827ba599c39..fa732337a0cfc 100644
--- a/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/step_time_field/step_time_field.html
+++ b/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/step_time_field/step_time_field.html
@@ -5,10 +5,9 @@
>
-
+
+ Step 2 of 2: Optional settings
+
@@ -24,22 +23,24 @@
id="timeFilterFieldSelectLabel"
class="kuiLabel"
for="timeFilterFieldSelect"
- translate="KIBANA-CREATE_INDEX_PATTERN_STEP_2_TIME_FIELD_LABEL"
- >
+ >
+ Choose optional Time Filter field name
+
+ >
+ Refresh
+
+ >
+ The Time Filter will use this field to filter your data by time.
+
+ With this option selected, searches against any time-based index pattern which contains a wildcard will automatically expand to query only the indices which contain data within the currently selected time range.
+
-
+
+ Searching against the index pattern 'logstash-*' will actually query Elasticsearch for the specific matching indices (e.g. 'logstash-2015.12.21') that fall within the current time range.
+
-
+
+ With recent changes to Elasticsearch, this option should no longer be necessary and will likely be removed in future versions of Kibana.
+
+ No default index pattern. You must select or create one to continue.
+
diff --git a/src/core_plugins/kibana/translations/en.json b/src/core_plugins/kibana/translations/en.json
index e2824c99b3a27..ce01f2c8a8a4e 100644
--- a/src/core_plugins/kibana/translations/en.json
+++ b/src/core_plugins/kibana/translations/en.json
@@ -1,40 +1,5 @@
{
"UI-WELCOME_MESSAGE": "Loading Kibana",
"UI-WELCOME_ERROR": "Kibana did not load properly. Check the server output for more information.",
- "KIBANA-CREATE_INDEX_PATTERN_TITLE": "Create index pattern",
- "KIBANA-CREATE_INDEX_PATTERN_INTRO": "Kibana uses index patterns to retrieve data from Elasticsearch, for things like visualizations.",
- "KIBANA-CREATE_INDEX_PATTERN_INCLUDE_SYSTEM_INDICES_CHECKBOX_LABEL": "Include system indices",
- "KIBANA-CREATE_INDEX_PATTERN_LOADING_DATA_TITLE": "Checking for Elasticsearch data",
- "KIBANA-CREATE_INDEX_PATTERN_LOADING_DATA_BODY": "Reticulating splines...",
- "KIBANA-CREATE_INDEX_PATTERN_NO_DATA_TITLE": "Couldn't find any Elasticsearch data",
- "KIBANA-CREATE_INDEX_PATTERN_NO_DATA_BODY": "You'll need to index some data into Elasticsearch before you can create an index pattern.",
- "KIBANA-CREATE_INDEX_PATTERN_NO_DATA_LEARN_LINK": "Learn how.",
- "KIBANA-CREATE_INDEX_PATTERN_NO_DATA_LEARN_LINK_ALT": "Learn how to index data into Elasticsearch",
- "KIBANA-CREATE_INDEX_PATTERN_NO_DATA_RELOAD_BUTTON": "Check for new data",
- "KIBANA-CREATE_INDEX_PATTERN_STEP_1_TITLE": "Step 1 of 2: Define index pattern",
- "KIBANA-CREATE_INDEX_PATTERN_STEP_1_INDEX_PATTERN_LABEL": "Index pattern",
- "KIBANA-CREATE_INDEX_PATTERN_STEP_1_SEARCH_SINGLE_INDEX": "You only have a single index. You can create an index pattern to match it.",
- "KIBANA-CREATE_INDEX_PATTERN_STEP_1_SEARCHING_TITLE": "Looking for matching indices",
- "KIBANA-CREATE_INDEX_PATTERN_STEP_1_SEARCHING_BODY": "Just a sec...",
- "KIBANA-CREATE_INDEX_PATTERN_STEP_1_SUBMIT_BUTTON" : "Next step",
- "KIBANA-CREATE_INDEX_PATTERN_STEP_2_TITLE": "Step 2 of 2: Optional settings",
- "KIBANA-CREATE_INDEX_PATTERN_STEP_2_TIME_FIELD_LABEL": "Choose optional Time Filter field name",
- "KIBANA-CREATE_INDEX_PATTERN_STEP_2_TIME_FIELD_LOADING": "Please wait while we fetch your time field options",
- "KIBANA-CREATE_INDEX_PATTERN_STEP_2_TIME_FIELD_HELP": "The Time Filter will use this field to filter your data by time.",
- "KIBANA-CREATE_INDEX_PATTERN_STEP_2_ADVANCED_OPTIONS_BUTTON": "Advanced Time Field filter options",
- "KIBANA-CREATE_INDEX_PATTERN_STEP_2_EXPAND_LABEL": "Expand index pattern (DEPRECATED)",
- "KIBANA-CREATE_INDEX_PATTERN_STEP_2_EXPAND_CHECKBOX_LABEL": "Expand index pattern when searching",
- "KIBANA-CREATE_INDEX_PATTERN_STEP_2_EXPAND_HELP_1": "With this option selected, searches against any time-based index pattern which contains a wildcard will automatically expand to query only the indices which contain data within the currently selected time range.",
- "KIBANA-CREATE_INDEX_PATTERN_STEP_2_EXPAND_HELP_2": "Searching against the index pattern 'logstash-*' will actually query Elasticsearch for the specific matching indices (e.g. 'logstash-2015.12.21') that fall within the current time range.",
- "KIBANA-CREATE_INDEX_PATTERN_STEP_2_EXPAND_HELP_3": "With recent changes to Elasticsearch, this option should no longer be necessary and will likely be removed in future versions of Kibana.",
- "KIBANA-CREATE_INDEX_PATTERN_STEP_2_NO_DATE_FIELD_OPTION": "I don't want to use the Time Filter",
- "KIBANA-CREATE_INDEX_PATTERN_STEP_2_REFRESH_FIELDS_BUTTON": "Refresh",
- "KIBANA-CREATE_INDEX_PATTERN_STEP_2_NO_TIME_FIELDS": "The indices which match this index pattern don't contain any time fields.",
- "KIBANA-CREATE_INDEX_PATTERN_STEP_2_INDICES_DONT_MATCH_PATTERN": "Could not locate any indices matching that pattern. Please add the index to Elasticsearch",
- "KIBANA-CREATE_INDEX_PATTERN_STEP_2_BACK_BUTTON" : "Back",
- "KIBANA-CREATE_INDEX_PATTERN_STEP_2_SUBMIT_BUTTON" : "Create index pattern",
- "KIBANA-CREATE_INDEX_PATTERN_STEP_2_NO_MAPPING_ERROR" : "Unable to fetch mapping. Do you have indices matching the pattern?",
- "KIBANA-WARNING" : "Warning",
- "KIBANA-NO_DEFAULT_INDEX_PATTERN" : "No default index pattern. You must select or create one to continue.",
- "KIBANA-CREATE_INDEX_PATTERN_BUTTON" : "Create Index Pattern"
+ "KIBANA-WARNING" : "Warning"
}
From c00e7b1e7be47e068335ba370cf81fda1f65f396 Mon Sep 17 00:00:00 2001
From: CJ Cenizal
Date: Thu, 6 Jul 2017 13:24:09 -0700
Subject: [PATCH 3/9] Fix typos in disallowed index pattern characters.
---
.../step_index_pattern/step_index_pattern.html | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/step_index_pattern/step_index_pattern.html b/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/step_index_pattern/step_index_pattern.html
index d53286fba32c4..12c03337f40bc 100644
--- a/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/step_index_pattern/step_index_pattern.html
+++ b/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/step_index_pattern/step_index_pattern.html
@@ -52,7 +52,7 @@
id="indexPatternNameFieldHelp2"
class="kuiText kuiSubduedText"
>
- You can't use empty spaces or the characters \\ / ? \" < > , |.
+ You can't use empty spaces or the characters \ / ? " < > , |.
From 7db6da3628daa35c7ae199f61b1e64e4577c3b66 Mon Sep 17 00:00:00 2001
From: CJ Cenizal
Date: Thu, 6 Jul 2017 13:28:04 -0700
Subject: [PATCH 4/9] Make 'Expand index pattern' deprecation notice more
apparent.
---
.../step_time_field/step_time_field.html | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/step_time_field/step_time_field.html b/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/step_time_field/step_time_field.html
index fa732337a0cfc..9ced2d1cf9893 100644
--- a/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/step_time_field/step_time_field.html
+++ b/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/step_time_field/step_time_field.html
@@ -107,16 +107,16 @@
- With this option selected, searches against any time-based index pattern which contains a wildcard will automatically expand to query only the indices which contain data within the currently selected time range.
+
+ Recent changes to Elasticsearch have made this option largerly unnecessary. It will likely be removed in a future version of Kibana.
- Searching against the index pattern 'logstash-*' will actually query Elasticsearch for the specific matching indices (e.g. 'logstash-2015.12.21') that fall within the current time range.
+ With this option selected, searches against any time-based index pattern which contains a wildcard will automatically expand to query only the indices which contain data within the currently selected time range.
- With recent changes to Elasticsearch, this option should no longer be necessary and will likely be removed in future versions of Kibana.
+ Searching against the index pattern 'logstash-*' will actually query Elasticsearch for the specific matching indices (e.g. 'logstash-2015.12.21') that fall within the current time range.
From ffc879f521c510cbc0ccb53a56d38c2c73ca99c4 Mon Sep 17 00:00:00 2001
From: CJ Cenizal
Date: Thu, 6 Jul 2017 13:34:39 -0700
Subject: [PATCH 5/9] Update UI when errors within array change.
---
.../step_index_pattern/step_index_pattern.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/step_index_pattern/step_index_pattern.js b/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/step_index_pattern/step_index_pattern.js
index 3f4f089169929..854e27aca8891 100644
--- a/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/step_index_pattern/step_index_pattern.js
+++ b/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/step_index_pattern/step_index_pattern.js
@@ -36,7 +36,7 @@ module.directive('stepIndexPattern', function () {
// If the index pattern name is invalid, we should reflect that state in the list.
scope.stepIndexPattern.updateList();
});
- scope.$watch('stepIndexPattern.indexPatternNameForm.$error', () => {
+ scope.$watchCollection('stepIndexPattern.indexPatternNameForm.$error', () => {
// If we immediately replace the input with an invalid string, then only the form state
// changes, but not the `indexPatternName` value, so we need to watch both.
scope.stepIndexPattern.updateList();
From caaf63d92b5b0611bbcea224a2e2869cfa4df1e2 Mon Sep 17 00:00:00 2001
From: CJ Cenizal
Date: Thu, 6 Jul 2017 14:06:57 -0700
Subject: [PATCH 6/9] Remove unused time field error.
---
.../create_index_pattern_wizard.js | 5 -----
1 file changed, 5 deletions(-)
diff --git a/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/create_index_pattern_wizard.js b/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/create_index_pattern_wizard.js
index eef82bbac6046..d93673009eb58 100644
--- a/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/create_index_pattern_wizard.js
+++ b/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/create_index_pattern_wizard.js
@@ -64,7 +64,6 @@ uiModules.get('apps/management')
this.isFetchingTimeFieldOptions = false;
this.isCreatingIndexPattern = false;
this.doesIncludeSystemIndices = false;
- this.timeFieldError = undefined;
let allIndices = [];
let matchingIndices = [];
let partialMatchingIndices = [];
@@ -228,10 +227,6 @@ uiModules.get('apps/management')
this.timeFieldOptions = extractTimeFieldsFromFields(fields);
})
.catch(err => {
- if (err instanceof IndexPatternMissingIndices) {
- this.timeFieldError = 'Unable to fetch mapping. Do you have indices matching the pattern?';
- }
-
notify.error(err);
})
.finally(() => {
From a86fddd5791ad1066fa6eb73c4a1b876c18edaa0 Mon Sep 17 00:00:00 2001
From: CJ Cenizal
Date: Tue, 11 Jul 2017 12:10:58 -0700
Subject: [PATCH 7/9] Update getIndices to support cross-cluster search.
---
.../create_index_pattern_wizard.js | 19 +++++--
.../matching_indices_list.html | 2 +-
src/ui/public/indices/get_indices.js | 57 +++++++++++--------
3 files changed, 46 insertions(+), 32 deletions(-)
diff --git a/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/create_index_pattern_wizard.js b/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/create_index_pattern_wizard.js
index d93673009eb58..8dc091ca2695e 100644
--- a/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/create_index_pattern_wizard.js
+++ b/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/create_index_pattern_wizard.js
@@ -31,6 +31,7 @@ uiModules.get('apps/management')
Private,
Promise
) {
+ const MAX_NUMBER_OF_MATCHING_INDICES = 3;
const indicesService = $injector.get('indices');
const notify = new Notifier();
const refreshKibanaIndex = Private(RefreshKibanaIndex);
@@ -92,7 +93,7 @@ uiModules.get('apps/management')
// All system indices begin with a period.
return indices.filter(index => (
- index.indexOf('.') !== 0
+ index.name.indexOf('.') !== 0
));
};
@@ -123,8 +124,8 @@ uiModules.get('apps/management')
}
const thisFetchMatchingIndicesRequest = mostRecentFetchMatchingIndicesRequest = Promise.all([
- indicesService.getIndices(exactSearchQuery),
- indicesService.getIndices(partialSearchQuery),
+ indicesService.getIndices(exactSearchQuery, MAX_NUMBER_OF_MATCHING_INDICES),
+ indicesService.getIndices(partialSearchQuery, MAX_NUMBER_OF_MATCHING_INDICES),
createReasonableWait(),
])
.then(([
@@ -137,13 +138,17 @@ uiModules.get('apps/management')
updateWhiteListedIndices();
this.isFetchingMatchingIndices = false;
}
+ }).catch(error => {
+ notify.error(error);
});
};
this.fetchExistingIndices = () => {
this.isFetchingExistingIndices = true;
+ const allExistingLocalAndRemoteIndicesPattern = '*,*:*';
+
Promise.all([
- indicesService.getIndices('*'),
+ indicesService.getIndices(allExistingLocalAndRemoteIndicesPattern, MAX_NUMBER_OF_MATCHING_INDICES),
createReasonableWait(),
])
.then(([allIndicesResponse]) => {
@@ -151,6 +156,8 @@ uiModules.get('apps/management')
allIndices = allIndicesResponse.sort();
updateWhiteListedIndices();
this.isFetchingExistingIndices = false;
+ }).catch(error => {
+ notify.error(error);
});
};
@@ -226,8 +233,8 @@ uiModules.get('apps/management')
.then(([fields]) => {
this.timeFieldOptions = extractTimeFieldsFromFields(fields);
})
- .catch(err => {
- notify.error(err);
+ .catch(error => {
+ notify.error(error);
})
.finally(() => {
this.isFetchingTimeFieldOptions = false;
diff --git a/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/matching_indices_list/matching_indices_list.html b/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/matching_indices_list/matching_indices_list.html
index f911b06758a92..18d2d01e46a1a 100644
--- a/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/matching_indices_list/matching_indices_list.html
+++ b/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/matching_indices_list/matching_indices_list.html
@@ -54,7 +54,7 @@
ng-repeat="index in matchingIndicesList.pageOfIndices"
>
- {{index}}
+ {{index.name}}
diff --git a/src/ui/public/indices/get_indices.js b/src/ui/public/indices/get_indices.js
index 8218c07408e87..513f5755f74bd 100644
--- a/src/ui/public/indices/get_indices.js
+++ b/src/ui/public/indices/get_indices.js
@@ -1,34 +1,41 @@
-import { pluck, reduce, size } from 'lodash';
-
export function IndicesGetIndicesProvider(esAdmin) {
- const getIndexNamesFromAliasesResponse = json => {
- // Assume this function won't be called in the event of a 404.
- return reduce(json, (list, { aliases }, indexName) => {
- list.push(indexName);
- if (size(aliases) > 0) {
- list.push(...Object.keys(aliases));
- }
- return list;
- }, []);
- };
-
- const getIndexNamesFromIndicesResponse = json => {
- if (json.status === 404) {
- return [];
+ return async function getIndices(indexPattern, maxNumberOfMatchingIndices) {
+ if (!indexPattern) {
+ throw new Error('Please provide an indexPattern string to getIndices().');
}
- return pluck(json, 'index');
- };
+ if (!maxNumberOfMatchingIndices || maxNumberOfMatchingIndices < 0) {
+ throw new Error('Please provide a maxNumberOfMatchingIndices value greater than 0 to getIndices().');
+ }
- return async function getIndices(query) {
- const aliases = await esAdmin.indices.getAlias({ index: query, allowNoIndices: true, ignore: 404 });
+ const result = await esAdmin.search({
+ index: indexPattern,
+ ignore: [404],
+ body: {
+ size: 0, // no hits
+ aggs: {
+ indices: {
+ terms: {
+ field: '_index',
+ size: maxNumberOfMatchingIndices,
+ }
+ }
+ }
+ }
+ });
- // If aliases return 200, they'll include matching indices, too.
- if (aliases.status === 404) {
- const indices = await esAdmin.cat.indices({ index: query, format: 'json', ignore: 404 });
- return getIndexNamesFromIndicesResponse(indices);
+ if (
+ result.status === 404
+ || !result.aggregations
+ ) {
+ return [];
}
- return getIndexNamesFromAliasesResponse(aliases);
+ const indices = result.aggregations.indices.buckets.map(bucket => ({
+ name: bucket.key,
+ docCount: bucket.doc_count,
+ }));
+
+ return indices;
};
}
From 0619c4400b4f2b1e20ad5bdc4c6c2168ba5fa708 Mon Sep 17 00:00:00 2001
From: CJ Cenizal
Date: Tue, 11 Jul 2017 12:12:29 -0700
Subject: [PATCH 8/9] Increase number of matching indices.
---
.../create_index_pattern_wizard/create_index_pattern_wizard.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/create_index_pattern_wizard.js b/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/create_index_pattern_wizard.js
index 8dc091ca2695e..57dfcb7f1c660 100644
--- a/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/create_index_pattern_wizard.js
+++ b/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/create_index_pattern_wizard.js
@@ -31,7 +31,7 @@ uiModules.get('apps/management')
Private,
Promise
) {
- const MAX_NUMBER_OF_MATCHING_INDICES = 3;
+ const MAX_NUMBER_OF_MATCHING_INDICES = 20;
const indicesService = $injector.get('indices');
const notify = new Notifier();
const refreshKibanaIndex = Private(RefreshKibanaIndex);
From 763dfe84c44632a63ee19cf9b0a6e9091fc1ef67 Mon Sep 17 00:00:00 2001
From: CJ Cenizal
Date: Tue, 11 Jul 2017 15:02:39 -0700
Subject: [PATCH 9/9] WIP
---
.../create_index_pattern_wizard.js | 4 +-
src/ui/public/indices/get_indices.js | 62 +++++++++++++++----
2 files changed, 50 insertions(+), 16 deletions(-)
diff --git a/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/create_index_pattern_wizard.js b/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/create_index_pattern_wizard.js
index 57dfcb7f1c660..c0c0937ede0dc 100644
--- a/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/create_index_pattern_wizard.js
+++ b/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/create_index_pattern_wizard.js
@@ -92,9 +92,7 @@ uiModules.get('apps/management')
}
// All system indices begin with a period.
- return indices.filter(index => (
- index.name.indexOf('.') !== 0
- ));
+ return indices.filter(index => !index.name.startsWith('.'));
};
const updateWhiteListedIndices = () => {
diff --git a/src/ui/public/indices/get_indices.js b/src/ui/public/indices/get_indices.js
index 513f5755f74bd..d9d9a06aa94c4 100644
--- a/src/ui/public/indices/get_indices.js
+++ b/src/ui/public/indices/get_indices.js
@@ -1,3 +1,35 @@
+import { pluck, reduce, size } from 'lodash';
+
+const getIndexNamesFromAliasesResponse = response => {
+ if (response.status === 404) {
+ return [];
+ }
+
+ return reduce(response, (list, { aliases }, indexName) => {
+ if (size(aliases) > 0) {
+ list.push(...Object.keys(aliases).map(alias => ({
+ name: alias,
+ })));
+ }
+
+ return list;
+ }, []);
+};
+
+const getIndexNamesFromSearchResponse = response => {
+ if (
+ response.status === 404
+ || !response.aggregations
+ ) {
+ return [];
+ }
+
+ return response.aggregations.indices.buckets.map(bucket => ({
+ name: bucket.key,
+ docCount: bucket.doc_count,
+ }));
+};
+
export function IndicesGetIndicesProvider(esAdmin) {
return async function getIndices(indexPattern, maxNumberOfMatchingIndices) {
if (!indexPattern) {
@@ -8,9 +40,23 @@ export function IndicesGetIndicesProvider(esAdmin) {
throw new Error('Please provide a maxNumberOfMatchingIndices value greater than 0 to getIndices().');
}
- const result = await esAdmin.search({
+ // Cross-cluster search query missing the index pattern part.
+ if (!indexPattern.split(':')[1]) {
+ return [];
+ }
+
+ // const aliasesResponse = await esAdmin.indices.getAlias({
+ // index: indexPattern,
+ // allowNoIndices: true,
+ // ignore: 404,
+ // });
+
+ const aliases = [];//getIndexNamesFromAliasesResponse(aliasesResponse);
+
+ const searchResponse = await esAdmin.search({
index: indexPattern,
ignore: [404],
+ allow_no_indices: true,
body: {
size: 0, // no hits
aggs: {
@@ -24,18 +70,8 @@ export function IndicesGetIndicesProvider(esAdmin) {
}
});
- if (
- result.status === 404
- || !result.aggregations
- ) {
- return [];
- }
-
- const indices = result.aggregations.indices.buckets.map(bucket => ({
- name: bucket.key,
- docCount: bucket.doc_count,
- }));
+ const indices = getIndexNamesFromSearchResponse(searchResponse);
- return indices;
+ return [...new Set([...aliases, ...indices])];
};
}