Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into kbn-96376-fix-con…
Browse files Browse the repository at this point in the history
…fig-validation
  • Loading branch information
pgayvallet committed Apr 9, 2021
2 parents f85a919 + dfaf3ac commit 9704393
Show file tree
Hide file tree
Showing 165 changed files with 12,764 additions and 1,913 deletions.
4 changes: 4 additions & 0 deletions docs/developer/plugin-list.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -485,6 +485,10 @@ Elastic.
|Welcome to the Kibana rollup plugin! This plugin provides Kibana support for Elasticsearch's rollup feature. Please refer to the Elasticsearch documentation to understand rollup indices and how to create rollup jobs.
|{kib-repo}blob/{branch}/x-pack/plugins/rule_registry/README.md[ruleRegistry]
|The rule registry plugin aims to make it easy for rule type producers to have their rules produce the data that they need to build rich experiences on top of a unified experience, without the risk of mapping conflicts.
|{kib-repo}blob/{branch}/x-pack/plugins/runtime_fields/README.md[runtimeFields]
|Welcome to the home of the runtime field editor and everything related to runtime fields!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,5 @@ export declare type IndexPatternSelectProps = Required<Omit<EuiComboBoxProps<any
indexPatternId: string;
fieldTypes?: string[];
onNoIndexPatterns?: () => void;
maxIndexPatterns?: number;
};
```
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<b>Signature:</b>

```typescript
SearchBar: React.ComponentClass<Pick<Pick<SearchBarProps, "query" | "placeholder" | "isLoading" | "iconType" | "indexPatterns" | "filters" | "dataTestSubj" | "isClearable" | "isInvalid" | "storageKey" | "intl" | "refreshInterval" | "nonKqlMode" | "nonKqlModeHelpText" | "screenTitle" | "disableLanguageSwitcher" | "autoSubmit" | "onRefresh" | "onRefreshChange" | "showQueryInput" | "showDatePicker" | "showAutoRefreshOnly" | "dateRangeFrom" | "dateRangeTo" | "isRefreshPaused" | "customSubmitButton" | "timeHistory" | "indicateNoData" | "onFiltersUpdated" | "savedQuery" | "showSaveQuery" | "onClearSavedQuery" | "showQueryBar" | "showFilterBar" | "onQueryChange" | "onQuerySubmit" | "onSaved" | "onSavedQueryUpdated">, "query" | "placeholder" | "isLoading" | "iconType" | "indexPatterns" | "filters" | "dataTestSubj" | "isClearable" | "isInvalid" | "storageKey" | "refreshInterval" | "nonKqlMode" | "nonKqlModeHelpText" | "screenTitle" | "disableLanguageSwitcher" | "autoSubmit" | "onRefresh" | "onRefreshChange" | "showQueryInput" | "showDatePicker" | "showAutoRefreshOnly" | "dateRangeFrom" | "dateRangeTo" | "isRefreshPaused" | "customSubmitButton" | "timeHistory" | "indicateNoData" | "onFiltersUpdated" | "savedQuery" | "showSaveQuery" | "onClearSavedQuery" | "showQueryBar" | "showFilterBar" | "onQueryChange" | "onQuerySubmit" | "onSaved" | "onSavedQueryUpdated">, any> & {
WrappedComponent: React.ComponentType<Pick<SearchBarProps, "query" | "placeholder" | "isLoading" | "iconType" | "indexPatterns" | "filters" | "dataTestSubj" | "isClearable" | "isInvalid" | "storageKey" | "intl" | "refreshInterval" | "nonKqlMode" | "nonKqlModeHelpText" | "screenTitle" | "disableLanguageSwitcher" | "autoSubmit" | "onRefresh" | "onRefreshChange" | "showQueryInput" | "showDatePicker" | "showAutoRefreshOnly" | "dateRangeFrom" | "dateRangeTo" | "isRefreshPaused" | "customSubmitButton" | "timeHistory" | "indicateNoData" | "onFiltersUpdated" | "savedQuery" | "showSaveQuery" | "onClearSavedQuery" | "showQueryBar" | "showFilterBar" | "onQueryChange" | "onQuerySubmit" | "onSaved" | "onSavedQueryUpdated"> & ReactIntl.InjectedIntlProps>;
SearchBar: React.ComponentClass<Pick<Pick<SearchBarProps, "query" | "placeholder" | "isLoading" | "iconType" | "indexPatterns" | "filters" | "dataTestSubj" | "isClearable" | "intl" | "refreshInterval" | "nonKqlMode" | "nonKqlModeHelpText" | "screenTitle" | "onRefresh" | "onRefreshChange" | "showQueryInput" | "showDatePicker" | "showAutoRefreshOnly" | "dateRangeFrom" | "dateRangeTo" | "isRefreshPaused" | "customSubmitButton" | "timeHistory" | "indicateNoData" | "onFiltersUpdated" | "savedQuery" | "showSaveQuery" | "onClearSavedQuery" | "showQueryBar" | "showFilterBar" | "onQueryChange" | "onQuerySubmit" | "onSaved" | "onSavedQueryUpdated">, "query" | "placeholder" | "isLoading" | "iconType" | "indexPatterns" | "filters" | "dataTestSubj" | "isClearable" | "refreshInterval" | "nonKqlMode" | "nonKqlModeHelpText" | "screenTitle" | "onRefresh" | "onRefreshChange" | "showQueryInput" | "showDatePicker" | "showAutoRefreshOnly" | "dateRangeFrom" | "dateRangeTo" | "isRefreshPaused" | "customSubmitButton" | "timeHistory" | "indicateNoData" | "onFiltersUpdated" | "savedQuery" | "showSaveQuery" | "onClearSavedQuery" | "showQueryBar" | "showFilterBar" | "onQueryChange" | "onQuerySubmit" | "onSaved" | "onSavedQueryUpdated">, any> & {
WrappedComponent: React.ComponentType<Pick<SearchBarProps, "query" | "placeholder" | "isLoading" | "iconType" | "indexPatterns" | "filters" | "dataTestSubj" | "isClearable" | "intl" | "refreshInterval" | "nonKqlMode" | "nonKqlModeHelpText" | "screenTitle" | "onRefresh" | "onRefreshChange" | "showQueryInput" | "showDatePicker" | "showAutoRefreshOnly" | "dateRangeFrom" | "dateRangeTo" | "isRefreshPaused" | "customSubmitButton" | "timeHistory" | "indicateNoData" | "onFiltersUpdated" | "savedQuery" | "showSaveQuery" | "onClearSavedQuery" | "showQueryBar" | "showFilterBar" | "onQueryChange" | "onQuerySubmit" | "onSaved" | "onSavedQueryUpdated"> & ReactIntl.InjectedIntlProps>;
}
```
12 changes: 7 additions & 5 deletions docs/management/advanced-options.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,12 @@ When date histograms use the `auto` interval, Kibana attempts to generate this
number of bars.

[[histogram-maxbars]]`histogram:maxBars`::
Date histograms are not generated with more bars than the value of this property,
scaling values when necessary.
To improve performance, limits the density of date and number histograms across {kib}
using a test query. When the test query contains too many buckets,
the interval between buckets increases. This setting applies separately
to each histogram aggregation, and does not apply to other types of aggregations.
To find the maximum value of this setting, divide the {es} `search.max_buckets`
value by the maximum number of aggregations in each visualization.

[[history-limit]]`history:limit`::
In fields that have history, such as query inputs, show this many recent values.
Expand All @@ -134,9 +138,7 @@ Fields that exist outside of `_source`. Kibana merges these fields into the
document when displaying it.

[[metrics-maxbuckets]]`metrics:max_buckets`::
The maximum numbers of buckets that a single data source can return. This might
arise when the user selects a short interval (for example, 1s) for a long time
period (1 year).
Affects the *TSVB* histogram density. Must be set higher than `histogram:maxBars`.

[[query-allowleadingwildcards]]`query:allowLeadingWildcards`::
Allows a wildcard (*) as the first character in a query clause. Only applies
Expand Down
9 changes: 6 additions & 3 deletions docs/maps/trouble-shooting.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,13 @@ Increase <<settings, `server.maxPayloadBytes`>> for large index patterns.
* Ensure fill color and border color are distinguishable from map tiles. It's hard to see white features on a white background.

[float]
==== Tiles are not displayed
==== Elastic Maps Service basemaps are not displayed
*Maps* uses tile and vector data from Elastic Maps Service by default. See <<maps-connect-to-ems, Connect to Elastic Maps Service>> for more info.

* Ensure your tile server has configured https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS[Cross-Origin Resource Sharing (CORS)] so tile requests from your Kibana domain have permission to access your tile server domain.
* Ensure tiles have the required coordinate system. Vector data must use EPSG:4326 and tiles must use EPSG:3857.
[float]
==== Custom tiles are not displayed
* When using a custom tile service, ensure your tile server has configured https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS[Cross-Origin Resource Sharing (CORS)] so tile requests from your {kib} domain have permission to access your tile server domain.
* Ensure custom vector and tile services have the required coordinate system. Vector data must use EPSG:4326 and tiles must use EPSG:3857.

[float]
==== Coordinate and region map visualizations not available in New Visualization menu
Expand Down
6 changes: 5 additions & 1 deletion docs/settings/alert-action-settings.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,12 @@ You can configure the following settings in the `kibana.yml` file.
+
Disabled action types will not appear as an option when creating new connectors, but existing connectors and actions of that type will remain in {kib} and will not function.

| `xpack.actions`
`.preconfiguredAlertHistoryEsIndex` {ess-icon}
| Enables a preconfigured alert history {es} <<index-action-type, Index>> connector. Defaults to `false`.

| `xpack.actions.preconfigured`
| Specifies preconfigured action IDs and configs. Defaults to {}.
| Specifies preconfigured connector IDs and configs. Defaults to {}.

| `xpack.actions.proxyUrl` {ess-icon}
| Specifies the proxy URL to use, if using a proxy for actions. By default, no proxy is used.
Expand Down
35 changes: 35 additions & 0 deletions docs/user/alerting/action-types/index.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -82,3 +82,38 @@ PUT test
}
}
--------------------------------------------------

[float]
[[preconfigured-connector-alert-history]]
=== Alert history {es} index connector

experimental[] {kib} offers a preconfigured index connector to facilitate indexing active alert data into {es}.

[WARNING]
==================================================
This functionality is experimental and may be changed or removed completely in a future release.
==================================================

To use this connector, set the <<action-settings, `xpack.actions.preconfiguredAlertHistoryEsIndex`>> configuration to `true`.

```js
xpack.actions.preconfiguredAlertHistoryEsIndex: true
```

When creating a new rule, add an <<index-action-type, Index action>> and select the `Alert history Elasticsearch index (preconfigured)` connector.

[role="screenshot"]
image::images/pre-configured-alert-history-connector.png[Select pre-configured alert history connectors]

Documents are indexed using a preconfigured schema that captures the <<defining-alerts-actions-variables, action variables>> available for the rule. By default, these documents are indexed into the `kibana-alert-history-default` index, but you can specify a different index. Index names must start with `kibana-alert-history-` to take advantage of the preconfigured alert history index template.

[IMPORTANT]
==============================================
To write documents to the preconfigured index, you must have `all` or `write` privileges to the `kibana-alert-history-*` indices. Refer to <<xpack-kibana-role-management>> for more information.
==============================================

[NOTE]
==================================================
The `kibana-alert-history-*` indices are not configured to use ILM so they must be maintained manually. If the index size grows large,
consider using the {ref}/docs-delete-by-query.html[delete by query] API to clean up older documents in the index.
==================================================
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,14 @@ two out-of-the box connectors: <<slack-action-type, Slack>> and <<webhook-action
Sensitive properties, such as passwords, can also be stored in the <<creating-keystore, {kib} keystore>>.
==============================================

[float]
[[build-in-preconfigured-connectors]]
==== Built-in preconfigured connectors

{kib} provides one built-in preconfigured connector:

* <<preconfigured-connector-alert-history, Alert history preconfigured {es} index connector>>

[float]
[[managing-pre-configured-connectors]]
==== View preconfigured connectors
Expand All @@ -63,4 +71,4 @@ image::images/pre-configured-connectors-managing.png[Connectors managing tab wit
Clicking a preconfigured connector shows the description, but not the configuration. A message indicates that this is a preconfigured connector.

[role="screenshot"]
image::images/pre-configured-connectors-view-screen.png[Pre-configured connector view details]
image::images/pre-configured-connectors-view-screen.png[Pre-configured connector view details]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 5 additions & 1 deletion docs/user/security/authentication/index.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,11 @@ xpack.security.authc.providers:
order: 1
-----------------------------------------------

Kibana uses SPNEGO, which wraps the Kerberos protocol for use with HTTP, extending it to web applications. At the end of the Kerberos handshake, Kibana will forward the service ticket to Elasticsearch. Elasticsearch will unpack it and it will respond with an access and refresh token which are then used for subsequent authentication.
IMPORTANT: {kib} uses SPNEGO, which wraps the Kerberos protocol for use with HTTP, extending it to web applications.
At the end of the Kerberos handshake, {kib} forwards the service ticket to {es}, then {es} unpacks the service ticket and responds with an access and refresh token, which are used for subsequent authentication.
On every {es} node that {kib} connects to, the keytab file should always contain the HTTP service principal for the {kib} host.
The HTTP service principal name must have the `HTTP/kibana.domain.local@KIBANA.DOMAIN.LOCAL` format.


[[anonymous-authentication]]
==== Anonymous authentication
Expand Down
1 change: 1 addition & 0 deletions src/core/public/doc_links/doc_links_service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@ export class DocLinksService {
indexThreshold: `${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/rule-type-index-threshold.html`,
pagerDutyAction: `${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/pagerduty-action-type.html`,
preconfiguredConnectors: `${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/pre-configured-connectors.html`,
preconfiguredAlertHistoryConnector: `${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/index-action-type.html#preconfigured-connector-alert-history`,
serviceNowAction: `${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/servicenow-action-type.html#configuring-servicenow`,
setupPrerequisites: `${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/alerting-getting-started.html#alerting-setup-prerequisites`,
slackAction: `${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/slack-action-type.html#configuring-slack`,
Expand Down
15 changes: 14 additions & 1 deletion src/core/server/ui_settings/settings/theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ export const getThemeSettings = (
): Record<string, UiSettingsParams> => {
const { availableVersions, defaultDarkMode, defaultVersion } = getThemeInfo(options);

const onlyOneThemeAvailable = !options?.isDist && availableVersions.length === 1;

return {
'theme:darkMode': {
name: i18n.translate('core.ui_settings.params.darkModeTitle', {
Expand All @@ -68,10 +70,21 @@ export const getThemeSettings = (
type: 'select',
options: availableVersions,
description: i18n.translate('core.ui_settings.params.themeVersionText', {
defaultMessage: `Switch between the theme used for the current and next version of Kibana. A page refresh is required for the setting to be applied.`,
defaultMessage:
'Switch between the theme used for the current and next version of Kibana. A page refresh is required for the setting to be applied. {lessOptions}',
values: {
lessOptions: onlyOneThemeAvailable
? '<br><br> There is only one theme available, set <code>KBN_OPTIMIZER_THEMES=v7light,v7dark,v8light,v8dark</code> to get more options.'
: undefined,
},
}),
requiresPageReload: true,
schema: schema.oneOf(availableVersions.map((v) => schema.literal(v)) as [Type<string>]),
optionLabels: onlyOneThemeAvailable
? {
[availableVersions[0]]: `${availableVersions[0]} (only)`,
}
: undefined,
},
};
};
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ kibana_vars=(
xpack.actions.allowedHosts
xpack.actions.enabled
xpack.actions.enabledActionTypes
xpack.actions.preconfiguredAlertHistoryEsIndex
xpack.actions.preconfigured
xpack.actions.proxyHeaders
xpack.actions.proxyRejectUnauthorizedCertificates
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -535,6 +535,9 @@ export class IndexPatternsService {
});
indexPattern.id = response.id;
this.indexPatternCache.set(indexPattern.id, Promise.resolve(indexPattern));
if (this.savedObjectsCache) {
this.savedObjectsCache.push(response as SavedObject<IndexPatternSavedObjectAttrs>);
}
return indexPattern;
}

Expand Down
1 change: 0 additions & 1 deletion src/plugins/data/public/public.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -1560,7 +1560,6 @@ export type IndexPatternSelectProps = Required<Omit<EuiComboBoxProps<any>, 'isLo
indexPatternId: string;
fieldTypes?: string[];
onNoIndexPatterns?: () => void;
maxIndexPatterns?: number;
};

// Warning: (ae-missing-release-tag) "IndexPatternSpec" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ export type IndexPatternSelectProps = Required<
indexPatternId: string;
fieldTypes?: string[];
onNoIndexPatterns?: () => void;
maxIndexPatterns?: number;
};

export type IndexPatternSelectInternalProps = IndexPatternSelectProps & {
Expand All @@ -42,10 +41,6 @@ interface IndexPatternSelectState {
// Needed for React.lazy
// eslint-disable-next-line import/no-default-export
export default class IndexPatternSelect extends Component<IndexPatternSelectInternalProps> {
static defaultProps: {
maxIndexPatterns: 1000;
};

private isMounted: boolean = false;
state: IndexPatternSelectState;

Expand All @@ -67,7 +62,7 @@ export default class IndexPatternSelect extends Component<IndexPatternSelectInte

componentDidMount() {
this.isMounted = true;
this.fetchOptions();
this.fetchOptions('');
this.fetchSelectedIndexPattern(this.props.indexPatternId);
}

Expand Down Expand Up @@ -107,39 +102,59 @@ export default class IndexPatternSelect extends Component<IndexPatternSelectInte
};

debouncedFetch = _.debounce(async (searchValue: string) => {
const { fieldTypes, onNoIndexPatterns, indexPatternService } = this.props;
const indexPatterns = await indexPatternService.find(
`${searchValue}*`,
this.props.maxIndexPatterns
);
const isCurrentSearch = () => {
return this.isMounted && searchValue === this.state.searchValue;
};

// We need this check to handle the case where search results come back in a different
// order than they were sent out. Only load results for the most recent search.
if (searchValue !== this.state.searchValue || !this.isMounted) {
const idsAndTitles = await this.props.indexPatternService.getIdsWithTitle();
if (!isCurrentSearch()) {
return;
}

const options = indexPatterns
.filter((indexPattern) => {
return fieldTypes
? indexPattern.fields.some((field) => {
return fieldTypes.includes(field.type);
})
: true;
})
.map((indexPattern) => {
return {
label: indexPattern.title,
value: indexPattern.id,
};
const options = [];
for (let i = 0; i < idsAndTitles.length; i++) {
if (!idsAndTitles[i].title.toLowerCase().includes(searchValue.toLowerCase())) {
// index pattern excluded due to title not matching search
continue;
}

if (this.props.fieldTypes) {
try {
const indexPattern = await this.props.indexPatternService.get(idsAndTitles[i].id);
if (!isCurrentSearch()) {
return;
}
const hasRequiredFieldTypes = indexPattern.fields.some((field) => {
return this.props.fieldTypes!.includes(field.type);
});
if (!hasRequiredFieldTypes) {
continue;
}
} catch (err) {
// could not load index pattern, exclude it from list.
continue;
}
}

options.push({
label: idsAndTitles[i].title,
value: idsAndTitles[i].id,
});

// Loading each index pattern object requires a network call so just find small number of matching index patterns
// Users can use 'searchValue' to further refine the list and locate their index pattern.
if (options.length > 15) {
break;
}
}

this.setState({
isLoading: false,
options,
});

if (onNoIndexPatterns && searchValue === '' && options.length === 0) {
onNoIndexPatterns();
if (this.props.onNoIndexPatterns && searchValue === '' && options.length === 0) {
this.props.onNoIndexPatterns();
}
}, 300);

Expand Down
Loading

0 comments on commit 9704393

Please sign in to comment.