Skip to content

Commit

Permalink
Merge branch 'master' into security-rule-type
Browse files Browse the repository at this point in the history
  • Loading branch information
kibanamachine authored Aug 2, 2021
2 parents 7f519e8 + df9330a commit 3ef3de9
Show file tree
Hide file tree
Showing 212 changed files with 6,445 additions and 2,179 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

> Warning: This API is now obsolete.
>
> import from "<!-- -->@<!-- -->kbn/field-types" instead
> Import from the "<!-- -->@<!-- -->kbn/field-types" package directly instead. 8.0
>
<b>Signature:</b>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,18 @@ esFilters: {
FILTERS: typeof import("@kbn/es-query").FILTERS;
FilterStateStore: typeof FilterStateStore;
buildEmptyFilter: (isPinned: boolean, index?: string | undefined) => import("@kbn/es-query").Filter;
buildPhrasesFilter: (field: import("@kbn/es-query").IndexPatternFieldBase, params: any[], indexPattern: import("@kbn/es-query").IndexPatternBase) => import("@kbn/es-query").PhrasesFilter;
buildPhrasesFilter: (field: import("@kbn/es-query").IndexPatternFieldBase, params: string[], indexPattern: import("@kbn/es-query").IndexPatternBase) => import("@kbn/es-query").PhrasesFilter;
buildExistsFilter: (field: import("@kbn/es-query").IndexPatternFieldBase, indexPattern: import("@kbn/es-query").IndexPatternBase) => import("@kbn/es-query").ExistsFilter;
buildPhraseFilter: (field: import("@kbn/es-query").IndexPatternFieldBase, value: any, indexPattern: import("@kbn/es-query").IndexPatternBase) => import("@kbn/es-query").PhraseFilter;
buildPhraseFilter: (field: import("@kbn/es-query").IndexPatternFieldBase, value: string | number | boolean, indexPattern: import("@kbn/es-query").IndexPatternBase) => import("@kbn/es-query").PhraseFilter;
buildQueryFilter: (query: any, index: string, alias: string) => import("@kbn/es-query/target_types/filters/build_filters").QueryStringFilter;
buildRangeFilter: (field: import("@kbn/es-query").IndexPatternFieldBase, params: import("@kbn/es-query").RangeFilterParams, indexPattern: import("@kbn/es-query").IndexPatternBase, formattedValue?: string | undefined) => import("@kbn/es-query").RangeFilter;
isPhraseFilter: (filter: any) => filter is import("@kbn/es-query").PhraseFilter;
isExistsFilter: (filter: any) => filter is import("@kbn/es-query").ExistsFilter;
isPhrasesFilter: (filter: any) => filter is import("@kbn/es-query").PhrasesFilter;
isRangeFilter: (filter: any) => filter is import("@kbn/es-query").RangeFilter;
isMatchAllFilter: (filter: any) => filter is import("@kbn/es-query").MatchAllFilter;
isMissingFilter: (filter: any) => filter is import("@kbn/es-query").MissingFilter;
isQueryStringFilter: (filter: any) => filter is import("@kbn/es-query/target_types/filters/build_filters").QueryStringFilter;
isPhraseFilter: (filter: import("@kbn/es-query").FieldFilter) => filter is import("@kbn/es-query").PhraseFilter;
isExistsFilter: (filter: import("@kbn/es-query").FieldFilter) => filter is import("@kbn/es-query").ExistsFilter;
isPhrasesFilter: (filter: import("@kbn/es-query").FieldFilter) => filter is import("@kbn/es-query").PhrasesFilter;
isRangeFilter: (filter?: import("@kbn/es-query").ExistsFilter | import("@kbn/es-query").GeoPolygonFilter | import("@kbn/es-query").PhrasesFilter | import("@kbn/es-query").PhraseFilter | import("@kbn/es-query").MatchAllFilter | import("@kbn/es-query").MissingFilter | import("@kbn/es-query").RangeFilter | import("@kbn/es-query").GeoBoundingBoxFilter | undefined) => filter is import("@kbn/es-query").RangeFilter;
isMatchAllFilter: (filter: import("@kbn/es-query").FieldFilter) => filter is import("@kbn/es-query").MatchAllFilter;
isMissingFilter: (filter: import("@kbn/es-query").FieldFilter) => filter is import("@kbn/es-query").MissingFilter;
isQueryStringFilter: (filter: import("@kbn/es-query").FieldFilter) => filter is import("@kbn/es-query/target_types/filters/build_filters").QueryStringFilter;
isFilterPinned: (filter: import("@kbn/es-query").Filter) => boolean | undefined;
toggleFilterNegated: (filter: import("@kbn/es-query").Filter) => {
meta: {
Expand All @@ -46,7 +46,9 @@ esFilters: {
params?: any;
value?: string | undefined;
};
$state?: import("@kbn/es-query").FilterState | undefined;
$state?: {
store: FilterStateStore;
} | undefined;
query?: any;
};
disableFilter: (filter: import("@kbn/es-query").Filter) => import("@kbn/es-query").Filter;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

> Warning: This API is now obsolete.
>
> import from "<!-- -->@<!-- -->kbn/field-types" instead
> Import from the "<!-- -->@<!-- -->kbn/field-types" package directly instead. 8.0
>
<b>Signature:</b>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,7 @@
| Enumeration | Description |
| --- | --- |
| [BUCKET\_TYPES](./kibana-plugin-plugins-data-public.bucket_types.md) | |
| [ES\_FIELD\_TYPES](./kibana-plugin-plugins-data-public.es_field_types.md) | \* |
| [IndexPatternType](./kibana-plugin-plugins-data-public.indexpatterntype.md) | |
| [KBN\_FIELD\_TYPES](./kibana-plugin-plugins-data-public.kbn_field_types.md) | \* |
| [METRIC\_TYPES](./kibana-plugin-plugins-data-public.metric_types.md) | |
| [QuerySuggestionTypes](./kibana-plugin-plugins-data-public.querysuggestiontypes.md) | |
| [SearchSessionState](./kibana-plugin-plugins-data-public.searchsessionstate.md) | Possible state that current session can be in |
Expand Down Expand Up @@ -107,7 +105,7 @@
| [AggGroupNames](./kibana-plugin-plugins-data-public.agggroupnames.md) | |
| [APPLY\_FILTER\_TRIGGER](./kibana-plugin-plugins-data-public.apply_filter_trigger.md) | |
| [baseFormattersPublic](./kibana-plugin-plugins-data-public.baseformatterspublic.md) | |
| [castEsToKbnFieldTypeName](./kibana-plugin-plugins-data-public.castestokbnfieldtypename.md) | Get the KbnFieldType name for an esType string |
| [castEsToKbnFieldTypeName](./kibana-plugin-plugins-data-public.castestokbnfieldtypename.md) | |
| [connectToQueryState](./kibana-plugin-plugins-data-public.connecttoquerystate.md) | Helper to setup two-way syncing of global data and a state container |
| [createSavedQueryService](./kibana-plugin-plugins-data-public.createsavedqueryservice.md) | |
| [ES\_SEARCH\_STRATEGY](./kibana-plugin-plugins-data-public.es_search_strategy.md) | |
Expand All @@ -120,7 +118,7 @@
| [fieldList](./kibana-plugin-plugins-data-public.fieldlist.md) | |
| [FilterItem](./kibana-plugin-plugins-data-public.filteritem.md) | |
| [FilterLabel](./kibana-plugin-plugins-data-public.filterlabel.md) | |
| [getKbnTypeNames](./kibana-plugin-plugins-data-public.getkbntypenames.md) | Get the esTypes known by all kbnFieldTypes {<!-- -->Array<string>} |
| [getKbnTypeNames](./kibana-plugin-plugins-data-public.getkbntypenames.md) | |
| [INDEX\_PATTERN\_SAVED\_OBJECT\_TYPE](./kibana-plugin-plugins-data-public.index_pattern_saved_object_type.md) | \* |
| [indexPatterns](./kibana-plugin-plugins-data-public.indexpatterns.md) | |
| [injectSearchSourceReferences](./kibana-plugin-plugins-data-public.injectsearchsourcereferences.md) | |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

> Warning: This API is now obsolete.
>
> Please import from the package kbn/es-query directly. This import will be deprecated in v8.0.0.
> Please import from the package kbn/es-query directly. This import will be removed in v8.0.0.
>
<b>Signature:</b>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

> Warning: This API is now obsolete.
>
> import from "<!-- -->@<!-- -->kbn/field-types" instead
> Import from the "<!-- -->@<!-- -->kbn/field-types" package directly instead. 8.0
>
<b>Signature:</b>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ esFilters: {
buildEmptyFilter: (isPinned: boolean, index?: string | undefined) => import("@kbn/es-query").Filter;
buildExistsFilter: (field: import("@kbn/es-query").IndexPatternFieldBase, indexPattern: import("@kbn/es-query").IndexPatternBase) => import("@kbn/es-query").ExistsFilter;
buildFilter: typeof import("@kbn/es-query").buildFilter;
buildPhraseFilter: (field: import("@kbn/es-query").IndexPatternFieldBase, value: any, indexPattern: import("@kbn/es-query").IndexPatternBase) => import("@kbn/es-query").PhraseFilter;
buildPhrasesFilter: (field: import("@kbn/es-query").IndexPatternFieldBase, params: any[], indexPattern: import("@kbn/es-query").IndexPatternBase) => import("@kbn/es-query").PhrasesFilter;
buildPhraseFilter: (field: import("@kbn/es-query").IndexPatternFieldBase, value: string | number | boolean, indexPattern: import("@kbn/es-query").IndexPatternBase) => import("@kbn/es-query").PhraseFilter;
buildPhrasesFilter: (field: import("@kbn/es-query").IndexPatternFieldBase, params: string[], indexPattern: import("@kbn/es-query").IndexPatternBase) => import("@kbn/es-query").PhrasesFilter;
buildRangeFilter: (field: import("@kbn/es-query").IndexPatternFieldBase, params: import("@kbn/es-query").RangeFilterParams, indexPattern: import("@kbn/es-query").IndexPatternBase, formattedValue?: string | undefined) => import("@kbn/es-query").RangeFilter;
isFilterDisabled: (filter: import("@kbn/es-query").Filter) => boolean;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

> Warning: This API is now obsolete.
>
> Please import from the package kbn/es-query directly. This import will be deprecated in v8.0.0.
> Please import from the package kbn/es-query directly. This import will be removed in v8.0.0.
>
<b>Signature:</b>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

> Warning: This API is now obsolete.
>
> Please import from the package kbn/es-query directly. This import will be deprecated in v8.0.0.
> Please import from the package kbn/es-query directly. This import will be removed in v8.0.0.
>
<b>Signature:</b>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

> Warning: This API is now obsolete.
>
> Please import from the package kbn/es-query directly. This import will be deprecated in v8.0.0.
> Please import from the package kbn/es-query directly. This import will be removed in v8.0.0.
>
<b>Signature:</b>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

> Warning: This API is now obsolete.
>
> Please import from the package kbn/es-query directly. This import will be deprecated in v8.0.0.
> Please import from the package kbn/es-query directly. This import will be removed in v8.0.0.
>
<b>Signature:</b>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@
| Enumeration | Description |
| --- | --- |
| [BUCKET\_TYPES](./kibana-plugin-plugins-data-server.bucket_types.md) | |
| [ES\_FIELD\_TYPES](./kibana-plugin-plugins-data-server.es_field_types.md) | \* |
| [KBN\_FIELD\_TYPES](./kibana-plugin-plugins-data-server.kbn_field_types.md) | \* |
| [METRIC\_TYPES](./kibana-plugin-plugins-data-server.metric_types.md) | |

## Functions
Expand Down Expand Up @@ -74,7 +72,7 @@
| [AggGroupLabels](./kibana-plugin-plugins-data-server.agggrouplabels.md) | |
| [AggGroupNames](./kibana-plugin-plugins-data-server.agggroupnames.md) | |
| [buildQueryFromFilters](./kibana-plugin-plugins-data-server.buildqueryfromfilters.md) | |
| [castEsToKbnFieldTypeName](./kibana-plugin-plugins-data-server.castestokbnfieldtypename.md) | Get the KbnFieldType name for an esType string |
| [castEsToKbnFieldTypeName](./kibana-plugin-plugins-data-server.castestokbnfieldtypename.md) | |
| [config](./kibana-plugin-plugins-data-server.config.md) | |
| [ES\_SEARCH\_STRATEGY](./kibana-plugin-plugins-data-server.es_search_strategy.md) | |
| [esFilters](./kibana-plugin-plugins-data-server.esfilters.md) | |
Expand Down
4 changes: 4 additions & 0 deletions docs/management/advanced-options.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -514,6 +514,10 @@ Shows the Timelion tutorial to users when they first open the Timelion app.
Used for calculating automatic intervals in visualizations, this is the number
of buckets to try to represent.

[[timelion-legacyChartsLibrary]]`timelion:legacyChartsLibrary`::
Enables the legacy charts library for timelion charts in Visualize.


[float]
[[kibana-visualization-settings]]
==== Visualization
Expand Down
1 change: 1 addition & 0 deletions docs/user/alerting/alerting-setup.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ If you are using an *on-premises* Elastic Stack deployment:
If you are using an *on-premises* Elastic Stack deployment with <<using-kibana-with-security, *security*>>:

* You must enable Transport Layer Security (TLS) for communication <<configuring-tls-kib-es, between {es} and {kib}>>. {kib} alerting uses <<api-keys, API keys>> to secure background rule checks and actions, and API keys require {ref}/configuring-tls.html#tls-http[TLS on the HTTP interface]. A proxy will not suffice.
* If you have enabled TLS and are still unable to access Alerting, ensure that you have not {ref}/security-settings.html#api-key-service-settings[explicitly disabled API keys].

[float]
[[alerting-setup-production]]
Expand Down
8 changes: 7 additions & 1 deletion packages/kbn-es-query/src/es_query/build_es_query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ import { buildQueryFromLucene } from './from_lucene';
import { Filter, Query } from '../filters';
import { IndexPatternBase } from './types';

/**
* Configurations to be used while constructing an ES query.
* @public
*/
export interface EsQueryConfig {
allowLeadingWildcards: boolean;
queryStringOptions: Record<string, any>;
Expand All @@ -33,6 +37,8 @@ function removeMatchAll<T>(filters: T[]) {
* @param config - an objects with query:allowLeadingWildcards and query:queryString:options UI
* settings in form of { allowLeadingWildcards, queryStringOptions }
* config contains dateformat:tz
*
* @public
*/
export function buildEsQuery(
indexPattern: IndexPatternBase | undefined,
Expand All @@ -47,7 +53,7 @@ export function buildEsQuery(
queries = Array.isArray(queries) ? queries : [queries];
filters = Array.isArray(filters) ? filters : [filters];

const validQueries = queries.filter((query) => has(query, 'query'));
const validQueries = queries.filter((query: any) => has(query, 'query'));
const queriesByLanguage = groupBy(validQueries, 'language');
const kueryQuery = buildQueryFromKuery(
indexPattern,
Expand Down
2 changes: 2 additions & 0 deletions packages/kbn-es-query/src/es_query/decorate_query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ import { DslQuery, isEsQueryString } from './es_query_dsl';
* @param queryStringOptions query:queryString:options from UI settings
* @param dateFormatTZ dateFormat:tz from UI settings
* @returns {object}
*
* @public
*/

export function decorateQuery(
Expand Down
4 changes: 4 additions & 0 deletions packages/kbn-es-query/src/es_query/es_query_dsl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,16 @@ export interface DslTermQuery {
term: Record<string, string>;
}

/**
* @public
*/
export type DslQuery =
| DslRangeQuery
| DslMatchQuery
| DslQueryStringQuery
| DslMatchAllQuery
| DslTermQuery;

/** @internal */
export const isEsQueryString = (query: any): query is DslQueryStringQuery =>
has(query, 'query_string.query');
2 changes: 2 additions & 0 deletions packages/kbn-es-query/src/es_query/filter_matches_index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ import { IndexPatternBase } from '..';
* TODO: We should base this on something better than `filter.meta.key`. We should probably modify
* this to check if `filter.meta.index` matches `indexPattern.id` instead, but that's a breaking
* change.
*
* @internal
*/
export function filterMatchesIndex(filter: Filter, indexPattern?: IndexPatternBase | null) {
if (!filter.meta?.key || !indexPattern) {
Expand Down
8 changes: 8 additions & 0 deletions packages/kbn-es-query/src/es_query/from_filters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,14 @@ const translateToQuery = (filter: Filter) => {
return filter;
};

/**
* @param filters
* @param indexPattern
* @param ignoreFilterIfFieldNotInIndex by default filters that use fields that can't be found in the specified index pattern are not applied. Set this to true if you want to apply them any way.
* @returns An EQL query
*
* @public
*/
export const buildQueryFromFilters = (
filters: Filter[] = [],
indexPattern: IndexPatternBase | undefined,
Expand Down
1 change: 1 addition & 0 deletions packages/kbn-es-query/src/es_query/from_kuery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { Query } from '../filters';
import { fromKueryExpression, toElasticsearchQuery, nodeTypes, KueryNode } from '../kuery';
import { IndexPatternBase } from './types';

/** @internal */
export function buildQueryFromKuery(
indexPattern: IndexPatternBase | undefined,
queries: Query[] = [],
Expand Down
1 change: 1 addition & 0 deletions packages/kbn-es-query/src/es_query/from_lucene.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { Query } from '..';
import { decorateQuery } from './decorate_query';
import { luceneStringToDsl } from './lucene_string_to_dsl';

/** @internal */
export function buildQueryFromLucene(
queries: Query[],
queryStringOptions: Record<string, any>,
Expand Down
1 change: 1 addition & 0 deletions packages/kbn-es-query/src/es_query/handle_nested_filter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import { getFilterField, cleanFilter, Filter } from '../filters';
import { IndexPatternBase } from './types';

/** @internal */
export const handleNestedFilter = (filter: Filter, indexPattern?: IndexPatternBase) => {
if (!indexPattern) return filter;

Expand Down
7 changes: 7 additions & 0 deletions packages/kbn-es-query/src/es_query/lucene_string_to_dsl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@
import { isString } from 'lodash';
import { DslQuery } from './es_query_dsl';

/**
*
* @param query
* @returns
*
* @public
*/
export function luceneStringToDsl(query: string | any): DslQuery {
if (isString(query)) {
if (query.trim() === '') {
Expand Down
2 changes: 2 additions & 0 deletions packages/kbn-es-query/src/es_query/migrate_filter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { getConvertedValueForField } from '../filters';
import { Filter } from '../filters';
import { IndexPatternBase } from './types';

/** @internal */
export interface DeprecatedMatchPhraseFilter extends Filter {
query: {
match: {
Expand All @@ -28,6 +29,7 @@ function isDeprecatedMatchPhraseFilter(filter: any): filter is DeprecatedMatchPh
return Boolean(fieldName && get(filter, ['query', 'match', fieldName, 'type']) === 'phrase');
}

/** @internal */
export function migrateFilter(filter: Filter, indexPattern?: IndexPatternBase) {
if (isDeprecatedMatchPhraseFilter(filter)) {
const fieldName = Object.keys(filter.query.match)[0];
Expand Down
13 changes: 13 additions & 0 deletions packages/kbn-es-query/src/es_query/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,19 @@

import type { estypes } from '@elastic/elasticsearch';

/**
* A field's sub type
* @public
*/
export interface IFieldSubType {
multi?: { parent: string };
nested?: { path: string };
}

/**
* A base interface for an index pattern field
* @public
*/
export interface IndexPatternFieldBase {
name: string;
/**
Expand All @@ -31,6 +40,10 @@ export interface IndexPatternFieldBase {
scripted?: boolean;
}

/**
* A base interface for an index pattern
* @public
*/
export interface IndexPatternBase {
fields: IndexPatternFieldBase[];
id?: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Side Public License, v 1.
*/

import { Filter, FilterMeta, FilterState, FilterStateStore } from './types';
import { Filter, FilterMeta, FilterStateStore } from './types';

export const buildEmptyFilter = (isPinned: boolean, index?: string): Filter => {
const meta: FilterMeta = {
Expand All @@ -15,7 +15,7 @@ export const buildEmptyFilter = (isPinned: boolean, index?: string): Filter => {
alias: null,
index,
};
const $state: FilterState = {
const $state: Filter['$state'] = {
store: isPinned ? FilterStateStore.GLOBAL_STATE : FilterStateStore.APP_STATE,
};

Expand Down
Loading

0 comments on commit 3ef3de9

Please sign in to comment.