diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS
index 03a4f9520c2ba..d81f6af4cec28 100644
--- a/.github/CODEOWNERS
+++ b/.github/CODEOWNERS
@@ -64,11 +64,12 @@
/src/apm.js @watson @vigneshshanmugam
# Client Side Monitoring (lives in APM directories but owned by Uptime)
-/x-pack/plugins/apm/e2e/cypress/support/step_definitions/rum @elastic/uptime
+/x-pack/plugins/apm/e2e/cypress/support/step_definitions/csm @elastic/uptime
/x-pack/plugins/apm/public/application/csmApp.tsx @elastic/uptime
/x-pack/plugins/apm/public/components/app/RumDashboard @elastic/uptime
/x-pack/plugins/apm/server/lib/rum_client @elastic/uptime
/x-pack/plugins/apm/server/routes/rum_client.ts @elastic/uptime
+/x-pack/plugins/apm/server/projections/rum_overview.ts @elastic/uptime
# Beats
/x-pack/legacy/plugins/beats_management/ @elastic/beats
@@ -129,6 +130,7 @@
/packages/kbn-test/ @elastic/kibana-operations
/packages/kbn-ui-shared-deps/ @elastic/kibana-operations
/packages/kbn-es-archiver/ @elastic/kibana-operations
+/packages/kbn-utils/ @elastic/kibana-operations
/src/legacy/server/keystore/ @elastic/kibana-operations
/src/legacy/server/pid/ @elastic/kibana-operations
/src/legacy/server/sass/ @elastic/kibana-operations
@@ -153,6 +155,7 @@
/x-pack/plugins/cloud/ @elastic/kibana-platform
/x-pack/test/saved_objects_field_count/ @elastic/kibana-platform
/packages/kbn-config-schema/ @elastic/kibana-platform
+/packages/kbn-std/ @elastic/kibana-platform
/src/legacy/server/config/ @elastic/kibana-platform
/src/legacy/server/http/ @elastic/kibana-platform
/src/legacy/server/logging/ @elastic/kibana-platform
@@ -294,6 +297,7 @@ x-pack/plugins/telemetry_collection_xpack/schema/xpack_plugins.json @elastic/kib
/x-pack/plugins/infra/**/*.scss @elastic/observability-design
/x-pack/plugins/ingest_manager/**/*.scss @elastic/observability-design
/x-pack/plugins/observability/**/*.scss @elastic/observability-design
+/x-pack/plugins/monitoring/**/*.scss @elastic/observability-design
# Ent. Search design
/x-pack/plugins/enterprise_search/**/*.scss @elastic/ent-search-design
diff --git a/docs/developer/best-practices/images/state_inside_the_link.png b/docs/developer/best-practices/images/state_inside_the_link.png
new file mode 100644
index 0000000000000..833478ccbda68
Binary files /dev/null and b/docs/developer/best-practices/images/state_inside_the_link.png differ
diff --git a/docs/developer/best-practices/index.asciidoc b/docs/developer/best-practices/index.asciidoc
index 42cee6ef0e58a..13ea010d0aa96 100644
--- a/docs/developer/best-practices/index.asciidoc
+++ b/docs/developer/best-practices/index.asciidoc
@@ -122,6 +122,14 @@ In addition, if users are relying on state stored in your app’s URL as
part of your public contract, keep in mind that you may also need to
provide backwards compatibility for bookmarked URLs.
+[discrete]
+=== Routing, Navigation and URL
+
+The {kib} platform provides a set of tools to help developers build consistent experience around routing and browser navigation.
+Some of that tooling is inside `core`, some is available as part of various plugins.
+
+<> to get an idea of available tools and common approaches for handling routing and browser navigation.
+
[discrete]
=== Testing & stability
@@ -131,6 +139,8 @@ Review:
* <>
* <>
+include::navigation.asciidoc[leveloffset=+1]
+
include::stability.asciidoc[leveloffset=+1]
include::security.asciidoc[leveloffset=+1]
diff --git a/docs/developer/best-practices/navigation.asciidoc b/docs/developer/best-practices/navigation.asciidoc
new file mode 100644
index 0000000000000..d01f2c2aa0f95
--- /dev/null
+++ b/docs/developer/best-practices/navigation.asciidoc
@@ -0,0 +1,226 @@
+[[kibana-navigation]]
+== Routing, Navigation and URL
+
+The {kib} platform provides a set of tools to help developers build consistent experience around routing and browser navigation.
+Some of that tooling is inside `core`, some is available as part of various plugins.
+
+The purpose of this guide is to give a high-level overview of available tools and to explain common approaches for handling routing and browser navigation.
+
+This guide covers following topics:
+
+* <>
+* <>
+* <>
+* <>
+* <>
+* <>
+
+[[deep-linking]]
+=== Deep-linking into {kib} apps
+
+Assuming you want to link from your app to *Discover*. When building such URL there are two things to consider:
+
+1. Prepending a proper `basePath`.
+2. Specifying *Discover* state.
+
+==== Prepending a proper `basePath`
+
+To prepend {kib}'s `basePath` use {kib-repo}tree/{branch}/docs/development/core/public/kibana-plugin-core-public.ibasepath.prepend.md[core.http.basePath.prepend] helper:
+
+[source,typescript jsx]
+----
+const discoverUrl = core.http.basePath.prepend(`/discover`);
+
+console.log(discoverUrl); // http://localhost:5601/bpr/s/space/app/discover
+----
+
+==== Specifying state
+
+**Consider a {kib} app URL a part of app's plugin contract:**
+
+. Avoid hardcoding other app's URL in your app's code.
+. Avoid generating other app's state and serializing it into URL query params.
+
+[source,typescript jsx]
+----
+// Avoid relying on other app's state structure in your app's code:
+const discoverUrlWithSomeState = core.http.basePath.prepend(`/discover#/?_g=(filters:!(),refreshInterval:(pause:!t,value:0),time:(from:'2020-09-10T11:39:50.203Z',to:'2020-09-10T11:40:20.249Z'))&_a=(columns:!(_source),filters:!(),index:'90943e30-9a47-11e8-b64d-95841ca0b247',interval:auto,query:(language:kuery,query:''),sort:!())`);
+----
+
+Instead, each app should expose {kib-repo}tree/{branch}/src/plugins/share/public/url_generators/README.md[a URL generator].
+Other apps should use those URL generators for creating URLs.
+
+[source,typescript jsx]
+----
+// Properly generated URL to *Discover* app. Generator code is owned by *Discover* app and available on *Discover*'s plugin contract.
+const discoverUrl = discoverUrlGenerator.createUrl({filters, timeRange});
+----
+
+To get a better idea, take a look at *Discover* URL generator {kib-repo}tree/{branch}/src/plugins/discover/public/url_generator.ts[implementation].
+It allows specifying various **Discover** app state pieces like: index pattern, filters, query, time range and more.
+
+There are two ways to access other's app URL generator in your code:
+
+1. From a plugin contract of a destination app *(preferred)*.
+2. Using URL generator service instance on `share` plugin contract (in case an explicit plugin dependency is not possible).
+
+In case you want other apps to link to your app, then you should create a URL generator and expose it on your plugin's contract.
+
+
+[[navigating-between-kibana-apps]]
+=== Navigating between {kib} apps
+
+{kib} is a single page application and there is a set of simple rules developers should follow
+to make sure there is no page reload when navigating from one place in {kib} to another.
+
+For example, navigation using native browser APIs would cause a full page reload.
+
+[source,js]
+----
+const urlToADashboard = core.http.basePath.prepend(`/dashboard/my-dashboard`);
+
+// this would cause a full page reload:
+window.location.href = urlToADashboard;
+----
+
+To navigate between different {kib} apps without a page reload there are APIs in `core`:
+
+* {kib-repo}tree/{branch}/docs/development/core/public/kibana-plugin-core-public.applicationstart.navigatetoapp.md[core.application.navigateToApp]
+* {kib-repo}tree/{branch}/docs/development/core/public/kibana-plugin-core-public.applicationstart.navigatetourl.md[core.application.navigateToUrl]
+
+*Rendering a link to a different {kib} app on its own would also cause a full page reload:*
+
+[source,typescript jsx]
+----
+const myLink = () =>
+ Go to Dashboard ;
+----
+
+A workaround could be to handle a click, prevent browser navigation and use `core.application.navigateToApp` API:
+
+[source,typescript jsx]
+----
+const MySPALink = () =>
+ {
+ e.preventDefault();
+ core.application.navigateToApp('dashboard', { path: '/my-dashboard' });
+ }}
+ >
+ Go to Dashboard
+ ;
+----
+
+As it would be too much boilerplate to do this for each {kib} link in your app, there is a handy wrapper that helps with it:
+{kib-repo}tree/{branch}/src/plugins/kibana_react/public/app_links/redirect_app_link.tsx#L49[RedirectAppLinks].
+
+[source,typescript jsx]
+----
+const MyApp = () =>
+
+ {/*...*/}
+ {/* navigations using this link will happen in SPA friendly way */}
+ Go to Dashboard
+ {/*...*/}
+
+----
+
+[[routing]]
+=== Setting up internal app routing
+
+It is very common for {kib} apps to use React and React Router.
+Common rules to follow in this scenario:
+
+* Set up `BrowserRouter` and not `HashRouter`.
+* *Initialize your router with `history` instance provided by the `core`.*
+
+This is required to make sure `core` is aware of navigations triggered inside your app, so it could act accordingly when needed.
+
+* `Core`'s {kib-repo}tree/{branch}/docs/development/core/public/kibana-plugin-core-public.scopedhistory.md[ScopedHistory] instance.
+* {kib-repo}tree/{branch}/docs/development/core/public/kibana-plugin-core-public.appmountparameters.history.md[Example usage]
+* {kib-repo}tree/{branch}/test/plugin_functional/plugins/core_plugin_a/public/application.tsx#L120[Example plugin]
+
+Relative links will be resolved relative to your app's route (e.g.: `http://localhost5601/app/{your-app-id}`)
+and setting up internal links in your app in SPA friendly way would look something like:
+
+[source,typescript jsx]
+----
+import {Link} from 'react-router-dom';
+
+const MyInternalLink = () =>
+----
+
+[[history-and-location]]
+=== Using history and browser location
+
+Try to avoid using `window.location` and `window.history` directly. +
+Instead, consider using {kib-repo}tree/{branch}/docs/development/core/public/kibana-plugin-core-public.scopedhistory.md[ScopedHistory]
+instance provided by `core`.
+
+* This way `core` will know about location changes triggered within your app, and it would act accordingly.
+* Some plugins are listening to location changes. Triggering location change manually could lead to unpredictable and hard-to-catch bugs.
+
+Common use-case for using
+`core`'s {kib-repo}tree/{branch}/docs/development/core/public/kibana-plugin-core-public.scopedhistory.md[ScopedHistory] directly:
+
+* Reading/writing query params or hash.
+* Imperatively triggering internal navigations within your app.
+* Listening to browser location changes.
+
+
+[[state-sync]]
+=== Syncing state with URL
+
+Historically {kib} apps store _a lot_ of application state in the URL.
+The most common pattern that {kib} apps follow today is storing state in `_a` and `_g` query params in https://github.com/w33ble/rison-node#readme[rison] format.
+[[query-params]]
+Those query params follow the convention:
+
+* `_g` (*global*) - global UI state that should be shared and synced across multiple apps. common example from Analyze group apps: time range, refresh interval, *pinned* filters.
+* `_a` (*application*) - UI state scoped to current app.
+
+NOTE: After migrating to KP platform we got navigations without page reloads. Since then there is no real need to follow `_g` and `_a` separation anymore. It's up you to decide if you want to follow this pattern or if you prefer a single query param or something else. The need for this separation earlier is explained in <>.
+
+There are utils to help you to implement such kind of state syncing.
+
+**When you should consider using state syncing utils:**
+
+* You want to sync your application state with URL in similar manner Analyze group applications do.
+* You want to follow platform's <> out of the box.
+* You want to support `state:storeInSessionStore` escape hatch for URL overflowing out of the box.
+* You should also consider using them if you'd like to serialize state to different (not `rison`) format. Utils are composable, and you can implement your own `storage`.
+* In case you want to sync part of your state with URL, but other part of it with browser storage.
+
+**When you shouldn't use state syncing utils:**
+
+* Adding a query param flag or simple key/value to the URL.
+
+Follow {kib-repo}tree/{branch}/src/plugins/kibana_utils/docs/state_sync#state-syncing-utilities[these] docs to learn more.
+
+
+[[preserve-state]]
+=== Preserving state between navigations
+
+Consider the scenario:
+
+1. You are in *Dashboard* app looking at a dashboard with some filters applied;
+2. Navigate to *Discover* using in-app navigation;
+3. Change the time filter'
+4. Navigate to *Dashboard* using in-app navigation.
+
+You'd notice that you were navigated to *Dashboard* app with the *same state* that you left it with,
+except that the time filter has changed to the one you applied on *Discover* app.
+
+Historically {kib} Analyze groups apps achieve that behavior relying on state in the URL.
+If you'd have a closer look on a link in the navigation,
+you'd notice that state is stored inside that link, and it also gets updated whenever relevant state changes happen:
+
+[role="screenshot"]
+image:images/state_inside_the_link.png[State is stored inside the navigation link]
+
+This is where <> into `_a` and `_g` query params comes into play. What is considered a *global* state gets constantly updated in those navigation links. In the example above it was a time filter.
+This is backed by {kib-repo}tree/{branch}/src/plugins/kibana_utils/public/state_management/url/kbn_url_tracker.ts#L57[KbnUrlTracker] util. You can use it to achieve similar behavior.
+
+NOTE: After migrating to KP navigation works without page reloads and all plugins are loaded simultaneously.
+Hence, likely there are simpler ways to preserve state of your application, unless you want to do it through URL.
diff --git a/docs/developer/plugin/external-plugin-functional-tests.asciidoc b/docs/developer/plugin/external-plugin-functional-tests.asciidoc
index 7e5b5b79d06e9..b39d576d85268 100644
--- a/docs/developer/plugin/external-plugin-functional-tests.asciidoc
+++ b/docs/developer/plugin/external-plugin-functional-tests.asciidoc
@@ -13,7 +13,7 @@ To get started copy and paste this example to `test/functional/config.js`:
["source","js"]
-----------
import { resolve } from 'path';
-import { REPO_ROOT } from '@kbn/dev-utils';
+import { REPO_ROOT } from '@kbn/utils';
import { MyServiceProvider } from './services/my_service';
import { MyAppPageProvider } from './services/my_app_page';
diff --git a/docs/development/core/public/kibana-plugin-core-public.assertnever.md b/docs/development/core/public/kibana-plugin-core-public.assertnever.md
deleted file mode 100644
index 8fefd4450d49b..0000000000000
--- a/docs/development/core/public/kibana-plugin-core-public.assertnever.md
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-[Home](./index.md) > [kibana-plugin-core-public](./kibana-plugin-core-public.md) > [assertNever](./kibana-plugin-core-public.assertnever.md)
-
-## assertNever() function
-
-Can be used in switch statements to ensure we perform exhaustive checks, see https://www.typescriptlang.org/docs/handbook/advanced-types.html\#exhaustiveness-checking
-
-Signature:
-
-```typescript
-export declare function assertNever(x: never): never;
-```
-
-## Parameters
-
-| Parameter | Type | Description |
-| --- | --- | --- |
-| x | never
| |
-
-Returns:
-
-`never`
-
diff --git a/docs/development/core/public/kibana-plugin-core-public.deepfreeze.md b/docs/development/core/public/kibana-plugin-core-public.deepfreeze.md
deleted file mode 100644
index 7c879b659a852..0000000000000
--- a/docs/development/core/public/kibana-plugin-core-public.deepfreeze.md
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-[Home](./index.md) > [kibana-plugin-core-public](./kibana-plugin-core-public.md) > [deepFreeze](./kibana-plugin-core-public.deepfreeze.md)
-
-## deepFreeze() function
-
-Apply Object.freeze to a value recursively and convert the return type to Readonly variant recursively
-
-Signature:
-
-```typescript
-export declare function deepFreeze(object: T): RecursiveReadonly;
-```
-
-## Parameters
-
-| Parameter | Type | Description |
-| --- | --- | --- |
-| object | T
| |
-
-Returns:
-
-`RecursiveReadonly`
-
diff --git a/docs/development/core/public/kibana-plugin-core-public.freezable.md b/docs/development/core/public/kibana-plugin-core-public.freezable.md
deleted file mode 100644
index fee87dde25c28..0000000000000
--- a/docs/development/core/public/kibana-plugin-core-public.freezable.md
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-[Home](./index.md) > [kibana-plugin-core-public](./kibana-plugin-core-public.md) > [Freezable](./kibana-plugin-core-public.freezable.md)
-
-## Freezable type
-
-
-Signature:
-
-```typescript
-export declare type Freezable = {
- [k: string]: any;
-} | any[];
-```
diff --git a/docs/development/core/public/kibana-plugin-core-public.getflattenedobject.md b/docs/development/core/public/kibana-plugin-core-public.getflattenedobject.md
deleted file mode 100644
index 3ef9b6bf703eb..0000000000000
--- a/docs/development/core/public/kibana-plugin-core-public.getflattenedobject.md
+++ /dev/null
@@ -1,30 +0,0 @@
-
-
-[Home](./index.md) > [kibana-plugin-core-public](./kibana-plugin-core-public.md) > [getFlattenedObject](./kibana-plugin-core-public.getflattenedobject.md)
-
-## getFlattenedObject() function
-
-Flattens a deeply nested object to a map of dot-separated paths pointing to all primitive values \*\*and arrays\*\* from `rootValue`.
-
-example: getFlattenedObject({ a: { b: 1, c: \[2,3\] } }) // => { 'a.b': 1, 'a.c': \[2,3\] }
-
-Signature:
-
-```typescript
-export declare function getFlattenedObject(rootValue: Record): {
- [key: string]: any;
-};
-```
-
-## Parameters
-
-| Parameter | Type | Description |
-| --- | --- | --- |
-| rootValue | Record<string, any>
| |
-
-Returns:
-
-`{
- [key: string]: any;
-}`
-
diff --git a/docs/development/core/public/kibana-plugin-core-public.isrelativeurl.md b/docs/development/core/public/kibana-plugin-core-public.isrelativeurl.md
deleted file mode 100644
index 3c2ffa6340a97..0000000000000
--- a/docs/development/core/public/kibana-plugin-core-public.isrelativeurl.md
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-[Home](./index.md) > [kibana-plugin-core-public](./kibana-plugin-core-public.md) > [isRelativeUrl](./kibana-plugin-core-public.isrelativeurl.md)
-
-## isRelativeUrl() function
-
-Determine if a url is relative. Any url including a protocol, hostname, or port is not considered relative. This means that absolute \*paths\* are considered to be relative \*urls\*
-
-Signature:
-
-```typescript
-export declare function isRelativeUrl(candidatePath: string): boolean;
-```
-
-## Parameters
-
-| Parameter | Type | Description |
-| --- | --- | --- |
-| candidatePath | string
| |
-
-Returns:
-
-`boolean`
-
diff --git a/docs/development/core/public/kibana-plugin-core-public.md b/docs/development/core/public/kibana-plugin-core-public.md
index 08b12190ef638..f2bf72a597656 100644
--- a/docs/development/core/public/kibana-plugin-core-public.md
+++ b/docs/development/core/public/kibana-plugin-core-public.md
@@ -27,16 +27,6 @@ The plugin integrates with the core system via lifecycle events: `setup`
| [AppNavLinkStatus](./kibana-plugin-core-public.appnavlinkstatus.md) | Status of the application's navLink. |
| [AppStatus](./kibana-plugin-core-public.appstatus.md) | Accessibility status of an application. |
-## Functions
-
-| Function | Description |
-| --- | --- |
-| [assertNever(x)](./kibana-plugin-core-public.assertnever.md) | Can be used in switch statements to ensure we perform exhaustive checks, see https://www.typescriptlang.org/docs/handbook/advanced-types.html\#exhaustiveness-checking |
-| [deepFreeze(object)](./kibana-plugin-core-public.deepfreeze.md) | Apply Object.freeze to a value recursively and convert the return type to Readonly variant recursively |
-| [getFlattenedObject(rootValue)](./kibana-plugin-core-public.getflattenedobject.md) | Flattens a deeply nested object to a map of dot-separated paths pointing to all primitive values \*\*and arrays\*\* from rootValue
.example: getFlattenedObject({ a: { b: 1, c: \[2,3\] } }) // => { 'a.b': 1, 'a.c': \[2,3\] } |
-| [isRelativeUrl(candidatePath)](./kibana-plugin-core-public.isrelativeurl.md) | Determine if a url is relative. Any url including a protocol, hostname, or port is not considered relative. This means that absolute \*paths\* are considered to be relative \*urls\* |
-| [modifyUrl(url, urlModifier)](./kibana-plugin-core-public.modifyurl.md) | Takes a URL and a function that takes the meaningful parts of the URL as a key-value object, modifies some or all of the parts, and returns the modified parts formatted again as a url.Url Parts sent: - protocol - slashes (does the url have the //) - auth - hostname (just the name of the host, no port or auth information) - port - pathname (the path after the hostname, no query or hash, starts with a slash if there was a path) - query (always an object, even when no query on original url) - hashWhy? - The default url library in node produces several conflicting properties on the "parsed" output. Modifying any of these might lead to the modifications being ignored (depending on which property was modified) - It's not always clear whether to use path/pathname, host/hostname, so this tries to add helpful constraints |
-
## Interfaces
| Interface | Description |
@@ -128,7 +118,6 @@ The plugin integrates with the core system via lifecycle events: `setup`
| [ToastOptions](./kibana-plugin-core-public.toastoptions.md) | Options available for [IToasts](./kibana-plugin-core-public.itoasts.md) APIs. |
| [UiSettingsParams](./kibana-plugin-core-public.uisettingsparams.md) | UiSettings parameters defined by the plugins. |
| [UiSettingsState](./kibana-plugin-core-public.uisettingsstate.md) | |
-| [URLMeaningfulParts](./kibana-plugin-core-public.urlmeaningfulparts.md) | We define our own typings because the current version of @types/node declares properties to be optional "hostname?: string". Although, parse call returns "hostname: null \| string". |
| [UserProvidedValues](./kibana-plugin-core-public.userprovidedvalues.md) | Describes the values explicitly set by user. |
## Variables
@@ -156,7 +145,6 @@ The plugin integrates with the core system via lifecycle events: `setup`
| [ChromeHelpExtensionMenuLink](./kibana-plugin-core-public.chromehelpextensionmenulink.md) | |
| [ChromeNavLinkUpdateableFields](./kibana-plugin-core-public.chromenavlinkupdateablefields.md) | |
| [FatalErrorsStart](./kibana-plugin-core-public.fatalerrorsstart.md) | FatalErrors stop the Kibana Public Core and displays a fatal error screen with details about the Kibana build and the error. |
-| [Freezable](./kibana-plugin-core-public.freezable.md) | |
| [HandlerContextType](./kibana-plugin-core-public.handlercontexttype.md) | Extracts the type of the first argument of a [HandlerFunction](./kibana-plugin-core-public.handlerfunction.md) to represent the type of the context. |
| [HandlerFunction](./kibana-plugin-core-public.handlerfunction.md) | A function that accepts a context object and an optional number of additional arguments. Used for the generic types in [IContextContainer](./kibana-plugin-core-public.icontextcontainer.md) |
| [HandlerParameters](./kibana-plugin-core-public.handlerparameters.md) | Extracts the types of the additional arguments of a [HandlerFunction](./kibana-plugin-core-public.handlerfunction.md), excluding the [HandlerContextType](./kibana-plugin-core-public.handlercontexttype.md). |
diff --git a/docs/development/core/public/kibana-plugin-core-public.modifyurl.md b/docs/development/core/public/kibana-plugin-core-public.modifyurl.md
deleted file mode 100644
index b174f733a5c64..0000000000000
--- a/docs/development/core/public/kibana-plugin-core-public.modifyurl.md
+++ /dev/null
@@ -1,31 +0,0 @@
-
-
-[Home](./index.md) > [kibana-plugin-core-public](./kibana-plugin-core-public.md) > [modifyUrl](./kibana-plugin-core-public.modifyurl.md)
-
-## modifyUrl() function
-
-Takes a URL and a function that takes the meaningful parts of the URL as a key-value object, modifies some or all of the parts, and returns the modified parts formatted again as a url.
-
-Url Parts sent: - protocol - slashes (does the url have the //) - auth - hostname (just the name of the host, no port or auth information) - port - pathname (the path after the hostname, no query or hash, starts with a slash if there was a path) - query (always an object, even when no query on original url) - hash
-
-Why? - The default url library in node produces several conflicting properties on the "parsed" output. Modifying any of these might lead to the modifications being ignored (depending on which property was modified) - It's not always clear whether to use path/pathname, host/hostname, so this tries to add helpful constraints
-
-Signature:
-
-```typescript
-export declare function modifyUrl(url: string, urlModifier: (urlParts: URLMeaningfulParts) => Partial | void): string;
-```
-
-## Parameters
-
-| Parameter | Type | Description |
-| --- | --- | --- |
-| url | string
| |
-| urlModifier | (urlParts: URLMeaningfulParts) => Partial<URLMeaningfulParts> | void
| |
-
-Returns:
-
-`string`
-
-The modified and reformatted url
-
diff --git a/docs/development/core/public/kibana-plugin-core-public.urlmeaningfulparts.auth.md b/docs/development/core/public/kibana-plugin-core-public.urlmeaningfulparts.auth.md
deleted file mode 100644
index 238dd66885896..0000000000000
--- a/docs/development/core/public/kibana-plugin-core-public.urlmeaningfulparts.auth.md
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-[Home](./index.md) > [kibana-plugin-core-public](./kibana-plugin-core-public.md) > [URLMeaningfulParts](./kibana-plugin-core-public.urlmeaningfulparts.md) > [auth](./kibana-plugin-core-public.urlmeaningfulparts.auth.md)
-
-## URLMeaningfulParts.auth property
-
-Signature:
-
-```typescript
-auth?: string | null;
-```
diff --git a/docs/development/core/public/kibana-plugin-core-public.urlmeaningfulparts.hash.md b/docs/development/core/public/kibana-plugin-core-public.urlmeaningfulparts.hash.md
deleted file mode 100644
index 161e7dc7ebfae..0000000000000
--- a/docs/development/core/public/kibana-plugin-core-public.urlmeaningfulparts.hash.md
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-[Home](./index.md) > [kibana-plugin-core-public](./kibana-plugin-core-public.md) > [URLMeaningfulParts](./kibana-plugin-core-public.urlmeaningfulparts.md) > [hash](./kibana-plugin-core-public.urlmeaningfulparts.hash.md)
-
-## URLMeaningfulParts.hash property
-
-Signature:
-
-```typescript
-hash?: string | null;
-```
diff --git a/docs/development/core/public/kibana-plugin-core-public.urlmeaningfulparts.hostname.md b/docs/development/core/public/kibana-plugin-core-public.urlmeaningfulparts.hostname.md
deleted file mode 100644
index f1884718337b5..0000000000000
--- a/docs/development/core/public/kibana-plugin-core-public.urlmeaningfulparts.hostname.md
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-[Home](./index.md) > [kibana-plugin-core-public](./kibana-plugin-core-public.md) > [URLMeaningfulParts](./kibana-plugin-core-public.urlmeaningfulparts.md) > [hostname](./kibana-plugin-core-public.urlmeaningfulparts.hostname.md)
-
-## URLMeaningfulParts.hostname property
-
-Signature:
-
-```typescript
-hostname?: string | null;
-```
diff --git a/docs/development/core/public/kibana-plugin-core-public.urlmeaningfulparts.md b/docs/development/core/public/kibana-plugin-core-public.urlmeaningfulparts.md
deleted file mode 100644
index 2816d4c7df541..0000000000000
--- a/docs/development/core/public/kibana-plugin-core-public.urlmeaningfulparts.md
+++ /dev/null
@@ -1,27 +0,0 @@
-
-
-[Home](./index.md) > [kibana-plugin-core-public](./kibana-plugin-core-public.md) > [URLMeaningfulParts](./kibana-plugin-core-public.urlmeaningfulparts.md)
-
-## URLMeaningfulParts interface
-
-We define our own typings because the current version of @types/node declares properties to be optional "hostname?: string". Although, parse call returns "hostname: null \| string".
-
-Signature:
-
-```typescript
-export interface URLMeaningfulParts
-```
-
-## Properties
-
-| Property | Type | Description |
-| --- | --- | --- |
-| [auth](./kibana-plugin-core-public.urlmeaningfulparts.auth.md) | string | null
| |
-| [hash](./kibana-plugin-core-public.urlmeaningfulparts.hash.md) | string | null
| |
-| [hostname](./kibana-plugin-core-public.urlmeaningfulparts.hostname.md) | string | null
| |
-| [pathname](./kibana-plugin-core-public.urlmeaningfulparts.pathname.md) | string | null
| |
-| [port](./kibana-plugin-core-public.urlmeaningfulparts.port.md) | string | null
| |
-| [protocol](./kibana-plugin-core-public.urlmeaningfulparts.protocol.md) | string | null
| |
-| [query](./kibana-plugin-core-public.urlmeaningfulparts.query.md) | ParsedQuery
| |
-| [slashes](./kibana-plugin-core-public.urlmeaningfulparts.slashes.md) | boolean | null
| |
-
diff --git a/docs/development/core/public/kibana-plugin-core-public.urlmeaningfulparts.pathname.md b/docs/development/core/public/kibana-plugin-core-public.urlmeaningfulparts.pathname.md
deleted file mode 100644
index 5ad21f004481c..0000000000000
--- a/docs/development/core/public/kibana-plugin-core-public.urlmeaningfulparts.pathname.md
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-[Home](./index.md) > [kibana-plugin-core-public](./kibana-plugin-core-public.md) > [URLMeaningfulParts](./kibana-plugin-core-public.urlmeaningfulparts.md) > [pathname](./kibana-plugin-core-public.urlmeaningfulparts.pathname.md)
-
-## URLMeaningfulParts.pathname property
-
-Signature:
-
-```typescript
-pathname?: string | null;
-```
diff --git a/docs/development/core/public/kibana-plugin-core-public.urlmeaningfulparts.port.md b/docs/development/core/public/kibana-plugin-core-public.urlmeaningfulparts.port.md
deleted file mode 100644
index 2e70da2f17421..0000000000000
--- a/docs/development/core/public/kibana-plugin-core-public.urlmeaningfulparts.port.md
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-[Home](./index.md) > [kibana-plugin-core-public](./kibana-plugin-core-public.md) > [URLMeaningfulParts](./kibana-plugin-core-public.urlmeaningfulparts.md) > [port](./kibana-plugin-core-public.urlmeaningfulparts.port.md)
-
-## URLMeaningfulParts.port property
-
-Signature:
-
-```typescript
-port?: string | null;
-```
diff --git a/docs/development/core/public/kibana-plugin-core-public.urlmeaningfulparts.protocol.md b/docs/development/core/public/kibana-plugin-core-public.urlmeaningfulparts.protocol.md
deleted file mode 100644
index cedc7f0b878e3..0000000000000
--- a/docs/development/core/public/kibana-plugin-core-public.urlmeaningfulparts.protocol.md
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-[Home](./index.md) > [kibana-plugin-core-public](./kibana-plugin-core-public.md) > [URLMeaningfulParts](./kibana-plugin-core-public.urlmeaningfulparts.md) > [protocol](./kibana-plugin-core-public.urlmeaningfulparts.protocol.md)
-
-## URLMeaningfulParts.protocol property
-
-Signature:
-
-```typescript
-protocol?: string | null;
-```
diff --git a/docs/development/core/public/kibana-plugin-core-public.urlmeaningfulparts.query.md b/docs/development/core/public/kibana-plugin-core-public.urlmeaningfulparts.query.md
deleted file mode 100644
index a9541efe0882a..0000000000000
--- a/docs/development/core/public/kibana-plugin-core-public.urlmeaningfulparts.query.md
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-[Home](./index.md) > [kibana-plugin-core-public](./kibana-plugin-core-public.md) > [URLMeaningfulParts](./kibana-plugin-core-public.urlmeaningfulparts.md) > [query](./kibana-plugin-core-public.urlmeaningfulparts.query.md)
-
-## URLMeaningfulParts.query property
-
-Signature:
-
-```typescript
-query: ParsedQuery;
-```
diff --git a/docs/development/core/public/kibana-plugin-core-public.urlmeaningfulparts.slashes.md b/docs/development/core/public/kibana-plugin-core-public.urlmeaningfulparts.slashes.md
deleted file mode 100644
index cb28a25f9e162..0000000000000
--- a/docs/development/core/public/kibana-plugin-core-public.urlmeaningfulparts.slashes.md
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-[Home](./index.md) > [kibana-plugin-core-public](./kibana-plugin-core-public.md) > [URLMeaningfulParts](./kibana-plugin-core-public.urlmeaningfulparts.md) > [slashes](./kibana-plugin-core-public.urlmeaningfulparts.slashes.md)
-
-## URLMeaningfulParts.slashes property
-
-Signature:
-
-```typescript
-slashes?: boolean | null;
-```
diff --git a/docs/development/core/server/kibana-plugin-core-server.assertnever.md b/docs/development/core/server/kibana-plugin-core-server.assertnever.md
deleted file mode 100644
index c13c88df9b9bf..0000000000000
--- a/docs/development/core/server/kibana-plugin-core-server.assertnever.md
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [assertNever](./kibana-plugin-core-server.assertnever.md)
-
-## assertNever() function
-
-Can be used in switch statements to ensure we perform exhaustive checks, see https://www.typescriptlang.org/docs/handbook/advanced-types.html\#exhaustiveness-checking
-
-Signature:
-
-```typescript
-export declare function assertNever(x: never): never;
-```
-
-## Parameters
-
-| Parameter | Type | Description |
-| --- | --- | --- |
-| x | never
| |
-
-Returns:
-
-`never`
-
diff --git a/docs/development/core/server/kibana-plugin-core-server.deepfreeze.md b/docs/development/core/server/kibana-plugin-core-server.deepfreeze.md
deleted file mode 100644
index 946050bff0585..0000000000000
--- a/docs/development/core/server/kibana-plugin-core-server.deepfreeze.md
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [deepFreeze](./kibana-plugin-core-server.deepfreeze.md)
-
-## deepFreeze() function
-
-Apply Object.freeze to a value recursively and convert the return type to Readonly variant recursively
-
-Signature:
-
-```typescript
-export declare function deepFreeze(object: T): RecursiveReadonly;
-```
-
-## Parameters
-
-| Parameter | Type | Description |
-| --- | --- | --- |
-| object | T
| |
-
-Returns:
-
-`RecursiveReadonly`
-
diff --git a/docs/development/core/server/kibana-plugin-core-server.freezable.md b/docs/development/core/server/kibana-plugin-core-server.freezable.md
deleted file mode 100644
index 32ba89e8370c1..0000000000000
--- a/docs/development/core/server/kibana-plugin-core-server.freezable.md
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [Freezable](./kibana-plugin-core-server.freezable.md)
-
-## Freezable type
-
-
-Signature:
-
-```typescript
-export declare type Freezable = {
- [k: string]: any;
-} | any[];
-```
diff --git a/docs/development/core/server/kibana-plugin-core-server.getflattenedobject.md b/docs/development/core/server/kibana-plugin-core-server.getflattenedobject.md
deleted file mode 100644
index 2e7850ca579f6..0000000000000
--- a/docs/development/core/server/kibana-plugin-core-server.getflattenedobject.md
+++ /dev/null
@@ -1,30 +0,0 @@
-
-
-[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [getFlattenedObject](./kibana-plugin-core-server.getflattenedobject.md)
-
-## getFlattenedObject() function
-
-Flattens a deeply nested object to a map of dot-separated paths pointing to all primitive values \*\*and arrays\*\* from `rootValue`.
-
-example: getFlattenedObject({ a: { b: 1, c: \[2,3\] } }) // => { 'a.b': 1, 'a.c': \[2,3\] }
-
-Signature:
-
-```typescript
-export declare function getFlattenedObject(rootValue: Record): {
- [key: string]: any;
-};
-```
-
-## Parameters
-
-| Parameter | Type | Description |
-| --- | --- | --- |
-| rootValue | Record<string, any>
| |
-
-Returns:
-
-`{
- [key: string]: any;
-}`
-
diff --git a/docs/development/core/server/kibana-plugin-core-server.isrelativeurl.md b/docs/development/core/server/kibana-plugin-core-server.isrelativeurl.md
deleted file mode 100644
index bff9eb05419be..0000000000000
--- a/docs/development/core/server/kibana-plugin-core-server.isrelativeurl.md
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [isRelativeUrl](./kibana-plugin-core-server.isrelativeurl.md)
-
-## isRelativeUrl() function
-
-Determine if a url is relative. Any url including a protocol, hostname, or port is not considered relative. This means that absolute \*paths\* are considered to be relative \*urls\*
-
-Signature:
-
-```typescript
-export declare function isRelativeUrl(candidatePath: string): boolean;
-```
-
-## Parameters
-
-| Parameter | Type | Description |
-| --- | --- | --- |
-| candidatePath | string
| |
-
-Returns:
-
-`boolean`
-
diff --git a/docs/development/core/server/kibana-plugin-core-server.md b/docs/development/core/server/kibana-plugin-core-server.md
index c16600d1d0492..30b98b9f0553e 100644
--- a/docs/development/core/server/kibana-plugin-core-server.md
+++ b/docs/development/core/server/kibana-plugin-core-server.md
@@ -42,13 +42,8 @@ The plugin integrates with the core system via lifecycle events: `setup`
| Function | Description |
| --- | --- |
-| [assertNever(x)](./kibana-plugin-core-server.assertnever.md) | Can be used in switch statements to ensure we perform exhaustive checks, see https://www.typescriptlang.org/docs/handbook/advanced-types.html\#exhaustiveness-checking |
-| [deepFreeze(object)](./kibana-plugin-core-server.deepfreeze.md) | Apply Object.freeze to a value recursively and convert the return type to Readonly variant recursively |
| [exportSavedObjectsToStream({ types, objects, search, savedObjectsClient, exportSizeLimit, includeReferencesDeep, excludeExportDetails, namespace, })](./kibana-plugin-core-server.exportsavedobjectstostream.md) | Generates sorted saved object stream to be used for export. See the [options](./kibana-plugin-core-server.savedobjectsexportoptions.md) for more detailed information. |
-| [getFlattenedObject(rootValue)](./kibana-plugin-core-server.getflattenedobject.md) | Flattens a deeply nested object to a map of dot-separated paths pointing to all primitive values \*\*and arrays\*\* from rootValue
.example: getFlattenedObject({ a: { b: 1, c: \[2,3\] } }) // => { 'a.b': 1, 'a.c': \[2,3\] } |
| [importSavedObjectsFromStream({ readStream, objectLimit, overwrite, createNewCopies, savedObjectsClient, typeRegistry, namespace, })](./kibana-plugin-core-server.importsavedobjectsfromstream.md) | Import saved objects from given stream. See the [options](./kibana-plugin-core-server.savedobjectsimportoptions.md) for more detailed information. |
-| [isRelativeUrl(candidatePath)](./kibana-plugin-core-server.isrelativeurl.md) | Determine if a url is relative. Any url including a protocol, hostname, or port is not considered relative. This means that absolute \*paths\* are considered to be relative \*urls\* |
-| [modifyUrl(url, urlModifier)](./kibana-plugin-core-server.modifyurl.md) | Takes a URL and a function that takes the meaningful parts of the URL as a key-value object, modifies some or all of the parts, and returns the modified parts formatted again as a url.Url Parts sent: - protocol - slashes (does the url have the //) - auth - hostname (just the name of the host, no port or auth information) - port - pathname (the path after the hostname, no query or hash, starts with a slash if there was a path) - query (always an object, even when no query on original url) - hashWhy? - The default url library in node produces several conflicting properties on the "parsed" output. Modifying any of these might lead to the modifications being ignored (depending on which property was modified) - It's not always clear whether to use path/pathname, host/hostname, so this tries to add helpful constraints |
| [resolveSavedObjectsImportErrors({ readStream, objectLimit, retries, savedObjectsClient, typeRegistry, namespace, createNewCopies, })](./kibana-plugin-core-server.resolvesavedobjectsimporterrors.md) | Resolve and return saved object import errors. See the [options](./kibana-plugin-core-server.savedobjectsresolveimporterrorsoptions.md) for more detailed informations. |
## Interfaces
@@ -217,7 +212,6 @@ The plugin integrates with the core system via lifecycle events: `setup`
| [UiSettingsParams](./kibana-plugin-core-server.uisettingsparams.md) | UiSettings parameters defined by the plugins. |
| [UiSettingsServiceSetup](./kibana-plugin-core-server.uisettingsservicesetup.md) | |
| [UiSettingsServiceStart](./kibana-plugin-core-server.uisettingsservicestart.md) | |
-| [URLMeaningfulParts](./kibana-plugin-core-server.urlmeaningfulparts.md) | We define our own typings because the current version of @types/node declares properties to be optional "hostname?: string". Although, parse call returns "hostname: null \| string". |
| [UserProvidedValues](./kibana-plugin-core-server.userprovidedvalues.md) | Describes the values explicitly set by user. |
## Variables
@@ -246,7 +240,6 @@ The plugin integrates with the core system via lifecycle events: `setup`
| [DestructiveRouteMethod](./kibana-plugin-core-server.destructiveroutemethod.md) | Set of HTTP methods changing the state of the server. |
| [ElasticsearchClient](./kibana-plugin-core-server.elasticsearchclient.md) | Client used to query the elasticsearch cluster. |
| [ElasticsearchClientConfig](./kibana-plugin-core-server.elasticsearchclientconfig.md) | Configuration options to be used to create a [cluster client](./kibana-plugin-core-server.iclusterclient.md) using the [createClient API](./kibana-plugin-core-server.elasticsearchservicestart.createclient.md) |
-| [Freezable](./kibana-plugin-core-server.freezable.md) | |
| [GetAuthHeaders](./kibana-plugin-core-server.getauthheaders.md) | Get headers to authenticate a user against Elasticsearch. |
| [GetAuthState](./kibana-plugin-core-server.getauthstate.md) | Gets authentication state for a request. Returned by auth
interceptor. |
| [HandlerContextType](./kibana-plugin-core-server.handlercontexttype.md) | Extracts the type of the first argument of a [HandlerFunction](./kibana-plugin-core-server.handlerfunction.md) to represent the type of the context. |
diff --git a/docs/development/core/server/kibana-plugin-core-server.modifyurl.md b/docs/development/core/server/kibana-plugin-core-server.modifyurl.md
deleted file mode 100644
index fc0bc354a3ca3..0000000000000
--- a/docs/development/core/server/kibana-plugin-core-server.modifyurl.md
+++ /dev/null
@@ -1,31 +0,0 @@
-
-
-[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [modifyUrl](./kibana-plugin-core-server.modifyurl.md)
-
-## modifyUrl() function
-
-Takes a URL and a function that takes the meaningful parts of the URL as a key-value object, modifies some or all of the parts, and returns the modified parts formatted again as a url.
-
-Url Parts sent: - protocol - slashes (does the url have the //) - auth - hostname (just the name of the host, no port or auth information) - port - pathname (the path after the hostname, no query or hash, starts with a slash if there was a path) - query (always an object, even when no query on original url) - hash
-
-Why? - The default url library in node produces several conflicting properties on the "parsed" output. Modifying any of these might lead to the modifications being ignored (depending on which property was modified) - It's not always clear whether to use path/pathname, host/hostname, so this tries to add helpful constraints
-
-Signature:
-
-```typescript
-export declare function modifyUrl(url: string, urlModifier: (urlParts: URLMeaningfulParts) => Partial | void): string;
-```
-
-## Parameters
-
-| Parameter | Type | Description |
-| --- | --- | --- |
-| url | string
| |
-| urlModifier | (urlParts: URLMeaningfulParts) => Partial<URLMeaningfulParts> | void
| |
-
-Returns:
-
-`string`
-
-The modified and reformatted url
-
diff --git a/docs/development/core/server/kibana-plugin-core-server.urlmeaningfulparts.auth.md b/docs/development/core/server/kibana-plugin-core-server.urlmeaningfulparts.auth.md
deleted file mode 100644
index 0422738669a70..0000000000000
--- a/docs/development/core/server/kibana-plugin-core-server.urlmeaningfulparts.auth.md
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [URLMeaningfulParts](./kibana-plugin-core-server.urlmeaningfulparts.md) > [auth](./kibana-plugin-core-server.urlmeaningfulparts.auth.md)
-
-## URLMeaningfulParts.auth property
-
-Signature:
-
-```typescript
-auth?: string | null;
-```
diff --git a/docs/development/core/server/kibana-plugin-core-server.urlmeaningfulparts.hash.md b/docs/development/core/server/kibana-plugin-core-server.urlmeaningfulparts.hash.md
deleted file mode 100644
index 13a3f4a9c95c8..0000000000000
--- a/docs/development/core/server/kibana-plugin-core-server.urlmeaningfulparts.hash.md
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [URLMeaningfulParts](./kibana-plugin-core-server.urlmeaningfulparts.md) > [hash](./kibana-plugin-core-server.urlmeaningfulparts.hash.md)
-
-## URLMeaningfulParts.hash property
-
-Signature:
-
-```typescript
-hash?: string | null;
-```
diff --git a/docs/development/core/server/kibana-plugin-core-server.urlmeaningfulparts.hostname.md b/docs/development/core/server/kibana-plugin-core-server.urlmeaningfulparts.hostname.md
deleted file mode 100644
index 6631f6f6744c5..0000000000000
--- a/docs/development/core/server/kibana-plugin-core-server.urlmeaningfulparts.hostname.md
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [URLMeaningfulParts](./kibana-plugin-core-server.urlmeaningfulparts.md) > [hostname](./kibana-plugin-core-server.urlmeaningfulparts.hostname.md)
-
-## URLMeaningfulParts.hostname property
-
-Signature:
-
-```typescript
-hostname?: string | null;
-```
diff --git a/docs/development/core/server/kibana-plugin-core-server.urlmeaningfulparts.md b/docs/development/core/server/kibana-plugin-core-server.urlmeaningfulparts.md
deleted file mode 100644
index 257f7b4b634ab..0000000000000
--- a/docs/development/core/server/kibana-plugin-core-server.urlmeaningfulparts.md
+++ /dev/null
@@ -1,27 +0,0 @@
-
-
-[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [URLMeaningfulParts](./kibana-plugin-core-server.urlmeaningfulparts.md)
-
-## URLMeaningfulParts interface
-
-We define our own typings because the current version of @types/node declares properties to be optional "hostname?: string". Although, parse call returns "hostname: null \| string".
-
-Signature:
-
-```typescript
-export interface URLMeaningfulParts
-```
-
-## Properties
-
-| Property | Type | Description |
-| --- | --- | --- |
-| [auth](./kibana-plugin-core-server.urlmeaningfulparts.auth.md) | string | null
| |
-| [hash](./kibana-plugin-core-server.urlmeaningfulparts.hash.md) | string | null
| |
-| [hostname](./kibana-plugin-core-server.urlmeaningfulparts.hostname.md) | string | null
| |
-| [pathname](./kibana-plugin-core-server.urlmeaningfulparts.pathname.md) | string | null
| |
-| [port](./kibana-plugin-core-server.urlmeaningfulparts.port.md) | string | null
| |
-| [protocol](./kibana-plugin-core-server.urlmeaningfulparts.protocol.md) | string | null
| |
-| [query](./kibana-plugin-core-server.urlmeaningfulparts.query.md) | ParsedQuery
| |
-| [slashes](./kibana-plugin-core-server.urlmeaningfulparts.slashes.md) | boolean | null
| |
-
diff --git a/docs/development/core/server/kibana-plugin-core-server.urlmeaningfulparts.pathname.md b/docs/development/core/server/kibana-plugin-core-server.urlmeaningfulparts.pathname.md
deleted file mode 100644
index 8fee8c8e146ca..0000000000000
--- a/docs/development/core/server/kibana-plugin-core-server.urlmeaningfulparts.pathname.md
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [URLMeaningfulParts](./kibana-plugin-core-server.urlmeaningfulparts.md) > [pathname](./kibana-plugin-core-server.urlmeaningfulparts.pathname.md)
-
-## URLMeaningfulParts.pathname property
-
-Signature:
-
-```typescript
-pathname?: string | null;
-```
diff --git a/docs/development/core/server/kibana-plugin-core-server.urlmeaningfulparts.port.md b/docs/development/core/server/kibana-plugin-core-server.urlmeaningfulparts.port.md
deleted file mode 100644
index dcf3517d92ba2..0000000000000
--- a/docs/development/core/server/kibana-plugin-core-server.urlmeaningfulparts.port.md
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [URLMeaningfulParts](./kibana-plugin-core-server.urlmeaningfulparts.md) > [port](./kibana-plugin-core-server.urlmeaningfulparts.port.md)
-
-## URLMeaningfulParts.port property
-
-Signature:
-
-```typescript
-port?: string | null;
-```
diff --git a/docs/development/core/server/kibana-plugin-core-server.urlmeaningfulparts.protocol.md b/docs/development/core/server/kibana-plugin-core-server.urlmeaningfulparts.protocol.md
deleted file mode 100644
index 914dcd4e8a8a5..0000000000000
--- a/docs/development/core/server/kibana-plugin-core-server.urlmeaningfulparts.protocol.md
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [URLMeaningfulParts](./kibana-plugin-core-server.urlmeaningfulparts.md) > [protocol](./kibana-plugin-core-server.urlmeaningfulparts.protocol.md)
-
-## URLMeaningfulParts.protocol property
-
-Signature:
-
-```typescript
-protocol?: string | null;
-```
diff --git a/docs/development/core/server/kibana-plugin-core-server.urlmeaningfulparts.query.md b/docs/development/core/server/kibana-plugin-core-server.urlmeaningfulparts.query.md
deleted file mode 100644
index 358adcfd3d180..0000000000000
--- a/docs/development/core/server/kibana-plugin-core-server.urlmeaningfulparts.query.md
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [URLMeaningfulParts](./kibana-plugin-core-server.urlmeaningfulparts.md) > [query](./kibana-plugin-core-server.urlmeaningfulparts.query.md)
-
-## URLMeaningfulParts.query property
-
-Signature:
-
-```typescript
-query: ParsedQuery;
-```
diff --git a/docs/development/core/server/kibana-plugin-core-server.urlmeaningfulparts.slashes.md b/docs/development/core/server/kibana-plugin-core-server.urlmeaningfulparts.slashes.md
deleted file mode 100644
index d5b598167f2f2..0000000000000
--- a/docs/development/core/server/kibana-plugin-core-server.urlmeaningfulparts.slashes.md
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [URLMeaningfulParts](./kibana-plugin-core-server.urlmeaningfulparts.md) > [slashes](./kibana-plugin-core-server.urlmeaningfulparts.slashes.md)
-
-## URLMeaningfulParts.slashes property
-
-Signature:
-
-```typescript
-slashes?: boolean | null;
-```
diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.querystringinput.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.querystringinput.md
index cf171d9ee9f37..e85747b8cc3d7 100644
--- a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.querystringinput.md
+++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.querystringinput.md
@@ -7,5 +7,5 @@
Signature:
```typescript
-QueryStringInput: React.FC>
+QueryStringInput: React.FC>
```
diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchsource.serialize.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchsource.serialize.md
index 73ba8eb66040b..496e1ae9677d8 100644
--- a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchsource.serialize.md
+++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchsource.serialize.md
@@ -15,13 +15,13 @@ Using `createSearchSource`, the instance can be re-created.
```typescript
serialize(): {
searchSourceJSON: string;
- references: import("../../../../../core/public").SavedObjectReference[];
+ references: import("../../../../../core/types").SavedObjectReference[];
};
```
Returns:
`{
searchSourceJSON: string;
- references: import("../../../../../core/public").SavedObjectReference[];
+ references: import("../../../../../core/types").SavedObjectReference[];
}`
diff --git a/package.json b/package.json
index 7468a49d56959..8994f327d3e65 100644
--- a/package.json
+++ b/package.json
@@ -141,6 +141,7 @@
"@kbn/i18n": "1.0.0",
"@kbn/interpreter": "1.0.0",
"@kbn/pm": "1.0.0",
+ "@kbn/std": "1.0.0",
"@kbn/telemetry-tools": "1.0.0",
"@kbn/test-subj-selector": "0.2.1",
"@kbn/ui-framework": "1.0.0",
@@ -290,6 +291,7 @@
"@types/hoek": "^4.1.3",
"@types/inert": "^5.1.2",
"@types/jest": "^25.2.3",
+ "@types/jest-when": "^2.7.1",
"@types/joi": "^13.4.2",
"@types/jquery": "^3.3.31",
"@types/js-yaml": "^3.11.1",
@@ -414,6 +416,7 @@
"jest-cli": "^25.5.4",
"jest-environment-jsdom-thirteen": "^1.0.1",
"jest-raw-loader": "^1.0.1",
+ "jest-when": "^2.7.2",
"jimp": "^0.14.0",
"jquery": "^3.5.0",
"js-levenshtein": "^1.1.6",
diff --git a/packages/kbn-dev-utils/package.json b/packages/kbn-dev-utils/package.json
index 4f6f995f38f31..a3fe8178822aa 100644
--- a/packages/kbn-dev-utils/package.json
+++ b/packages/kbn-dev-utils/package.json
@@ -11,6 +11,7 @@
},
"dependencies": {
"@babel/core": "^7.11.1",
+ "@kbn/utils": "1.0.0",
"axios": "^0.19.0",
"chalk": "^4.1.0",
"cheerio": "0.22.0",
diff --git a/packages/kbn-dev-utils/src/index.ts b/packages/kbn-dev-utils/src/index.ts
index 2871fe2ffcf4a..8217999b01128 100644
--- a/packages/kbn-dev-utils/src/index.ts
+++ b/packages/kbn-dev-utils/src/index.ts
@@ -17,6 +17,7 @@
* under the License.
*/
+export { REPO_ROOT } from '@kbn/utils';
export { withProcRunner, ProcRunner } from './proc_runner';
export * from './tooling_log';
export * from './serializers';
@@ -33,7 +34,6 @@ export {
KBN_P12_PATH,
KBN_P12_PASSWORD,
} from './certs';
-export { REPO_ROOT } from './repo_root';
export { KbnClient } from './kbn_client';
export * from './run';
export * from './axios';
diff --git a/packages/kbn-dev-utils/src/plugin_list/discover_plugins.ts b/packages/kbn-dev-utils/src/plugin_list/discover_plugins.ts
index 783d584656b17..5d92ddb600aa9 100644
--- a/packages/kbn-dev-utils/src/plugin_list/discover_plugins.ts
+++ b/packages/kbn-dev-utils/src/plugin_list/discover_plugins.ts
@@ -22,8 +22,8 @@ import Fs from 'fs';
import MarkdownIt from 'markdown-it';
import cheerio from 'cheerio';
+import { REPO_ROOT } from '@kbn/utils';
-import { REPO_ROOT } from '../repo_root';
import { simpleKibanaPlatformPluginDiscovery } from '../simple_kibana_platform_plugin_discovery';
import { extractAsciidocInfo } from './extract_asciidoc_info';
diff --git a/packages/kbn-dev-utils/src/plugin_list/generate_plugin_list.ts b/packages/kbn-dev-utils/src/plugin_list/generate_plugin_list.ts
index 43dac1cb7d418..e1a1323553113 100644
--- a/packages/kbn-dev-utils/src/plugin_list/generate_plugin_list.ts
+++ b/packages/kbn-dev-utils/src/plugin_list/generate_plugin_list.ts
@@ -20,8 +20,8 @@
import Path from 'path';
import normalizePath from 'normalize-path';
+import { REPO_ROOT } from '@kbn/utils';
-import { REPO_ROOT } from '../repo_root';
import { Plugins } from './discover_plugins';
function* printPlugins(plugins: Plugins, includes: string[]) {
diff --git a/packages/kbn-dev-utils/src/plugin_list/run_plugin_list_cli.ts b/packages/kbn-dev-utils/src/plugin_list/run_plugin_list_cli.ts
index 553eb1dd8afa0..613f9c9c26411 100644
--- a/packages/kbn-dev-utils/src/plugin_list/run_plugin_list_cli.ts
+++ b/packages/kbn-dev-utils/src/plugin_list/run_plugin_list_cli.ts
@@ -19,10 +19,9 @@
import Path from 'path';
import Fs from 'fs';
+import { REPO_ROOT } from '@kbn/utils';
import { run } from '../run';
-import { REPO_ROOT } from '../repo_root';
-
import { discoverPlugins } from './discover_plugins';
import { generatePluginList } from './generate_plugin_list';
diff --git a/packages/kbn-dev-utils/src/precommit_hook/cli.ts b/packages/kbn-dev-utils/src/precommit_hook/cli.ts
index a83e8c2b193d9..28347f379150f 100644
--- a/packages/kbn-dev-utils/src/precommit_hook/cli.ts
+++ b/packages/kbn-dev-utils/src/precommit_hook/cli.ts
@@ -20,9 +20,9 @@
import Path from 'path';
import { chmod, writeFile } from 'fs';
import { promisify } from 'util';
+import { REPO_ROOT } from '@kbn/utils';
import { run } from '../run';
-import { REPO_ROOT } from '../repo_root';
import { SCRIPT_SOURCE } from './script_source';
import { getGitDir } from './get_git_dir';
diff --git a/packages/kbn-dev-utils/src/precommit_hook/get_git_dir.ts b/packages/kbn-dev-utils/src/precommit_hook/get_git_dir.ts
index 5ca7d67d0d4ea..f75c86f510095 100644
--- a/packages/kbn-dev-utils/src/precommit_hook/get_git_dir.ts
+++ b/packages/kbn-dev-utils/src/precommit_hook/get_git_dir.ts
@@ -19,7 +19,7 @@
import execa from 'execa';
-import { REPO_ROOT } from '../repo_root';
+import { REPO_ROOT } from '@kbn/utils';
// Retrieves the correct location for the .git dir for
// every git setup (including git worktree)
diff --git a/packages/kbn-dev-utils/src/serializers/absolute_path_serializer.ts b/packages/kbn-dev-utils/src/serializers/absolute_path_serializer.ts
index 4008cf852c3a8..cc6b8334d76cf 100644
--- a/packages/kbn-dev-utils/src/serializers/absolute_path_serializer.ts
+++ b/packages/kbn-dev-utils/src/serializers/absolute_path_serializer.ts
@@ -17,7 +17,7 @@
* under the License.
*/
-import { REPO_ROOT } from '../repo_root';
+import { REPO_ROOT } from '@kbn/utils';
export function createAbsolutePathSerializer(
rootPath: string = REPO_ROOT,
diff --git a/packages/kbn-optimizer/README.md b/packages/kbn-optimizer/README.md
index 13be836f0ea88..a666907f02678 100644
--- a/packages/kbn-optimizer/README.md
+++ b/packages/kbn-optimizer/README.md
@@ -69,7 +69,8 @@ To run the optimizer from code, you can import the [`OptimizerConfig`][Optimizer
Example:
```ts
import { runOptimizer, OptimizerConfig, logOptimizerState } from '@kbn/optimizer';
-import { REPO_ROOT, ToolingLog } from '@kbn/dev-utils';
+import { REPO_ROOT } from '@kbn/utils';
+import { ToolingLog } from '@kbn/dev-utils';
const log = new ToolingLog({
level: 'verbose',
diff --git a/packages/kbn-optimizer/src/cli.ts b/packages/kbn-optimizer/src/cli.ts
index 542dc7255f22f..dcfb56be66efd 100644
--- a/packages/kbn-optimizer/src/cli.ts
+++ b/packages/kbn-optimizer/src/cli.ts
@@ -21,7 +21,8 @@ import 'source-map-support/register';
import Path from 'path';
-import { run, REPO_ROOT, createFlagError, CiStatsReporter } from '@kbn/dev-utils';
+import { REPO_ROOT } from '@kbn/utils';
+import { run, createFlagError, CiStatsReporter } from '@kbn/dev-utils';
import { logOptimizerState } from './log_optimizer_state';
import { OptimizerConfig } from './optimizer';
diff --git a/packages/kbn-optimizer/src/integration_tests/basic_optimization.test.ts b/packages/kbn-optimizer/src/integration_tests/basic_optimization.test.ts
index 12f037f5080fc..de3838eb92975 100644
--- a/packages/kbn-optimizer/src/integration_tests/basic_optimization.test.ts
+++ b/packages/kbn-optimizer/src/integration_tests/basic_optimization.test.ts
@@ -25,7 +25,8 @@ import { inspect } from 'util';
import cpy from 'cpy';
import del from 'del';
import { toArray, tap, filter } from 'rxjs/operators';
-import { ToolingLog, REPO_ROOT } from '@kbn/dev-utils';
+import { REPO_ROOT } from '@kbn/utils';
+import { ToolingLog } from '@kbn/dev-utils';
import { runOptimizer, OptimizerConfig, OptimizerUpdate, logOptimizerState } from '@kbn/optimizer';
const TMP_DIR = Path.resolve(__dirname, '../__fixtures__/__tmp__');
diff --git a/packages/kbn-optimizer/src/optimizer/cache_keys.test.ts b/packages/kbn-optimizer/src/optimizer/cache_keys.test.ts
index 47d01347a8f7d..1b4c9b117c4c3 100644
--- a/packages/kbn-optimizer/src/optimizer/cache_keys.test.ts
+++ b/packages/kbn-optimizer/src/optimizer/cache_keys.test.ts
@@ -20,7 +20,8 @@
import Path from 'path';
import jestDiff from 'jest-diff';
-import { REPO_ROOT, createAbsolutePathSerializer } from '@kbn/dev-utils';
+import { REPO_ROOT } from '@kbn/utils';
+import { createAbsolutePathSerializer } from '@kbn/dev-utils';
import { reformatJestDiff, getOptimizerCacheKey, diffCacheKey } from './cache_keys';
import { OptimizerConfig } from './optimizer_config';
diff --git a/packages/kbn-optimizer/src/optimizer/cache_keys.ts b/packages/kbn-optimizer/src/optimizer/cache_keys.ts
index d0aaad979485d..8dde67683a739 100644
--- a/packages/kbn-optimizer/src/optimizer/cache_keys.ts
+++ b/packages/kbn-optimizer/src/optimizer/cache_keys.ts
@@ -23,7 +23,7 @@ import { promisify } from 'util';
import Chalk from 'chalk';
import execa from 'execa';
-import { REPO_ROOT } from '@kbn/dev-utils';
+import { REPO_ROOT } from '@kbn/utils';
import stripAnsi from 'strip-ansi';
import jestDiff from 'jest-diff';
diff --git a/packages/kbn-optimizer/src/optimizer/handle_optimizer_completion.test.ts b/packages/kbn-optimizer/src/optimizer/handle_optimizer_completion.test.ts
index 3cc58e744a7b9..6edcde56e26de 100644
--- a/packages/kbn-optimizer/src/optimizer/handle_optimizer_completion.test.ts
+++ b/packages/kbn-optimizer/src/optimizer/handle_optimizer_completion.test.ts
@@ -18,7 +18,7 @@
*/
import * as Rx from 'rxjs';
-import { REPO_ROOT } from '@kbn/dev-utils';
+import { REPO_ROOT } from '@kbn/utils';
import { Update } from '../common';
diff --git a/packages/kbn-optimizer/src/optimizer/optimizer_config.test.ts b/packages/kbn-optimizer/src/optimizer/optimizer_config.test.ts
index afc2dc8952c87..fd887e8c2c012 100644
--- a/packages/kbn-optimizer/src/optimizer/optimizer_config.test.ts
+++ b/packages/kbn-optimizer/src/optimizer/optimizer_config.test.ts
@@ -32,7 +32,8 @@ jest.mock('os', () => {
});
import Path from 'path';
-import { REPO_ROOT, createAbsolutePathSerializer } from '@kbn/dev-utils';
+import { REPO_ROOT } from '@kbn/utils';
+import { createAbsolutePathSerializer } from '@kbn/dev-utils';
import { OptimizerConfig, ParsedOptions } from './optimizer_config';
import { parseThemeTags } from '../common';
diff --git a/packages/kbn-plugin-generator/src/ask_questions.ts b/packages/kbn-plugin-generator/src/ask_questions.ts
index b598396187245..732e22b0e2225 100644
--- a/packages/kbn-plugin-generator/src/ask_questions.ts
+++ b/packages/kbn-plugin-generator/src/ask_questions.ts
@@ -19,7 +19,7 @@
import Path from 'path';
-import { REPO_ROOT } from '@kbn/dev-utils';
+import { REPO_ROOT } from '@kbn/utils';
import inquirer from 'inquirer';
export interface Answers {
diff --git a/packages/kbn-plugin-generator/src/cli.ts b/packages/kbn-plugin-generator/src/cli.ts
index f6966a245e46f..14c910a943fd5 100644
--- a/packages/kbn-plugin-generator/src/cli.ts
+++ b/packages/kbn-plugin-generator/src/cli.ts
@@ -21,7 +21,8 @@ import Path from 'path';
import Fs from 'fs';
import execa from 'execa';
-import { REPO_ROOT, run, createFailError, createFlagError } from '@kbn/dev-utils';
+import { REPO_ROOT } from '@kbn/utils';
+import { run, createFailError, createFlagError } from '@kbn/dev-utils';
import { snakeCase } from './casing';
import { askQuestions, getDefaultAnswers } from './ask_questions';
diff --git a/packages/kbn-plugin-generator/src/integration_tests/generate_plugin.test.ts b/packages/kbn-plugin-generator/src/integration_tests/generate_plugin.test.ts
index b48113afc0ca7..25669b65e1ac9 100644
--- a/packages/kbn-plugin-generator/src/integration_tests/generate_plugin.test.ts
+++ b/packages/kbn-plugin-generator/src/integration_tests/generate_plugin.test.ts
@@ -21,7 +21,8 @@ import Path from 'path';
import del from 'del';
import execa from 'execa';
-import { REPO_ROOT, createAbsolutePathSerializer } from '@kbn/dev-utils';
+import { REPO_ROOT } from '@kbn/utils';
+import { createAbsolutePathSerializer } from '@kbn/dev-utils';
import globby from 'globby';
const GENERATED_DIR = Path.resolve(REPO_ROOT, `plugins`);
diff --git a/packages/kbn-plugin-generator/src/plugin_types.ts b/packages/kbn-plugin-generator/src/plugin_types.ts
index ae5201f4e8dbb..778e33353a2aa 100644
--- a/packages/kbn-plugin-generator/src/plugin_types.ts
+++ b/packages/kbn-plugin-generator/src/plugin_types.ts
@@ -19,7 +19,7 @@
import Path from 'path';
-import { REPO_ROOT } from '@kbn/dev-utils';
+import { REPO_ROOT } from '@kbn/utils';
export interface PluginType {
thirdParty: boolean;
diff --git a/packages/kbn-plugin-generator/src/render_template.ts b/packages/kbn-plugin-generator/src/render_template.ts
index 894088c119651..ecb168042b1c2 100644
--- a/packages/kbn-plugin-generator/src/render_template.ts
+++ b/packages/kbn-plugin-generator/src/render_template.ts
@@ -23,7 +23,8 @@ import { promisify } from 'util';
import vfs from 'vinyl-fs';
import prettier from 'prettier';
-import { REPO_ROOT, transformFileStream } from '@kbn/dev-utils';
+import { REPO_ROOT } from '@kbn/utils';
+import { transformFileStream } from '@kbn/dev-utils';
import ejs from 'ejs';
import { Minimatch } from 'minimatch';
diff --git a/packages/kbn-plugin-helpers/src/integration_tests/build.test.ts b/packages/kbn-plugin-helpers/src/integration_tests/build.test.ts
index be23d8dbde646..5c1ecc4ee4ee4 100644
--- a/packages/kbn-plugin-helpers/src/integration_tests/build.test.ts
+++ b/packages/kbn-plugin-helpers/src/integration_tests/build.test.ts
@@ -21,7 +21,8 @@ import Path from 'path';
import Fs from 'fs';
import execa from 'execa';
-import { createStripAnsiSerializer, REPO_ROOT, createReplaceSerializer } from '@kbn/dev-utils';
+import { REPO_ROOT } from '@kbn/utils';
+import { createStripAnsiSerializer, createReplaceSerializer } from '@kbn/dev-utils';
import extract from 'extract-zip';
import del from 'del';
import globby from 'globby';
diff --git a/packages/kbn-plugin-helpers/src/load_kibana_platform_plugin.ts b/packages/kbn-plugin-helpers/src/load_kibana_platform_plugin.ts
index 8f48670e49de4..8ed20a26649e7 100644
--- a/packages/kbn-plugin-helpers/src/load_kibana_platform_plugin.ts
+++ b/packages/kbn-plugin-helpers/src/load_kibana_platform_plugin.ts
@@ -19,12 +19,8 @@
import Path from 'path';
-import {
- REPO_ROOT,
- parseKibanaPlatformPlugin,
- KibanaPlatformPlugin,
- createFailError,
-} from '@kbn/dev-utils';
+import { REPO_ROOT } from '@kbn/utils';
+import { parseKibanaPlatformPlugin, KibanaPlatformPlugin, createFailError } from '@kbn/dev-utils';
export type Plugin = KibanaPlatformPlugin;
diff --git a/packages/kbn-plugin-helpers/src/tasks/optimize.ts b/packages/kbn-plugin-helpers/src/tasks/optimize.ts
index 6cfeda8b2d81b..fc1bf48cc0e36 100644
--- a/packages/kbn-plugin-helpers/src/tasks/optimize.ts
+++ b/packages/kbn-plugin-helpers/src/tasks/optimize.ts
@@ -21,7 +21,7 @@ import Fs from 'fs';
import Path from 'path';
import { promisify } from 'util';
-import { REPO_ROOT } from '@kbn/dev-utils';
+import { REPO_ROOT } from '@kbn/utils';
import { OptimizerConfig, runOptimizer, logOptimizerState } from '@kbn/optimizer';
import { BuildContext } from '../build_context';
diff --git a/packages/kbn-pm/package.json b/packages/kbn-pm/package.json
index 914ca2fd65fa2..1fb94e4c92ce1 100644
--- a/packages/kbn-pm/package.json
+++ b/packages/kbn-pm/package.json
@@ -66,6 +66,7 @@
"write-pkg": "^4.0.0"
},
"dependencies": {
+ "@kbn/utils": "1.0.0",
"tslib": "^2.0.0"
}
}
diff --git a/packages/kbn-release-notes/package.json b/packages/kbn-release-notes/package.json
index 12d0122f9a4d3..f8971fa02aa87 100644
--- a/packages/kbn-release-notes/package.json
+++ b/packages/kbn-release-notes/package.json
@@ -8,6 +8,7 @@
"kbn:watch": "tsc --watch"
},
"dependencies": {
+ "@kbn/utils": "1.0.0",
"@kbn/dev-utils": "1.0.0",
"axios": "^0.19.2",
"cheerio": "0.22.0",
diff --git a/packages/kbn-release-notes/src/cli.ts b/packages/kbn-release-notes/src/cli.ts
index 7dcfa38078391..dff59d79cb2b2 100644
--- a/packages/kbn-release-notes/src/cli.ts
+++ b/packages/kbn-release-notes/src/cli.ts
@@ -21,7 +21,8 @@ import Fs from 'fs';
import Path from 'path';
import { inspect } from 'util';
-import { run, createFlagError, createFailError, REPO_ROOT } from '@kbn/dev-utils';
+import { REPO_ROOT } from '@kbn/utils';
+import { run, createFlagError, createFailError } from '@kbn/dev-utils';
import { FORMATS, SomeFormat } from './formats';
import {
diff --git a/packages/kbn-std/README.md b/packages/kbn-std/README.md
new file mode 100644
index 0000000000000..dfd98287ada4b
--- /dev/null
+++ b/packages/kbn-std/README.md
@@ -0,0 +1,3 @@
+# `@kbn/std` — Kibana standard library
+
+This package is a set of utilities that can be used both on server-side and client-side.
\ No newline at end of file
diff --git a/packages/kbn-std/package.json b/packages/kbn-std/package.json
new file mode 100644
index 0000000000000..4c67706b45d27
--- /dev/null
+++ b/packages/kbn-std/package.json
@@ -0,0 +1,21 @@
+{
+ "name": "@kbn/std",
+ "main": "./target/index.js",
+ "types": "./target/index.d.ts",
+ "version": "1.0.0",
+ "license": "Apache-2.0",
+ "private": true,
+ "scripts": {
+ "build": "tsc",
+ "kbn:bootstrap": "yarn build"
+ },
+ "devDependencies": {
+ "typescript": "4.0.2",
+ "tsd": "^0.13.1"
+ },
+ "dependencies": {
+ "@kbn/utility-types": "1.0.0",
+ "lodash": "^4.17.15",
+ "query-string": "5.1.1"
+ }
+}
diff --git a/src/core/utils/__snapshots__/get.test.ts.snap b/packages/kbn-std/src/__snapshots__/get.test.ts.snap
similarity index 100%
rename from src/core/utils/__snapshots__/get.test.ts.snap
rename to packages/kbn-std/src/__snapshots__/get.test.ts.snap
diff --git a/src/core/utils/assert_never.ts b/packages/kbn-std/src/assert_never.ts
similarity index 100%
rename from src/core/utils/assert_never.ts
rename to packages/kbn-std/src/assert_never.ts
diff --git a/src/core/utils/deep_freeze.test.ts b/packages/kbn-std/src/deep_freeze.test.ts
similarity index 100%
rename from src/core/utils/deep_freeze.test.ts
rename to packages/kbn-std/src/deep_freeze.test.ts
diff --git a/src/core/utils/deep_freeze.ts b/packages/kbn-std/src/deep_freeze.ts
similarity index 100%
rename from src/core/utils/deep_freeze.ts
rename to packages/kbn-std/src/deep_freeze.ts
diff --git a/src/core/utils/get.test.ts b/packages/kbn-std/src/get.test.ts
similarity index 100%
rename from src/core/utils/get.test.ts
rename to packages/kbn-std/src/get.test.ts
diff --git a/src/core/utils/get.ts b/packages/kbn-std/src/get.ts
similarity index 100%
rename from src/core/utils/get.ts
rename to packages/kbn-std/src/get.ts
diff --git a/src/core/utils/get_flattened_object.test.ts b/packages/kbn-std/src/get_flattened_object.test.ts
similarity index 100%
rename from src/core/utils/get_flattened_object.test.ts
rename to packages/kbn-std/src/get_flattened_object.test.ts
diff --git a/src/core/utils/get_flattened_object.ts b/packages/kbn-std/src/get_flattened_object.ts
similarity index 100%
rename from src/core/utils/get_flattened_object.ts
rename to packages/kbn-std/src/get_flattened_object.ts
diff --git a/packages/kbn-std/src/index.ts b/packages/kbn-std/src/index.ts
new file mode 100644
index 0000000000000..7cf70a0e28e2c
--- /dev/null
+++ b/packages/kbn-std/src/index.ts
@@ -0,0 +1,29 @@
+/*
+ * Licensed to Elasticsearch B.V. under one or more contributor
+ * license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright
+ * ownership. Elasticsearch B.V. licenses this file to you under
+ * the Apache License, Version 2.0 (the "License"); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+export { assertNever } from './assert_never';
+export { deepFreeze, Freezable } from './deep_freeze';
+export { get } from './get';
+export { mapToObject } from './map_to_object';
+export { merge } from './merge';
+export { pick } from './pick';
+export { withTimeout } from './promise';
+export { isRelativeUrl, modifyUrl, URLMeaningfulParts } from './url';
+export { unset } from './unset';
+export { getFlattenedObject } from './get_flattened_object';
diff --git a/src/core/utils/map_to_object.ts b/packages/kbn-std/src/map_to_object.ts
similarity index 100%
rename from src/core/utils/map_to_object.ts
rename to packages/kbn-std/src/map_to_object.ts
diff --git a/src/core/utils/map_utils.test.ts b/packages/kbn-std/src/map_utils.test.ts
similarity index 100%
rename from src/core/utils/map_utils.test.ts
rename to packages/kbn-std/src/map_utils.test.ts
diff --git a/src/core/utils/map_utils.ts b/packages/kbn-std/src/map_utils.ts
similarity index 100%
rename from src/core/utils/map_utils.ts
rename to packages/kbn-std/src/map_utils.ts
diff --git a/src/core/utils/merge.test.ts b/packages/kbn-std/src/merge.test.ts
similarity index 100%
rename from src/core/utils/merge.test.ts
rename to packages/kbn-std/src/merge.test.ts
diff --git a/src/core/utils/merge.ts b/packages/kbn-std/src/merge.ts
similarity index 98%
rename from src/core/utils/merge.ts
rename to packages/kbn-std/src/merge.ts
index 43878c27b1e19..c0de50544a34e 100644
--- a/src/core/utils/merge.ts
+++ b/packages/kbn-std/src/merge.ts
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-import { isPlainObject } from 'lodash';
+import isPlainObject from 'lodash/isPlainObject';
/**
* Deeply merges two objects, omitting undefined values, and not deeply merging Arrays.
*
diff --git a/src/core/utils/pick.ts b/packages/kbn-std/src/pick.ts
similarity index 100%
rename from src/core/utils/pick.ts
rename to packages/kbn-std/src/pick.ts
diff --git a/src/core/utils/promise.test.ts b/packages/kbn-std/src/promise.test.ts
similarity index 100%
rename from src/core/utils/promise.test.ts
rename to packages/kbn-std/src/promise.test.ts
diff --git a/src/core/utils/promise.ts b/packages/kbn-std/src/promise.ts
similarity index 100%
rename from src/core/utils/promise.ts
rename to packages/kbn-std/src/promise.ts
diff --git a/src/core/utils/unset.test.ts b/packages/kbn-std/src/unset.test.ts
similarity index 100%
rename from src/core/utils/unset.test.ts
rename to packages/kbn-std/src/unset.test.ts
diff --git a/src/core/utils/unset.ts b/packages/kbn-std/src/unset.ts
similarity index 100%
rename from src/core/utils/unset.ts
rename to packages/kbn-std/src/unset.ts
diff --git a/src/core/utils/url.test.ts b/packages/kbn-std/src/url.test.ts
similarity index 100%
rename from src/core/utils/url.test.ts
rename to packages/kbn-std/src/url.test.ts
diff --git a/src/core/utils/url.ts b/packages/kbn-std/src/url.ts
similarity index 100%
rename from src/core/utils/url.ts
rename to packages/kbn-std/src/url.ts
diff --git a/packages/kbn-std/tsconfig.json b/packages/kbn-std/tsconfig.json
new file mode 100644
index 0000000000000..5c86ad17a90e9
--- /dev/null
+++ b/packages/kbn-std/tsconfig.json
@@ -0,0 +1,16 @@
+{
+ "extends": "../../tsconfig.base.json",
+ "compilerOptions": {
+ "declaration": true,
+ "declarationDir": "./target",
+ "outDir": "./target",
+ "stripInternal": true,
+ "declarationMap": true,
+ "types": ["jest", "node"]
+ },
+ "include": [
+ "./src/**/*.ts",
+ "../../typings/query_string.d.ts"
+ ],
+ "exclude": ["target"]
+}
diff --git a/packages/kbn-std/yarn.lock b/packages/kbn-std/yarn.lock
new file mode 120000
index 0000000000000..3f82ebc9cdbae
--- /dev/null
+++ b/packages/kbn-std/yarn.lock
@@ -0,0 +1 @@
+../../yarn.lock
\ No newline at end of file
diff --git a/packages/kbn-storybook/lib/constants.js b/packages/kbn-storybook/lib/constants.js
index 9d216d347eada..4d8ca0adbfe17 100644
--- a/packages/kbn-storybook/lib/constants.js
+++ b/packages/kbn-storybook/lib/constants.js
@@ -17,10 +17,10 @@
* under the License.
*/
-const { resolve, dirname } = require('path');
+const { resolve } = require('path');
+const { REPO_ROOT } = require('@kbn/utils');
-exports.REPO_ROOT = dirname(require.resolve('../../../package.json'));
-exports.ASSET_DIR = resolve(exports.REPO_ROOT, 'built_assets/storybook');
+exports.ASSET_DIR = resolve(REPO_ROOT, 'built_assets/storybook');
exports.CURRENT_CONFIG = resolve(exports.ASSET_DIR, 'current.config.js');
exports.STORY_ENTRY_PATH = resolve(exports.ASSET_DIR, 'stories.entry.js');
exports.DLL_DIST_DIR = resolve(exports.ASSET_DIR, 'dll');
diff --git a/packages/kbn-storybook/lib/dll.js b/packages/kbn-storybook/lib/dll.js
index a9154ca972120..55bc8e43a02ec 100644
--- a/packages/kbn-storybook/lib/dll.js
+++ b/packages/kbn-storybook/lib/dll.js
@@ -20,7 +20,8 @@
const { resolve } = require('path');
const { existsSync } = require('fs');
-const { REPO_ROOT, DLL_DIST_DIR } = require('./constants');
+const { REPO_ROOT } = require('@kbn/utils');
+const { DLL_DIST_DIR } = require('./constants');
exports.buildDll = async ({ rebuildDll, log, procRunner }) => {
if (rebuildDll) {
diff --git a/packages/kbn-storybook/lib/storybook_entry.js b/packages/kbn-storybook/lib/storybook_entry.js
index 8b8aa4126ad88..fc970b1ff9d2a 100644
--- a/packages/kbn-storybook/lib/storybook_entry.js
+++ b/packages/kbn-storybook/lib/storybook_entry.js
@@ -27,11 +27,12 @@ const { promisify } = require('util');
const watch = require('glob-watcher');
const mkdirp = require('mkdirp'); // eslint-disable-line
const glob = require('fast-glob');
+const { REPO_ROOT } = require('@kbn/utils');
const mkdirpAsync = promisify(mkdirp);
const writeFileAsync = promisify(Fs.writeFile);
-const { REPO_ROOT, STORY_ENTRY_PATH } = require('./constants');
+const { STORY_ENTRY_PATH } = require('./constants');
const STORE_ENTRY_DIR = dirname(STORY_ENTRY_PATH);
exports.generateStorybookEntry = ({ log, storyGlobs }) => {
diff --git a/packages/kbn-storybook/lib/webpack.dll.config.js b/packages/kbn-storybook/lib/webpack.dll.config.js
index 18dbe3bd049d3..6e3b4d41bd7f0 100644
--- a/packages/kbn-storybook/lib/webpack.dll.config.js
+++ b/packages/kbn-storybook/lib/webpack.dll.config.js
@@ -20,8 +20,9 @@
const webpack = require('webpack');
const path = require('path');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
+const { REPO_ROOT } = require('@kbn/utils');
-const { DLL_NAME, REPO_ROOT, DLL_DIST_DIR } = require('./constants');
+const { DLL_NAME, DLL_DIST_DIR } = require('./constants');
// This is the Webpack config for the DLL of CSS and JS assets that are
// not expected to change during development. This saves compile and run
diff --git a/packages/kbn-storybook/package.json b/packages/kbn-storybook/package.json
index 9f12cd1f46c68..5271ddb96d842 100644
--- a/packages/kbn-storybook/package.json
+++ b/packages/kbn-storybook/package.json
@@ -6,6 +6,7 @@
"dependencies": {
"@kbn/babel-preset": "1.0.0",
"@kbn/dev-utils": "1.0.0",
+ "@kbn/utils": "1.0.0",
"@storybook/addon-actions": "^5.3.19",
"@storybook/addon-console": "^1.2.1",
"@storybook/addon-info": "^5.3.19",
diff --git a/packages/kbn-storybook/storybook_config/webpack.config.js b/packages/kbn-storybook/storybook_config/webpack.config.js
index d505c4f9a0448..60b6b6add66d1 100644
--- a/packages/kbn-storybook/storybook_config/webpack.config.js
+++ b/packages/kbn-storybook/storybook_config/webpack.config.js
@@ -22,7 +22,8 @@ const webpack = require('webpack');
const webpackMerge = require('webpack-merge');
const { stringifyRequest } = require('loader-utils');
const CopyWebpackPlugin = require('copy-webpack-plugin');
-const { REPO_ROOT, DLL_DIST_DIR } = require('../lib/constants');
+const { REPO_ROOT } = require('@kbn/utils');
+const { DLL_DIST_DIR } = require('../lib/constants');
// eslint-disable-next-line import/no-unresolved
const { currentConfig } = require('../../../built_assets/storybook/current.config');
diff --git a/packages/kbn-test/package.json b/packages/kbn-test/package.json
index c84b0a93311bb..8a4ff55dcf68f 100644
--- a/packages/kbn-test/package.json
+++ b/packages/kbn-test/package.json
@@ -13,6 +13,7 @@
"@babel/cli": "^7.10.5",
"@kbn/babel-preset": "1.0.0",
"@kbn/dev-utils": "1.0.0",
+ "@kbn/utils": "1.0.0",
"@types/joi": "^13.4.2",
"@types/lodash": "^4.14.159",
"@types/parse-link-header": "^1.0.0",
diff --git a/packages/kbn-test/src/failed_tests_reporter/run_failed_tests_reporter_cli.ts b/packages/kbn-test/src/failed_tests_reporter/run_failed_tests_reporter_cli.ts
index 3dfb1ea44d9e7..93616ce78a04a 100644
--- a/packages/kbn-test/src/failed_tests_reporter/run_failed_tests_reporter_cli.ts
+++ b/packages/kbn-test/src/failed_tests_reporter/run_failed_tests_reporter_cli.ts
@@ -19,7 +19,8 @@
import Path from 'path';
-import { REPO_ROOT, run, createFailError, createFlagError } from '@kbn/dev-utils';
+import { REPO_ROOT } from '@kbn/utils';
+import { run, createFailError, createFlagError } from '@kbn/dev-utils';
import globby from 'globby';
import { getFailures, TestFailure } from './get_failures';
diff --git a/packages/kbn-test/src/functional_test_runner/__tests__/integration/basic.js b/packages/kbn-test/src/functional_test_runner/__tests__/integration/basic.js
index 133f4d2feb53e..a010d9f0b038e 100644
--- a/packages/kbn-test/src/functional_test_runner/__tests__/integration/basic.js
+++ b/packages/kbn-test/src/functional_test_runner/__tests__/integration/basic.js
@@ -21,7 +21,7 @@ import { spawnSync } from 'child_process';
import { resolve } from 'path';
import expect from '@kbn/expect';
-import { REPO_ROOT } from '@kbn/dev-utils';
+import { REPO_ROOT } from '@kbn/utils';
const SCRIPT = resolve(REPO_ROOT, 'scripts/functional_test_runner.js');
const BASIC_CONFIG = require.resolve('../fixtures/simple_project/config.js');
diff --git a/packages/kbn-test/src/functional_test_runner/__tests__/integration/failure_hooks.js b/packages/kbn-test/src/functional_test_runner/__tests__/integration/failure_hooks.js
index 12e28d2702c5a..fa4ef88fd3e70 100644
--- a/packages/kbn-test/src/functional_test_runner/__tests__/integration/failure_hooks.js
+++ b/packages/kbn-test/src/functional_test_runner/__tests__/integration/failure_hooks.js
@@ -22,7 +22,7 @@ import { resolve } from 'path';
import stripAnsi from 'strip-ansi';
import expect from '@kbn/expect';
-import { REPO_ROOT } from '@kbn/dev-utils';
+import { REPO_ROOT } from '@kbn/utils';
const SCRIPT = resolve(REPO_ROOT, 'scripts/functional_test_runner.js');
const FAILURE_HOOKS_CONFIG = require.resolve('../fixtures/failure_hooks/config.js');
diff --git a/packages/kbn-test/src/functional_test_runner/lib/failure_metadata.ts b/packages/kbn-test/src/functional_test_runner/lib/failure_metadata.ts
index fdf8b3c0ddfa8..e5c60f1d208b1 100644
--- a/packages/kbn-test/src/functional_test_runner/lib/failure_metadata.ts
+++ b/packages/kbn-test/src/functional_test_runner/lib/failure_metadata.ts
@@ -19,7 +19,7 @@
import Path from 'path';
-import { REPO_ROOT } from '@kbn/dev-utils';
+import { REPO_ROOT } from '@kbn/utils';
import { Lifecycle } from './lifecycle';
diff --git a/packages/kbn-test/src/functional_test_runner/lib/mocha/decorate_mocha_ui.js b/packages/kbn-test/src/functional_test_runner/lib/mocha/decorate_mocha_ui.js
index 5d3d8fe7d759b..92137a8c4f841 100644
--- a/packages/kbn-test/src/functional_test_runner/lib/mocha/decorate_mocha_ui.js
+++ b/packages/kbn-test/src/functional_test_runner/lib/mocha/decorate_mocha_ui.js
@@ -17,7 +17,7 @@
* under the License.
*/
import { relative } from 'path';
-import { REPO_ROOT } from '@kbn/dev-utils';
+import { REPO_ROOT } from '@kbn/utils';
import { createAssignmentProxy } from './assignment_proxy';
import { wrapFunction } from './wrap_function';
import { wrapRunnableArgs } from './wrap_runnable_args';
diff --git a/packages/kbn-test/src/functional_test_runner/lib/mocha/setup_mocha.js b/packages/kbn-test/src/functional_test_runner/lib/mocha/setup_mocha.js
index 3ac7a50cd28ea..39eb69a151918 100644
--- a/packages/kbn-test/src/functional_test_runner/lib/mocha/setup_mocha.js
+++ b/packages/kbn-test/src/functional_test_runner/lib/mocha/setup_mocha.js
@@ -19,7 +19,7 @@
import Mocha from 'mocha';
import { relative } from 'path';
-import { REPO_ROOT } from '@kbn/dev-utils';
+import { REPO_ROOT } from '@kbn/utils';
import { loadTestFiles } from './load_test_files';
import { filterSuitesByTags } from './filter_suites_by_tags';
diff --git a/packages/kbn-test/src/functional_test_runner/lib/suite_tracker.test.ts b/packages/kbn-test/src/functional_test_runner/lib/suite_tracker.test.ts
index f879408bf2beb..5350b2709843d 100644
--- a/packages/kbn-test/src/functional_test_runner/lib/suite_tracker.test.ts
+++ b/packages/kbn-test/src/functional_test_runner/lib/suite_tracker.test.ts
@@ -21,7 +21,7 @@ import fs from 'fs';
import { join, resolve } from 'path';
jest.mock('fs');
-jest.mock('@kbn/dev-utils', () => {
+jest.mock('@kbn/utils', () => {
return { REPO_ROOT: '/dev/null/root' };
});
diff --git a/packages/kbn-test/src/functional_test_runner/lib/suite_tracker.ts b/packages/kbn-test/src/functional_test_runner/lib/suite_tracker.ts
index b346be2d58dad..6cbd74467106f 100644
--- a/packages/kbn-test/src/functional_test_runner/lib/suite_tracker.ts
+++ b/packages/kbn-test/src/functional_test_runner/lib/suite_tracker.ts
@@ -19,7 +19,7 @@
import fs from 'fs';
import { dirname, relative, resolve } from 'path';
-import { REPO_ROOT } from '@kbn/dev-utils';
+import { REPO_ROOT } from '@kbn/utils';
import { Lifecycle } from './lifecycle';
diff --git a/packages/kbn-test/src/mocha/run_mocha_cli.js b/packages/kbn-test/src/mocha/run_mocha_cli.js
index 3c77fef963a76..0fc7c762be425 100644
--- a/packages/kbn-test/src/mocha/run_mocha_cli.js
+++ b/packages/kbn-test/src/mocha/run_mocha_cli.js
@@ -17,7 +17,7 @@
* under the License.
*/
-import { REPO_ROOT } from '@kbn/dev-utils';
+import { REPO_ROOT } from '@kbn/utils';
import getopts from 'getopts';
import globby from 'globby';
diff --git a/packages/kbn-ui-shared-deps/webpack.config.js b/packages/kbn-ui-shared-deps/webpack.config.js
index fa80dfdeef20f..b7d4e929ac93f 100644
--- a/packages/kbn-ui-shared-deps/webpack.config.js
+++ b/packages/kbn-ui-shared-deps/webpack.config.js
@@ -21,7 +21,7 @@ const Path = require('path');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const CompressionPlugin = require('compression-webpack-plugin');
-const { REPO_ROOT } = require('@kbn/dev-utils');
+const { REPO_ROOT } = require('@kbn/utils');
const webpack = require('webpack');
const UiSharedDeps = require('./index');
diff --git a/packages/kbn-utils/README.md b/packages/kbn-utils/README.md
new file mode 100644
index 0000000000000..fd132e4312487
--- /dev/null
+++ b/packages/kbn-utils/README.md
@@ -0,0 +1,3 @@
+# @kbn/utils
+
+Shared server-side utilities shared across packages and plugins.
\ No newline at end of file
diff --git a/packages/kbn-utils/package.json b/packages/kbn-utils/package.json
new file mode 100644
index 0000000000000..15fe5c6df5648
--- /dev/null
+++ b/packages/kbn-utils/package.json
@@ -0,0 +1,19 @@
+{
+ "name": "@kbn/utils",
+ "main": "./target/index.js",
+ "version": "1.0.0",
+ "license": "Apache-2.0",
+ "private": true,
+ "scripts": {
+ "build": "tsc",
+ "kbn:bootstrap": "yarn build",
+ "kbn:watch": "yarn build --watch"
+ },
+ "dependencies": {
+ "@kbn/config-schema": "1.0.0",
+ "load-json-file": "^6.2.0"
+ },
+ "devDependencies": {
+ "typescript": "4.0.2"
+ }
+}
diff --git a/packages/kbn-utils/src/index.ts b/packages/kbn-utils/src/index.ts
new file mode 100644
index 0000000000000..7a894d72d5624
--- /dev/null
+++ b/packages/kbn-utils/src/index.ts
@@ -0,0 +1,22 @@
+/*
+ * Licensed to Elasticsearch B.V. under one or more contributor
+ * license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright
+ * ownership. Elasticsearch B.V. licenses this file to you under
+ * the Apache License, Version 2.0 (the "License"); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+export * from './package_json';
+export * from './path';
+export * from './repo_root';
diff --git a/packages/kbn-utils/src/package_json/index.test.ts b/packages/kbn-utils/src/package_json/index.test.ts
new file mode 100644
index 0000000000000..afc84102999fe
--- /dev/null
+++ b/packages/kbn-utils/src/package_json/index.test.ts
@@ -0,0 +1,31 @@
+/*
+ * Licensed to Elasticsearch B.V. under one or more contributor
+ * license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright
+ * ownership. Elasticsearch B.V. licenses this file to you under
+ * the Apache License, Version 2.0 (the "License"); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import path from 'path';
+import { kibanaPackageJSON } from './';
+
+it('parses package.json', () => {
+ expect(kibanaPackageJSON.name).toEqual('kibana');
+});
+
+it('includes __dirname and __filename', () => {
+ const root = path.resolve(__dirname, '../../../../');
+ expect(kibanaPackageJSON.__filename).toEqual(path.resolve(root, 'package.json'));
+ expect(kibanaPackageJSON.__dirname).toEqual(root);
+});
diff --git a/packages/kbn-utils/src/package_json/index.ts b/packages/kbn-utils/src/package_json/index.ts
new file mode 100644
index 0000000000000..f439c0100e193
--- /dev/null
+++ b/packages/kbn-utils/src/package_json/index.ts
@@ -0,0 +1,27 @@
+/*
+ * Licensed to Elasticsearch B.V. under one or more contributor
+ * license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright
+ * ownership. Elasticsearch B.V. licenses this file to you under
+ * the Apache License, Version 2.0 (the "License"); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import { dirname, resolve } from 'path';
+import { REPO_ROOT } from '../repo_root';
+
+export const kibanaPackageJSON = {
+ __filename: resolve(REPO_ROOT, 'package.json'),
+ __dirname: dirname(resolve(REPO_ROOT, 'package.json')),
+ ...require(resolve(REPO_ROOT, 'package.json')),
+};
diff --git a/src/core/server/path/index.test.ts b/packages/kbn-utils/src/path/index.test.ts
similarity index 100%
rename from src/core/server/path/index.test.ts
rename to packages/kbn-utils/src/path/index.test.ts
diff --git a/src/core/server/path/index.ts b/packages/kbn-utils/src/path/index.ts
similarity index 94%
rename from src/core/server/path/index.ts
rename to packages/kbn-utils/src/path/index.ts
index 7c1a81643fbc8..a7eddca5f2fde 100644
--- a/src/core/server/path/index.ts
+++ b/packages/kbn-utils/src/path/index.ts
@@ -20,7 +20,7 @@
import { join } from 'path';
import { accessSync, constants } from 'fs';
import { TypeOf, schema } from '@kbn/config-schema';
-import { fromRoot } from '../utils';
+import { REPO_ROOT } from '../repo_root';
const isString = (v: any): v is string => typeof v === 'string';
@@ -28,19 +28,19 @@ const CONFIG_PATHS = [
process.env.KBN_PATH_CONF && join(process.env.KBN_PATH_CONF, 'kibana.yml'),
process.env.KIBANA_PATH_CONF && join(process.env.KIBANA_PATH_CONF, 'kibana.yml'),
process.env.CONFIG_PATH, // deprecated
- fromRoot('config/kibana.yml'),
+ join(REPO_ROOT, 'config/kibana.yml'),
].filter(isString);
const CONFIG_DIRECTORIES = [
process.env.KBN_PATH_CONF,
process.env.KIBANA_PATH_CONF,
- fromRoot('config'),
+ join(REPO_ROOT, 'config'),
'/etc/kibana',
].filter(isString);
const DATA_PATHS = [
process.env.DATA_PATH, // deprecated
- fromRoot('data'),
+ join(REPO_ROOT, 'data'),
'/var/lib/kibana',
].filter(isString);
diff --git a/packages/kbn-dev-utils/src/repo_root.ts b/packages/kbn-utils/src/repo_root.ts
similarity index 100%
rename from packages/kbn-dev-utils/src/repo_root.ts
rename to packages/kbn-utils/src/repo_root.ts
diff --git a/packages/kbn-utils/tsconfig.json b/packages/kbn-utils/tsconfig.json
new file mode 100644
index 0000000000000..e9dd6313e6f79
--- /dev/null
+++ b/packages/kbn-utils/tsconfig.json
@@ -0,0 +1,11 @@
+{
+ "extends": "../../tsconfig.base.json",
+ "compilerOptions": {
+ "outDir": "target",
+ "declaration": true,
+ "declarationMap": true
+ },
+ "include": [
+ "src/**/*"
+ ]
+}
diff --git a/packages/kbn-utils/yarn.lock b/packages/kbn-utils/yarn.lock
new file mode 120000
index 0000000000000..3f82ebc9cdbae
--- /dev/null
+++ b/packages/kbn-utils/yarn.lock
@@ -0,0 +1 @@
+../../yarn.lock
\ No newline at end of file
diff --git a/src/cli/cluster/cluster_manager.ts b/src/cli/cluster/cluster_manager.ts
index eb7db8dac7cb6..b1d1335eb1888 100644
--- a/src/cli/cluster/cluster_manager.ts
+++ b/src/cli/cluster/cluster_manager.ts
@@ -21,7 +21,7 @@ import { resolve } from 'path';
import { format as formatUrl } from 'url';
import opn from 'opn';
-import { REPO_ROOT } from '@kbn/dev-utils';
+import { REPO_ROOT } from '@kbn/utils';
import { FSWatcher } from 'chokidar';
import * as Rx from 'rxjs';
import { startWith, mapTo, filter, map, take, tap } from 'rxjs/operators';
diff --git a/src/cli/cluster/run_kbn_optimizer.ts b/src/cli/cluster/run_kbn_optimizer.ts
index c231437da3943..8196cad4a99c7 100644
--- a/src/cli/cluster/run_kbn_optimizer.ts
+++ b/src/cli/cluster/run_kbn_optimizer.ts
@@ -19,12 +19,12 @@
import Chalk from 'chalk';
import moment from 'moment';
+import { REPO_ROOT } from '@kbn/utils';
import {
ToolingLog,
pickLevelFromFlags,
ToolingLogTextWriter,
parseLogLevel,
- REPO_ROOT,
} from '@kbn/dev-utils';
import { runOptimizer, OptimizerConfig, logOptimizerState } from '@kbn/optimizer';
diff --git a/src/cli/serve/serve.js b/src/cli/serve/serve.js
index c08f3aec64335..eeb5564667ec4 100644
--- a/src/cli/serve/serve.js
+++ b/src/cli/serve/serve.js
@@ -23,9 +23,9 @@ import { statSync } from 'fs';
import { resolve } from 'path';
import url from 'url';
+import { getConfigPath } from '@kbn/utils';
import { IS_KIBANA_DISTRIBUTABLE } from '../../legacy/utils';
import { fromRoot } from '../../core/server/utils';
-import { getConfigPath } from '../../core/server/path';
import { bootstrap } from '../../core/server';
import { readKeystore } from './read_keystore';
diff --git a/src/cli_keystore/get_keystore.js b/src/cli_keystore/get_keystore.js
index e181efe9196b8..b97efbb2cbf4d 100644
--- a/src/cli_keystore/get_keystore.js
+++ b/src/cli_keystore/get_keystore.js
@@ -21,7 +21,7 @@ import { existsSync } from 'fs';
import { join } from 'path';
import { Logger } from '../cli_plugin/lib/logger';
-import { getConfigDirectory, getDataPath } from '../core/server/path';
+import { getConfigDirectory, getDataPath } from '@kbn/utils';
export function getKeystore() {
const configKeystore = join(getConfigDirectory(), 'kibana.keystore');
diff --git a/src/cli_plugin/install/index.js b/src/cli_plugin/install/index.js
index bc7e95b8489f0..eff14906853c1 100644
--- a/src/cli_plugin/install/index.js
+++ b/src/cli_plugin/install/index.js
@@ -17,10 +17,10 @@
* under the License.
*/
+import { getConfigPath } from '@kbn/utils';
import { pkg } from '../../core/server/utils';
import { install } from './install';
import { Logger } from '../lib/logger';
-import { getConfigPath } from '../../core/server/path';
import { parse, parseMilliseconds } from './settings';
import { logWarnings } from '../lib/log_warnings';
diff --git a/src/cli_plugin/remove/index.js b/src/cli_plugin/remove/index.js
index c3bd96086db9b..b9c37c0cf802b 100644
--- a/src/cli_plugin/remove/index.js
+++ b/src/cli_plugin/remove/index.js
@@ -17,10 +17,10 @@
* under the License.
*/
+import { getConfigPath } from '@kbn/utils';
import { remove } from './remove';
import { Logger } from '../lib/logger';
import { parse } from './settings';
-import { getConfigPath } from '../../core/server/path';
import { logWarnings } from '../lib/log_warnings';
function processCommand(command, options) {
diff --git a/src/core/public/application/capabilities/capabilities_service.mock.ts b/src/core/public/application/capabilities/capabilities_service.mock.ts
index d7b0c27879aad..ee37854762666 100644
--- a/src/core/public/application/capabilities/capabilities_service.mock.ts
+++ b/src/core/public/application/capabilities/capabilities_service.mock.ts
@@ -16,9 +16,10 @@
* specific language governing permissions and limitations
* under the License.
*/
+
+import { deepFreeze } from '@kbn/std';
import type { PublicMethodsOf } from '@kbn/utility-types';
import { CapabilitiesService, CapabilitiesStart } from './capabilities_service';
-import { deepFreeze } from '../../../utils';
const createStartContractMock = (): jest.Mocked => ({
capabilities: deepFreeze({
diff --git a/src/core/public/application/capabilities/capabilities_service.tsx b/src/core/public/application/capabilities/capabilities_service.tsx
index 7304a8e5a66bc..1164164aec4c5 100644
--- a/src/core/public/application/capabilities/capabilities_service.tsx
+++ b/src/core/public/application/capabilities/capabilities_service.tsx
@@ -17,9 +17,9 @@
* under the License.
*/
import { RecursiveReadonly } from '@kbn/utility-types';
+import { deepFreeze } from '@kbn/std';
import { Capabilities } from '../../../types/capabilities';
-import { deepFreeze } from '../../../utils';
import { HttpStart } from '../../http';
interface StartDeps {
diff --git a/src/core/public/chrome/nav_links/nav_link.ts b/src/core/public/chrome/nav_links/nav_link.ts
index 4b82e0ced4505..80f0265819c40 100644
--- a/src/core/public/chrome/nav_links/nav_link.ts
+++ b/src/core/public/chrome/nav_links/nav_link.ts
@@ -17,7 +17,7 @@
* under the License.
*/
-import { pick } from '../../../utils';
+import { pick } from '@kbn/std';
import { AppCategory } from '../../';
/**
diff --git a/src/core/public/core_system.ts b/src/core/public/core_system.ts
index 006d0036f7a12..a1d6f9c988b27 100644
--- a/src/core/public/core_system.ts
+++ b/src/core/public/core_system.ts
@@ -17,6 +17,7 @@
* under the License.
*/
+import { pick } from '@kbn/std';
import { CoreId } from '../server';
import { PackageInfo, EnvironmentMode } from '../server/types';
import { CoreSetup, CoreStart } from '.';
@@ -35,7 +36,6 @@ import { OverlayService } from './overlays';
import { PluginsService } from './plugins';
import { UiSettingsService } from './ui_settings';
import { ApplicationService } from './application';
-import { pick } from '../utils/';
import { DocLinksService } from './doc_links';
import { RenderingService } from './rendering';
import { SavedObjectsService } from './saved_objects';
diff --git a/src/core/public/doc_links/doc_links_service.ts b/src/core/public/doc_links/doc_links_service.ts
index fae7a272c9635..47f58a3a9fcbf 100644
--- a/src/core/public/doc_links/doc_links_service.ts
+++ b/src/core/public/doc_links/doc_links_service.ts
@@ -17,8 +17,8 @@
* under the License.
*/
+import { deepFreeze } from '@kbn/std';
import { InjectedMetadataSetup } from '../injected_metadata';
-import { deepFreeze } from '../../utils';
interface StartDeps {
injectedMetadata: InjectedMetadataSetup;
diff --git a/src/core/public/http/base_path.ts b/src/core/public/http/base_path.ts
index ac85d71c793fe..5d9eb51023b78 100644
--- a/src/core/public/http/base_path.ts
+++ b/src/core/public/http/base_path.ts
@@ -35,7 +35,7 @@
* under the License.
*/
-import { modifyUrl } from '../../utils';
+import { modifyUrl } from '@kbn/std';
export class BasePath {
constructor(
diff --git a/src/core/public/index.ts b/src/core/public/index.ts
index a9774dafd2340..24d19e2d32074 100644
--- a/src/core/public/index.ts
+++ b/src/core/public/index.ts
@@ -68,7 +68,6 @@ import { UiSettingsState, IUiSettingsClient } from './ui_settings';
import { ApplicationSetup, Capabilities, ApplicationStart } from './application';
import { DocLinksStart } from './doc_links';
import { SavedObjectsStart } from './saved_objects';
-export { PackageInfo, EnvironmentMode } from '../server/types';
import {
IContextContainer,
IContextProvider,
@@ -78,17 +77,9 @@ import {
HandlerParameters,
} from './context';
+export { PackageInfo, EnvironmentMode } from '../server/types';
export { CoreContext, CoreSystem } from './core_system';
-export {
- DEFAULT_APP_CATEGORIES,
- getFlattenedObject,
- URLMeaningfulParts,
- modifyUrl,
- isRelativeUrl,
- Freezable,
- deepFreeze,
- assertNever,
-} from '../utils';
+export { DEFAULT_APP_CATEGORIES } from '../utils';
export {
AppCategory,
UiSettingsParams,
diff --git a/src/core/public/injected_metadata/injected_metadata_service.ts b/src/core/public/injected_metadata/injected_metadata_service.ts
index 23630a5bcf228..5b51bc823d166 100644
--- a/src/core/public/injected_metadata/injected_metadata_service.ts
+++ b/src/core/public/injected_metadata/injected_metadata_service.ts
@@ -18,6 +18,7 @@
*/
import { get } from 'lodash';
+import { deepFreeze } from '@kbn/std';
import { DiscoveredPlugin, PluginName } from '../../server';
import {
EnvironmentMode,
@@ -25,7 +26,6 @@ import {
UiSettingsParams,
UserProvidedValues,
} from '../../server/types';
-import { deepFreeze } from '../../utils/';
import { AppCategory } from '../';
export interface InjectedPluginMetadata {
diff --git a/src/core/public/plugins/plugins_service.ts b/src/core/public/plugins/plugins_service.ts
index f9bc40ca52601..87219f4c0bdd3 100644
--- a/src/core/public/plugins/plugins_service.ts
+++ b/src/core/public/plugins/plugins_service.ts
@@ -17,6 +17,7 @@
* under the License.
*/
+import { withTimeout } from '@kbn/std';
import { PluginName, PluginOpaqueId } from '../../server';
import { CoreService } from '../../types';
import { CoreContext } from '../core_system';
@@ -28,7 +29,6 @@ import {
} from './plugin_context';
import { InternalCoreSetup, InternalCoreStart } from '../core_system';
import { InjectedPluginMetadata } from '../injected_metadata';
-import { withTimeout } from '../../utils';
const Sec = 1000;
/** @internal */
diff --git a/src/core/public/public.api.md b/src/core/public/public.api.md
index a4f9234b539d6..d0b9e115bd524 100644
--- a/src/core/public/public.api.md
+++ b/src/core/public/public.api.md
@@ -21,7 +21,6 @@ import { Location } from 'history';
import { LocationDescriptorObject } from 'history';
import { MaybePromise } from '@kbn/utility-types';
import { Observable } from 'rxjs';
-import { ParsedQuery } from 'query-string';
import { Path } from 'history';
import { PublicMethodsOf } from '@kbn/utility-types';
import { PublicUiSettingsParams as PublicUiSettingsParams_2 } from 'src/core/server/types';
@@ -185,9 +184,6 @@ export type AppUpdatableFields = Pick Partial | undefined;
-// @public
-export function assertNever(x: never): never;
-
// @public
export interface Capabilities {
[key: string]: Record>;
@@ -444,9 +440,6 @@ export class CoreSystem {
stop(): void;
}
-// @public
-export function deepFreeze(object: T): RecursiveReadonly;
-
// @internal (undocumented)
export const DEFAULT_APP_CATEGORIES: Readonly<{
kibana: {
@@ -616,16 +609,6 @@ export interface FatalErrorsSetup {
// @public
export type FatalErrorsStart = FatalErrorsSetup;
-// @public (undocumented)
-export type Freezable = {
- [k: string]: any;
-} | any[];
-
-// @public
-export function getFlattenedObject(rootValue: Record): {
- [key: string]: any;
-};
-
// @public
export type HandlerContextType> = T extends HandlerFunction ? U : never;
@@ -837,9 +820,6 @@ export interface ImageValidation {
};
}
-// @public
-export function isRelativeUrl(candidatePath: string): boolean;
-
// @public
export type IToasts = Pick;
@@ -868,9 +848,6 @@ export interface IUiSettingsClient {
set: (key: string, value: any) => Promise;
}
-// @public
-export function modifyUrl(url: string, urlModifier: (urlParts: URLMeaningfulParts) => Partial | void): string;
-
// @public
export type MountPoint = (element: T) => UnmountCallback;
@@ -1447,26 +1424,6 @@ export type UnmountCallback = () => void;
// @public
export const URL_MAX_LENGTH: number;
-// @public
-export interface URLMeaningfulParts {
- // (undocumented)
- auth?: string | null;
- // (undocumented)
- hash?: string | null;
- // (undocumented)
- hostname?: string | null;
- // (undocumented)
- pathname?: string | null;
- // (undocumented)
- port?: string | null;
- // (undocumented)
- protocol?: string | null;
- // (undocumented)
- query: ParsedQuery;
- // (undocumented)
- slashes?: boolean | null;
-}
-
// @public
export interface UserProvidedValues {
// (undocumented)
diff --git a/src/core/server/config/deprecation/deprecation_factory.ts b/src/core/server/config/deprecation/deprecation_factory.ts
index cbc9984924c5d..0598347d2cffc 100644
--- a/src/core/server/config/deprecation/deprecation_factory.ts
+++ b/src/core/server/config/deprecation/deprecation_factory.ts
@@ -17,10 +17,10 @@
* under the License.
*/
-import { set } from '@elastic/safer-lodash-set';
import { get } from 'lodash';
+import { set } from '@elastic/safer-lodash-set';
+import { unset } from '@kbn/std';
import { ConfigDeprecation, ConfigDeprecationLogger, ConfigDeprecationFactory } from './types';
-import { unset } from '../../../utils';
const _rename = (
config: Record,
diff --git a/src/core/server/config/object_to_config_adapter.ts b/src/core/server/config/object_to_config_adapter.ts
index 50b31722dceeb..c4d6ac02ccf05 100644
--- a/src/core/server/config/object_to_config_adapter.ts
+++ b/src/core/server/config/object_to_config_adapter.ts
@@ -17,10 +17,10 @@
* under the License.
*/
-import { set } from '@elastic/safer-lodash-set';
import { cloneDeep, get, has } from 'lodash';
+import { set } from '@elastic/safer-lodash-set';
+import { getFlattenedObject } from '@kbn/std';
-import { getFlattenedObject } from '../../utils';
import { Config, ConfigPath } from './';
/**
diff --git a/src/core/server/elasticsearch/elasticsearch_service.ts b/src/core/server/elasticsearch/elasticsearch_service.ts
index 2cc065aaaaeb1..5d07840e8bda7 100644
--- a/src/core/server/elasticsearch/elasticsearch_service.ts
+++ b/src/core/server/elasticsearch/elasticsearch_service.ts
@@ -19,9 +19,9 @@
import { Observable, Subject } from 'rxjs';
import { first, map, shareReplay, takeUntil } from 'rxjs/operators';
+import { merge } from '@kbn/std';
import { CoreService } from '../../types';
-import { merge } from '../../utils';
import { CoreContext } from '../core_context';
import { Logger } from '../logging';
import {
diff --git a/src/core/server/elasticsearch/legacy/elasticsearch_client_config.ts b/src/core/server/elasticsearch/legacy/elasticsearch_client_config.ts
index 3dbc1c2c647a9..6896c0a2e301f 100644
--- a/src/core/server/elasticsearch/legacy/elasticsearch_client_config.ts
+++ b/src/core/server/elasticsearch/legacy/elasticsearch_client_config.ts
@@ -22,7 +22,7 @@ import { cloneDeep } from 'lodash';
import { Duration } from 'moment';
import { checkServerIdentity } from 'tls';
import url from 'url';
-import { pick } from '../../../utils';
+import { pick } from '@kbn/std';
import { Logger } from '../../logging';
import { ElasticsearchConfig } from '../elasticsearch_config';
diff --git a/src/core/server/environment/create_data_folder.test.ts b/src/core/server/environment/create_data_folder.test.ts
index 2a480a7a3954f..25c1d57996e0d 100644
--- a/src/core/server/environment/create_data_folder.test.ts
+++ b/src/core/server/environment/create_data_folder.test.ts
@@ -17,7 +17,7 @@
* under the License.
*/
-import { PathConfigType } from '../path';
+import { PathConfigType } from '@kbn/utils';
import { createDataFolder } from './create_data_folder';
import { mkdir } from './fs';
import { loggingSystemMock } from '../logging/logging_system.mock';
diff --git a/src/core/server/environment/create_data_folder.ts b/src/core/server/environment/create_data_folder.ts
index 641d95cbf9411..f90e9f93694eb 100644
--- a/src/core/server/environment/create_data_folder.ts
+++ b/src/core/server/environment/create_data_folder.ts
@@ -17,9 +17,9 @@
* under the License.
*/
+import { PathConfigType } from '@kbn/utils';
import { mkdir } from './fs';
import { Logger } from '../logging';
-import { PathConfigType } from '../path';
export async function createDataFolder({
pathConfig,
diff --git a/src/core/server/environment/environment_service.test.ts b/src/core/server/environment/environment_service.test.ts
index 06fd250ebe4f9..f6cffb5e26a9e 100644
--- a/src/core/server/environment/environment_service.test.ts
+++ b/src/core/server/environment/environment_service.test.ts
@@ -21,6 +21,7 @@ import { BehaviorSubject } from 'rxjs';
import { EnvironmentService } from './environment_service';
import { resolveInstanceUuid } from './resolve_uuid';
import { createDataFolder } from './create_data_folder';
+import { writePidFile } from './write_pid_file';
import { CoreContext } from '../core_context';
import { configServiceMock } from '../config/config_service.mock';
@@ -35,12 +36,20 @@ jest.mock('./create_data_folder', () => ({
createDataFolder: jest.fn(),
}));
+jest.mock('./write_pid_file', () => ({
+ writePidFile: jest.fn(),
+}));
+
const pathConfig = {
data: 'data-folder',
};
const serverConfig = {
uuid: 'SOME_UUID',
};
+const pidConfig = {
+ file: '/pid/file',
+ exclusive: 'false',
+};
const getConfigService = () => {
const configService = configServiceMock.create();
@@ -51,6 +60,9 @@ const getConfigService = () => {
if (path === 'server') {
return new BehaviorSubject(serverConfig);
}
+ if (path === 'pid') {
+ return new BehaviorSubject(pidConfig);
+ }
return new BehaviorSubject({});
});
return configService;
@@ -76,7 +88,7 @@ describe('UuidService', () => {
expect(resolveInstanceUuid).toHaveBeenCalledWith({
pathConfig,
serverConfig,
- logger: logger.get('uuid'),
+ logger: logger.get('environment'),
});
});
@@ -86,7 +98,17 @@ describe('UuidService', () => {
expect(createDataFolder).toHaveBeenCalledTimes(1);
expect(createDataFolder).toHaveBeenCalledWith({
pathConfig,
- logger: logger.get('uuid'),
+ logger: logger.get('environment'),
+ });
+ });
+
+ it('calls writePidFile with correct parameters', async () => {
+ const service = new EnvironmentService(coreContext);
+ await service.setup();
+ expect(writePidFile).toHaveBeenCalledTimes(1);
+ expect(writePidFile).toHaveBeenCalledWith({
+ pidConfig,
+ logger: logger.get('environment'),
});
});
diff --git a/src/core/server/environment/environment_service.ts b/src/core/server/environment/environment_service.ts
index 6a0b1122c7053..b051dfbe4c7f2 100644
--- a/src/core/server/environment/environment_service.ts
+++ b/src/core/server/environment/environment_service.ts
@@ -18,13 +18,15 @@
*/
import { take } from 'rxjs/operators';
+import { PathConfigType, config as pathConfigDef } from '@kbn/utils';
import { CoreContext } from '../core_context';
import { Logger } from '../logging';
import { IConfigService } from '../config';
-import { PathConfigType, config as pathConfigDef } from '../path';
import { HttpConfigType, config as httpConfigDef } from '../http';
+import { PidConfigType, config as pidConfigDef } from './pid_config';
import { resolveInstanceUuid } from './resolve_uuid';
import { createDataFolder } from './create_data_folder';
+import { writePidFile } from './write_pid_file';
/**
* @internal
@@ -43,17 +45,24 @@ export class EnvironmentService {
private uuid: string = '';
constructor(core: CoreContext) {
- this.log = core.logger.get('uuid');
+ this.log = core.logger.get('environment');
this.configService = core.configService;
}
public async setup() {
- const [pathConfig, serverConfig] = await Promise.all([
+ const [pathConfig, serverConfig, pidConfig] = await Promise.all([
this.configService.atPath(pathConfigDef.path).pipe(take(1)).toPromise(),
this.configService.atPath(httpConfigDef.path).pipe(take(1)).toPromise(),
+ this.configService.atPath(pidConfigDef.path).pipe(take(1)).toPromise(),
]);
+ // was present in the legacy `pid` file.
+ process.on('unhandledRejection', (reason) => {
+ this.log.warn(`Detected an unhandled Promise rejection.\n${reason}`);
+ });
+
await createDataFolder({ pathConfig, logger: this.log });
+ await writePidFile({ pidConfig, logger: this.log });
this.uuid = await resolveInstanceUuid({
pathConfig,
diff --git a/src/core/server/environment/fs.ts b/src/core/server/environment/fs.ts
index dc040ccb73615..b79c70dbee280 100644
--- a/src/core/server/environment/fs.ts
+++ b/src/core/server/environment/fs.ts
@@ -23,3 +23,4 @@ import { promisify } from 'util';
export const readFile = promisify(Fs.readFile);
export const writeFile = promisify(Fs.writeFile);
export const mkdir = promisify(Fs.mkdir);
+export const exists = promisify(Fs.exists);
diff --git a/src/core/server/environment/index.ts b/src/core/server/environment/index.ts
index 57a26d5ea3c79..92b57c6af2fff 100644
--- a/src/core/server/environment/index.ts
+++ b/src/core/server/environment/index.ts
@@ -18,3 +18,4 @@
*/
export { EnvironmentService, InternalEnvironmentServiceSetup } from './environment_service';
+export { config, PidConfigType } from './pid_config';
diff --git a/src/core/server/environment/pid_config.ts b/src/core/server/environment/pid_config.ts
new file mode 100644
index 0000000000000..ee9963016717e
--- /dev/null
+++ b/src/core/server/environment/pid_config.ts
@@ -0,0 +1,30 @@
+/*
+ * Licensed to Elasticsearch B.V. under one or more contributor
+ * license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright
+ * ownership. Elasticsearch B.V. licenses this file to you under
+ * the Apache License, Version 2.0 (the "License"); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import { TypeOf, schema } from '@kbn/config-schema';
+
+export const config = {
+ path: 'pid',
+ schema: schema.object({
+ file: schema.maybe(schema.string()),
+ exclusive: schema.boolean({ defaultValue: false }),
+ }),
+};
+
+export type PidConfigType = TypeOf;
diff --git a/src/core/server/environment/resolve_uuid.test.ts b/src/core/server/environment/resolve_uuid.test.ts
index d162c9d8e364b..c6e8465507123 100644
--- a/src/core/server/environment/resolve_uuid.test.ts
+++ b/src/core/server/environment/resolve_uuid.test.ts
@@ -18,10 +18,10 @@
*/
import { join } from 'path';
+import { PathConfigType } from '@kbn/utils';
import { loggingSystemMock } from '../logging/logging_system.mock';
import { readFile, writeFile } from './fs';
import { resolveInstanceUuid, UUID_7_6_0_BUG } from './resolve_uuid';
-import { PathConfigType } from '../path';
import { HttpConfigType } from '../http';
jest.mock('uuid', () => ({
diff --git a/src/core/server/environment/resolve_uuid.ts b/src/core/server/environment/resolve_uuid.ts
index 0267e06939997..a640319e30af4 100644
--- a/src/core/server/environment/resolve_uuid.ts
+++ b/src/core/server/environment/resolve_uuid.ts
@@ -19,8 +19,8 @@
import uuid from 'uuid';
import { join } from 'path';
+import { PathConfigType } from '@kbn/utils';
import { readFile, writeFile } from './fs';
-import { PathConfigType } from '../path';
import { HttpConfigType } from '../http';
import { Logger } from '../logging';
diff --git a/src/core/server/environment/write_pid_file.test.ts b/src/core/server/environment/write_pid_file.test.ts
new file mode 100644
index 0000000000000..f9eb78a486970
--- /dev/null
+++ b/src/core/server/environment/write_pid_file.test.ts
@@ -0,0 +1,144 @@
+/*
+ * Licensed to Elasticsearch B.V. under one or more contributor
+ * license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright
+ * ownership. Elasticsearch B.V. licenses this file to you under
+ * the Apache License, Version 2.0 (the "License"); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import { writeFile, exists } from './fs';
+import { writePidFile } from './write_pid_file';
+import { loggingSystemMock } from '../logging/logging_system.mock';
+
+jest.mock('./fs', () => ({
+ writeFile: jest.fn(),
+ exists: jest.fn(),
+}));
+
+const writeFileMock = writeFile as jest.MockedFunction;
+const existsMock = exists as jest.MockedFunction;
+
+const pid = String(process.pid);
+
+describe('writePidFile', () => {
+ let logger: ReturnType;
+
+ beforeEach(() => {
+ logger = loggingSystemMock.createLogger();
+ jest.spyOn(process, 'once');
+
+ writeFileMock.mockImplementation(() => Promise.resolve());
+ existsMock.mockImplementation(() => Promise.resolve(false));
+ });
+
+ afterEach(() => {
+ jest.clearAllMocks();
+ });
+
+ const allLogs = () =>
+ Object.entries(loggingSystemMock.collect(logger)).reduce((messages, [key, value]) => {
+ return [...messages, ...(key === 'log' ? [] : (value as any[]).map(([msg]) => [key, msg]))];
+ }, [] as any[]);
+
+ it('does nothing if `pid.file` is not set', async () => {
+ await writePidFile({
+ pidConfig: {
+ file: undefined,
+ exclusive: false,
+ },
+ logger,
+ });
+ expect(writeFile).not.toHaveBeenCalled();
+ expect(process.once).not.toHaveBeenCalled();
+ expect(allLogs()).toMatchInlineSnapshot(`Array []`);
+ });
+
+ it('writes the pid file to `pid.file`', async () => {
+ existsMock.mockResolvedValue(false);
+
+ await writePidFile({
+ pidConfig: {
+ file: '/pid-file',
+ exclusive: false,
+ },
+ logger,
+ });
+
+ expect(writeFile).toHaveBeenCalledTimes(1);
+ expect(writeFile).toHaveBeenCalledWith('/pid-file', pid);
+
+ expect(process.once).toHaveBeenCalledTimes(2);
+ expect(process.once).toHaveBeenCalledWith('exit', expect.any(Function));
+ expect(process.once).toHaveBeenCalledWith('SIGINT', expect.any(Function));
+
+ expect(allLogs()).toMatchInlineSnapshot(`
+ Array [
+ Array [
+ "debug",
+ "wrote pid file to /pid-file",
+ ],
+ ]
+ `);
+ });
+
+ it('throws an error if the file exists and `pid.exclusive is true`', async () => {
+ existsMock.mockResolvedValue(true);
+
+ await expect(
+ writePidFile({
+ pidConfig: {
+ file: '/pid-file',
+ exclusive: true,
+ },
+ logger,
+ })
+ ).rejects.toThrowErrorMatchingInlineSnapshot(`"pid file already exists at /pid-file"`);
+
+ expect(writeFile).not.toHaveBeenCalled();
+ expect(process.once).not.toHaveBeenCalled();
+ expect(allLogs()).toMatchInlineSnapshot(`Array []`);
+ });
+
+ it('logs a warning if the file exists and `pid.exclusive` is false', async () => {
+ existsMock.mockResolvedValue(true);
+
+ await writePidFile({
+ pidConfig: {
+ file: '/pid-file',
+ exclusive: false,
+ },
+ logger,
+ });
+
+ expect(writeFile).toHaveBeenCalledTimes(1);
+ expect(writeFile).toHaveBeenCalledWith('/pid-file', pid);
+
+ expect(process.once).toHaveBeenCalledTimes(2);
+ expect(process.once).toHaveBeenCalledWith('exit', expect.any(Function));
+ expect(process.once).toHaveBeenCalledWith('SIGINT', expect.any(Function));
+
+ expect(allLogs()).toMatchInlineSnapshot(`
+ Array [
+ Array [
+ "debug",
+ "wrote pid file to /pid-file",
+ ],
+ Array [
+ "warn",
+ "pid file already exists at /pid-file",
+ ],
+ ]
+ `);
+ });
+});
diff --git a/src/core/server/environment/write_pid_file.ts b/src/core/server/environment/write_pid_file.ts
new file mode 100644
index 0000000000000..6ee20af02d7b0
--- /dev/null
+++ b/src/core/server/environment/write_pid_file.ts
@@ -0,0 +1,64 @@
+/*
+ * Licensed to Elasticsearch B.V. under one or more contributor
+ * license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright
+ * ownership. Elasticsearch B.V. licenses this file to you under
+ * the Apache License, Version 2.0 (the "License"); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import { unlinkSync as unlink } from 'fs';
+import once from 'lodash/once';
+import { Logger } from '../logging';
+import { writeFile, exists } from './fs';
+import { PidConfigType } from './pid_config';
+
+export const writePidFile = async ({
+ pidConfig,
+ logger,
+}: {
+ pidConfig: PidConfigType;
+ logger: Logger;
+}) => {
+ const path = pidConfig.file;
+ if (!path) {
+ return;
+ }
+
+ const pid = String(process.pid);
+
+ if (await exists(path)) {
+ const message = `pid file already exists at ${path}`;
+ if (pidConfig.exclusive) {
+ throw new Error(message);
+ } else {
+ logger.warn(message, { path, pid });
+ }
+ }
+
+ await writeFile(path, pid);
+
+ logger.debug(`wrote pid file to ${path}`, { path, pid });
+
+ const clean = once(() => {
+ unlink(path);
+ });
+
+ process.once('exit', clean); // for "natural" exits
+ process.once('SIGINT', () => {
+ // for Ctrl-C exits
+ clean();
+ // resend SIGINT
+ process.kill(process.pid, 'SIGINT');
+ });
+};
diff --git a/src/core/server/http/base_path_service.ts b/src/core/server/http/base_path_service.ts
index 093d73b2da3bf..059eb36f42dd5 100644
--- a/src/core/server/http/base_path_service.ts
+++ b/src/core/server/http/base_path_service.ts
@@ -16,9 +16,9 @@
* specific language governing permissions and limitations
* under the License.
*/
-import { ensureRawRequest, KibanaRequest, LegacyRequest } from './router';
+import { modifyUrl } from '@kbn/std';
-import { modifyUrl } from '../../utils';
+import { ensureRawRequest, KibanaRequest, LegacyRequest } from './router';
/**
* Access or manipulate the Kibana base path
diff --git a/src/core/server/http/http_service.ts b/src/core/server/http/http_service.ts
index c2fd653918171..82b141c8e50dd 100644
--- a/src/core/server/http/http_service.ts
+++ b/src/core/server/http/http_service.ts
@@ -20,9 +20,9 @@
import { Observable, Subscription, combineLatest } from 'rxjs';
import { first, map } from 'rxjs/operators';
import { Server } from 'hapi';
+import { pick } from '@kbn/std';
import { CoreService } from '../../types';
-import { pick } from '../../utils';
import { Logger, LoggerFactory } from '../logging';
import { ContextSetup } from '../context';
import { Env } from '../config';
diff --git a/src/core/server/http/router/headers.ts b/src/core/server/http/router/headers.ts
index f27f5e937b2c0..498dd153a43dd 100644
--- a/src/core/server/http/router/headers.ts
+++ b/src/core/server/http/router/headers.ts
@@ -17,8 +17,7 @@
* under the License.
*/
import { IncomingHttpHeaders } from 'http';
-
-import { pick } from '../../../utils';
+import { pick } from '@kbn/std';
/**
* Creates a Union type of all known keys of a given interface.
diff --git a/src/core/server/http/router/request.ts b/src/core/server/http/router/request.ts
index 76f8761a7e998..e04f8585981b5 100644
--- a/src/core/server/http/router/request.ts
+++ b/src/core/server/http/router/request.ts
@@ -23,8 +23,8 @@ import { Request, RouteOptionsApp, ApplicationState } from 'hapi';
import { Observable, fromEvent, merge } from 'rxjs';
import { shareReplay, first, takeUntil } from 'rxjs/operators';
import { RecursiveReadonly } from '@kbn/utility-types';
+import { deepFreeze } from '@kbn/std';
-import { deepFreeze } from '../../../utils';
import { Headers } from './headers';
import { RouteMethod, RouteConfigOptions, validBodyOutput, isSafeMethod } from './route';
import { KibanaSocket, IKibanaSocket } from './socket';
diff --git a/src/core/server/index.ts b/src/core/server/index.ts
index d127471348d9f..01797d073ae2e 100644
--- a/src/core/server/index.ts
+++ b/src/core/server/index.ts
@@ -322,16 +322,7 @@ export {
MetricsServiceSetup,
} from './metrics';
-export {
- DEFAULT_APP_CATEGORIES,
- getFlattenedObject,
- URLMeaningfulParts,
- modifyUrl,
- isRelativeUrl,
- Freezable,
- deepFreeze,
- assertNever,
-} from '../utils';
+export { DEFAULT_APP_CATEGORIES } from '../utils';
export {
SavedObject,
diff --git a/src/core/server/legacy/config/get_unused_config_keys.ts b/src/core/server/legacy/config/get_unused_config_keys.ts
index d10c574f04974..c15c3b270df05 100644
--- a/src/core/server/legacy/config/get_unused_config_keys.ts
+++ b/src/core/server/legacy/config/get_unused_config_keys.ts
@@ -18,8 +18,8 @@
*/
import { difference } from 'lodash';
+import { getFlattenedObject } from '@kbn/std';
import { unset } from '../../../../legacy/utils';
-import { getFlattenedObject } from '../../../utils';
import { hasConfigPathIntersection } from '../../config';
import { LegacyPluginSpec, LegacyConfig, LegacyVars } from '../types';
diff --git a/src/core/server/legacy/legacy_service.ts b/src/core/server/legacy/legacy_service.ts
index d07c81b8b5ebe..fd3e3a694e6ae 100644
--- a/src/core/server/legacy/legacy_service.ts
+++ b/src/core/server/legacy/legacy_service.ts
@@ -20,6 +20,7 @@ import type { PublicMethodsOf } from '@kbn/utility-types';
import { combineLatest, ConnectableObservable, EMPTY, Observable, Subscription } from 'rxjs';
import { first, map, publishReplay, tap } from 'rxjs/operators';
+import { PathConfigType } from '@kbn/utils';
import { CoreService } from '../../types';
import { Config } from '../config';
import { CoreContext } from '../core_context';
@@ -27,7 +28,6 @@ import { CspConfigType, config as cspConfig } from '../csp';
import { DevConfig, DevConfigType, config as devConfig } from '../dev';
import { BasePathProxyServer, HttpConfig, HttpConfigType, config as httpConfig } from '../http';
import { Logger } from '../logging';
-import { PathConfigType } from '../path';
import { findLegacyPluginSpecs, logLegacyThirdPartyPluginDeprecationWarning } from './plugins';
import {
ILegacyInternals,
diff --git a/src/core/server/logging/appenders/appenders.ts b/src/core/server/logging/appenders/appenders.ts
index edfce4988275a..9c19ee2bd8be5 100644
--- a/src/core/server/logging/appenders/appenders.ts
+++ b/src/core/server/logging/appenders/appenders.ts
@@ -18,8 +18,8 @@
*/
import { schema } from '@kbn/config-schema';
+import { assertNever } from '@kbn/std';
-import { assertNever } from '../../../utils';
import {
LegacyAppender,
LegacyAppenderConfig,
diff --git a/src/core/server/logging/layouts/layouts.ts b/src/core/server/logging/layouts/layouts.ts
index 124c007bae104..03e8adbee6311 100644
--- a/src/core/server/logging/layouts/layouts.ts
+++ b/src/core/server/logging/layouts/layouts.ts
@@ -18,8 +18,8 @@
*/
import { schema } from '@kbn/config-schema';
+import { assertNever } from '@kbn/std';
-import { assertNever } from '../../../utils';
import { LogRecord } from '../log_record';
import { JsonLayout, JsonLayoutConfigType } from './json_layout';
import { PatternLayout, PatternLayoutConfigType } from './pattern_layout';
diff --git a/src/core/server/logging/log_level.ts b/src/core/server/logging/log_level.ts
index 577239ddae8e5..165e56e632d6d 100644
--- a/src/core/server/logging/log_level.ts
+++ b/src/core/server/logging/log_level.ts
@@ -17,7 +17,7 @@
* under the License.
*/
-import { assertNever } from '../../utils';
+import { assertNever } from '@kbn/std';
/**
* Possible log level string values.
diff --git a/src/core/server/plugins/plugin_context.ts b/src/core/server/plugins/plugin_context.ts
index af0b0e19b3227..8d17300965680 100644
--- a/src/core/server/plugins/plugin_context.ts
+++ b/src/core/server/plugins/plugin_context.ts
@@ -19,6 +19,8 @@
import { map, shareReplay } from 'rxjs/operators';
import { combineLatest } from 'rxjs';
+import { PathConfigType, config as pathConfig } from '@kbn/utils';
+import { pick, deepFreeze } from '@kbn/std';
import { CoreContext } from '../core_context';
import { PluginWrapper } from './plugin';
import { PluginsServiceSetupDeps, PluginsServiceStartDeps } from './plugins_service';
@@ -28,13 +30,11 @@ import {
PluginOpaqueId,
SharedGlobalConfigKeys,
} from './types';
-import { PathConfigType, config as pathConfig } from '../path';
import { KibanaConfigType, config as kibanaConfig } from '../kibana_config';
import {
ElasticsearchConfigType,
config as elasticsearchConfig,
} from '../elasticsearch/elasticsearch_config';
-import { pick, deepFreeze } from '../../utils';
import { CoreSetup, CoreStart } from '..';
export interface InstanceInfo {
diff --git a/src/core/server/plugins/plugins_service.ts b/src/core/server/plugins/plugins_service.ts
index 30cd47c9d44e1..e8fe42ee491ca 100644
--- a/src/core/server/plugins/plugins_service.ts
+++ b/src/core/server/plugins/plugins_service.ts
@@ -20,9 +20,10 @@
import Path from 'path';
import { Observable } from 'rxjs';
import { filter, first, map, mergeMap, tap, toArray } from 'rxjs/operators';
+import { pick } from '@kbn/std';
+
import { CoreService } from '../../types';
import { CoreContext } from '../core_context';
-
import { Logger } from '../logging';
import { discover, PluginDiscoveryError, PluginDiscoveryErrorType } from './discovery';
import { PluginWrapper } from './plugin';
@@ -31,7 +32,6 @@ import { PluginsConfig, PluginsConfigType } from './plugins_config';
import { PluginsSystem } from './plugins_system';
import { InternalCoreSetup, InternalCoreStart } from '../internal_types';
import { IConfigService } from '../config';
-import { pick } from '../../utils';
import { InternalEnvironmentServiceSetup } from '../environment';
/** @internal */
diff --git a/src/core/server/plugins/plugins_system.ts b/src/core/server/plugins/plugins_system.ts
index b2acd9a6fd04b..72d2cfe158b37 100644
--- a/src/core/server/plugins/plugins_system.ts
+++ b/src/core/server/plugins/plugins_system.ts
@@ -17,13 +17,13 @@
* under the License.
*/
+import { withTimeout } from '@kbn/std';
import { CoreContext } from '../core_context';
import { Logger } from '../logging';
import { PluginWrapper } from './plugin';
import { DiscoveredPlugin, PluginName } from './types';
import { createPluginSetupContext, createPluginStartContext } from './plugin_context';
import { PluginsServiceSetupDeps, PluginsServiceStartDeps } from './plugins_service';
-import { withTimeout } from '../../utils';
import { PluginDependencies } from '.';
const Sec = 1000;
diff --git a/src/core/server/plugins/types.ts b/src/core/server/plugins/types.ts
index 517261b5bc9bb..34d5e044222eb 100644
--- a/src/core/server/plugins/types.ts
+++ b/src/core/server/plugins/types.ts
@@ -20,12 +20,12 @@
import { Observable } from 'rxjs';
import { Type } from '@kbn/config-schema';
import { RecursiveReadonly } from '@kbn/utility-types';
+import { PathConfigType } from '@kbn/utils';
import { ConfigPath, EnvironmentMode, PackageInfo, ConfigDeprecationProvider } from '../config';
import { LoggerFactory } from '../logging';
import { KibanaConfigType } from '../kibana_config';
import { ElasticsearchConfigType } from '../elasticsearch/elasticsearch_config';
-import { PathConfigType } from '../path';
import { CoreSetup, CoreStart } from '..';
/**
diff --git a/src/core/server/saved_objects/saved_objects_type_registry.ts b/src/core/server/saved_objects/saved_objects_type_registry.ts
index d0035294226ea..bb840e459bf22 100644
--- a/src/core/server/saved_objects/saved_objects_type_registry.ts
+++ b/src/core/server/saved_objects/saved_objects_type_registry.ts
@@ -17,7 +17,7 @@
* under the License.
*/
-import { deepFreeze } from '../../utils';
+import { deepFreeze } from '@kbn/std';
import { SavedObjectsType } from './types';
/**
diff --git a/src/core/server/server.api.md b/src/core/server/server.api.md
index d6572ee8e7d3e..05eb1b8d42386 100644
--- a/src/core/server/server.api.md
+++ b/src/core/server/server.api.md
@@ -105,7 +105,7 @@ import { NodesInfoParams } from 'elasticsearch';
import { NodesStatsParams } from 'elasticsearch';
import { ObjectType } from '@kbn/config-schema';
import { Observable } from 'rxjs';
-import { ParsedQuery } from 'query-string';
+import { PathConfigType } from '@kbn/utils';
import { PeerCertificate } from 'tls';
import { PingParams } from 'elasticsearch';
import { PutScriptParams } from 'elasticsearch';
@@ -157,9 +157,6 @@ import { Url } from 'url';
// @public (undocumented)
export type AppenderConfigType = ConsoleAppenderConfig | FileAppenderConfig | LegacyAppenderConfig;
-// @public
-export function assertNever(x: never): never;
-
// @public @deprecated (undocumented)
export interface AssistanceAPIResponse {
// (undocumented)
@@ -501,9 +498,6 @@ export interface CustomHttpResponseOptions(object: T): RecursiveReadonly;
-
// @internal (undocumented)
export const DEFAULT_APP_CATEGORIES: Readonly<{
kibana: {
@@ -713,11 +707,6 @@ export interface FakeRequest {
headers: Headers;
}
-// @public (undocumented)
-export type Freezable = {
- [k: string]: any;
-} | any[];
-
// @public
export type GetAuthHeaders = (request: KibanaRequest | LegacyRequest) => AuthHeaders | undefined;
@@ -727,11 +716,6 @@ export type GetAuthState = (request: KibanaRequest | LegacyRequest)
state: T;
};
-// @public
-export function getFlattenedObject(rootValue: Record): {
- [key: string]: any;
-};
-
// @public (undocumented)
export interface GetResponse {
// (undocumented)
@@ -963,9 +947,6 @@ export interface IScopedClusterClient {
readonly asInternalUser: ElasticsearchClient;
}
-// @public
-export function isRelativeUrl(candidatePath: string): boolean;
-
// @public
export interface IUiSettingsClient {
get: (key: string) => Promise;
@@ -1540,9 +1521,6 @@ export type MIGRATION_ASSISTANCE_INDEX_ACTION = 'upgrade' | 'reindex';
// @public @deprecated (undocumented)
export type MIGRATION_DEPRECATION_LEVEL = 'none' | 'info' | 'warning' | 'critical';
-// @public
-export function modifyUrl(url: string, urlModifier: (urlParts: URLMeaningfulParts) => Partial | void): string;
-
// @public
export type MutatingOperationRefreshSetting = boolean | 'wait_for';
@@ -2845,26 +2823,6 @@ export interface UiSettingsServiceStart {
// @public
export type UiSettingsType = 'undefined' | 'json' | 'markdown' | 'number' | 'select' | 'boolean' | 'string' | 'array' | 'image';
-// @public
-export interface URLMeaningfulParts {
- // (undocumented)
- auth?: string | null;
- // (undocumented)
- hash?: string | null;
- // (undocumented)
- hostname?: string | null;
- // (undocumented)
- pathname?: string | null;
- // (undocumented)
- port?: string | null;
- // (undocumented)
- protocol?: string | null;
- // (undocumented)
- query: ParsedQuery;
- // (undocumented)
- slashes?: boolean | null;
-}
-
// @public
export interface UserProvidedValues {
// (undocumented)
@@ -2883,6 +2841,5 @@ export const validBodyOutput: readonly ["data", "stream"];
// src/core/server/legacy/types.ts:135:16 - (ae-forgotten-export) The symbol "LegacyPluginSpec" needs to be exported by the entry point index.d.ts
// src/core/server/plugins/types.ts:272:3 - (ae-forgotten-export) The symbol "KibanaConfigType" needs to be exported by the entry point index.d.ts
// src/core/server/plugins/types.ts:272:3 - (ae-forgotten-export) The symbol "SharedGlobalConfigKeys" needs to be exported by the entry point index.d.ts
-// src/core/server/plugins/types.ts:274:3 - (ae-forgotten-export) The symbol "PathConfigType" needs to be exported by the entry point index.d.ts
```
diff --git a/src/core/server/server.ts b/src/core/server/server.ts
index a02b0f51b559f..c689e2cb70cc9 100644
--- a/src/core/server/server.ts
+++ b/src/core/server/server.ts
@@ -17,6 +17,8 @@
* under the License.
*/
+import { config as pathConfig } from '@kbn/utils';
+import { mapToObject } from '@kbn/std';
import { ConfigService, Env, RawConfigurationProvider, coreDeprecationProvider } from './config';
import { CoreApp } from './core_app';
import { AuditTrailService } from './audit_trail';
@@ -31,7 +33,7 @@ import { PluginsService, config as pluginsConfig } from './plugins';
import { SavedObjectsService } from '../server/saved_objects';
import { MetricsService, opsConfig } from './metrics';
import { CapabilitiesService } from './capabilities';
-import { EnvironmentService } from './environment';
+import { EnvironmentService, config as pidConfig } from './environment';
import { StatusService } from './status/status_service';
import { config as cspConfig } from './csp';
@@ -39,12 +41,10 @@ import { config as elasticsearchConfig } from './elasticsearch';
import { config as httpConfig } from './http';
import { config as loggingConfig } from './logging';
import { config as devConfig } from './dev';
-import { config as pathConfig } from './path';
import { config as kibanaConfig } from './kibana_config';
import { savedObjectsConfig, savedObjectsMigrationConfig } from './saved_objects';
import { config as uiSettingsConfig } from './ui_settings';
import { config as statusConfig } from './status';
-import { mapToObject } from '../utils';
import { ContextService } from './context';
import { RequestHandlerContext } from '.';
import { InternalCoreSetup, InternalCoreStart, ServiceConfigDescriptor } from './internal_types';
@@ -310,6 +310,7 @@ export class Server {
uiSettingsConfig,
opsConfig,
statusConfig,
+ pidConfig,
];
this.configService.addDeprecationProvider(rootConfigPath, coreDeprecationProvider);
diff --git a/src/core/server/status/types.ts b/src/core/server/status/types.ts
index f884b80316fa8..9fa33a8c6d40c 100644
--- a/src/core/server/status/types.ts
+++ b/src/core/server/status/types.ts
@@ -18,7 +18,7 @@
*/
import { Observable } from 'rxjs';
-import { deepFreeze } from '../../utils';
+import { deepFreeze } from '@kbn/std';
import { PluginName } from '../plugins';
/**
diff --git a/src/core/server/ui_settings/settings/navigation.ts b/src/core/server/ui_settings/settings/navigation.ts
index 6483e86a1395a..ec825a2779f38 100644
--- a/src/core/server/ui_settings/settings/navigation.ts
+++ b/src/core/server/ui_settings/settings/navigation.ts
@@ -19,8 +19,8 @@
import { schema } from '@kbn/config-schema';
import { i18n } from '@kbn/i18n';
+import { isRelativeUrl } from '@kbn/std';
import { UiSettingsParams } from '../../../types';
-import { isRelativeUrl } from '../../../utils';
export const getNavigationSettings = (): Record => {
return {
diff --git a/src/core/server/ui_settings/ui_settings_service.ts b/src/core/server/ui_settings/ui_settings_service.ts
index 8598cf7a62287..25062490f5b6b 100644
--- a/src/core/server/ui_settings/ui_settings_service.ts
+++ b/src/core/server/ui_settings/ui_settings_service.ts
@@ -19,10 +19,11 @@
import { Observable } from 'rxjs';
import { first } from 'rxjs/operators';
+import { mapToObject } from '@kbn/std';
+
import { CoreService } from '../../types';
import { CoreContext } from '../core_context';
import { Logger } from '../logging';
-
import { SavedObjectsClientContract } from '../saved_objects/types';
import { InternalSavedObjectsServiceSetup } from '../saved_objects';
import { InternalHttpServiceSetup } from '../http';
@@ -33,7 +34,6 @@ import {
InternalUiSettingsServiceStart,
UiSettingsParams,
} from './types';
-import { mapToObject } from '../../utils/';
import { uiSettingsType } from './saved_objects';
import { registerRoutes } from './routes';
import { getCoreSettings } from './settings';
diff --git a/src/core/utils/context.ts b/src/core/utils/context.ts
index 941bbceb0cd92..f28d3330b8e36 100644
--- a/src/core/utils/context.ts
+++ b/src/core/utils/context.ts
@@ -19,8 +19,8 @@
import { flatten } from 'lodash';
import { ShallowPromise } from '@kbn/utility-types';
-import { pick } from '.';
-import { CoreId, PluginOpaqueId } from '../server';
+import { pick } from '@kbn/std';
+import type { CoreId, PluginOpaqueId } from '../server';
/**
* Make all properties in T optional, except for the properties whose keys are in the union K
diff --git a/src/core/utils/index.ts b/src/core/utils/index.ts
index a6df0992f6cc6..c620e4e5ee155 100644
--- a/src/core/utils/index.ts
+++ b/src/core/utils/index.ts
@@ -17,15 +17,12 @@
* under the License.
*/
-export * from './assert_never';
-export * from './context';
-export * from './deep_freeze';
-export * from './get';
-export * from './map_to_object';
-export * from './merge';
-export * from './pick';
-export * from './promise';
-export * from './url';
-export * from './unset';
-export * from './get_flattened_object';
-export * from './default_app_categories';
+export {
+ ContextContainer,
+ HandlerContextType,
+ HandlerFunction,
+ HandlerParameters,
+ IContextContainer,
+ IContextProvider,
+} from './context';
+export { DEFAULT_APP_CATEGORIES } from './default_app_categories';
diff --git a/src/dev/build/lib/build.test.ts b/src/dev/build/lib/build.test.ts
index 9fdf21cee6567..7ccd5b8e13a2c 100644
--- a/src/dev/build/lib/build.test.ts
+++ b/src/dev/build/lib/build.test.ts
@@ -17,7 +17,8 @@
* under the License.
*/
-import { REPO_ROOT, createAbsolutePathSerializer } from '@kbn/dev-utils';
+import { REPO_ROOT } from '@kbn/utils';
+import { createAbsolutePathSerializer } from '@kbn/dev-utils';
import { Config } from './config';
import { Build } from './build';
diff --git a/src/dev/build/lib/config.test.ts b/src/dev/build/lib/config.test.ts
index 0539adc840a6a..bb4d4c000e9d5 100644
--- a/src/dev/build/lib/config.test.ts
+++ b/src/dev/build/lib/config.test.ts
@@ -19,7 +19,8 @@
import { resolve } from 'path';
-import { createAbsolutePathSerializer, REPO_ROOT } from '@kbn/dev-utils';
+import { REPO_ROOT } from '@kbn/utils';
+import { createAbsolutePathSerializer } from '@kbn/dev-utils';
import pkg from '../../../../package.json';
import { Config } from './config';
diff --git a/src/dev/build/tasks/build_kibana_platform_plugins.ts b/src/dev/build/tasks/build_kibana_platform_plugins.ts
index 48625078e9bd1..44b441ad898c3 100644
--- a/src/dev/build/tasks/build_kibana_platform_plugins.ts
+++ b/src/dev/build/tasks/build_kibana_platform_plugins.ts
@@ -17,7 +17,8 @@
* under the License.
*/
-import { CiStatsReporter, REPO_ROOT } from '@kbn/dev-utils';
+import { REPO_ROOT } from '@kbn/utils';
+import { CiStatsReporter } from '@kbn/dev-utils';
import {
runOptimizer,
OptimizerConfig,
diff --git a/src/dev/build/tasks/nodejs/extract_node_builds_task.test.ts b/src/dev/build/tasks/nodejs/extract_node_builds_task.test.ts
index a5b9e01714f38..cd197db251093 100644
--- a/src/dev/build/tasks/nodejs/extract_node_builds_task.test.ts
+++ b/src/dev/build/tasks/nodejs/extract_node_builds_task.test.ts
@@ -20,12 +20,12 @@
import { readFileSync } from 'fs';
import Path from 'path';
+import { REPO_ROOT } from '@kbn/utils';
import {
ToolingLog,
ToolingLogCollectingWriter,
createAbsolutePathSerializer,
createRecursiveSerializer,
- REPO_ROOT,
} from '@kbn/dev-utils';
import { Config } from '../../lib';
diff --git a/src/dev/build/tasks/nodejs/verify_existing_node_builds_task.test.ts b/src/dev/build/tasks/nodejs/verify_existing_node_builds_task.test.ts
index 1a850890a33fe..9b03dcd828cf9 100644
--- a/src/dev/build/tasks/nodejs/verify_existing_node_builds_task.test.ts
+++ b/src/dev/build/tasks/nodejs/verify_existing_node_builds_task.test.ts
@@ -20,12 +20,12 @@
import Path from 'path';
import Fs from 'fs';
+import { REPO_ROOT } from '@kbn/utils';
import {
ToolingLog,
ToolingLogCollectingWriter,
createAnyInstanceSerializer,
createRecursiveSerializer,
- REPO_ROOT,
} from '@kbn/dev-utils';
import { Config, Platform } from '../../lib';
diff --git a/src/dev/build/tasks/os_packages/docker_generator/templates/Dockerfile b/src/dev/build/tasks/os_packages/docker_generator/templates/Dockerfile
index d235bfe9d6fbc..24649a52b729b 100644
--- a/src/dev/build/tasks/os_packages/docker_generator/templates/Dockerfile
+++ b/src/dev/build/tasks/os_packages/docker_generator/templates/Dockerfile
@@ -85,7 +85,6 @@ RUN groupadd --gid 1000 kibana && \
useradd --uid 1000 --gid 1000 \
--home-dir /usr/share/kibana --no-create-home \
kibana
-USER kibana
LABEL org.label-schema.build-date="{{dockerBuildDate}}" \
org.label-schema.license="{{license}}" \
@@ -115,8 +114,13 @@ LABEL name="Kibana" \
release="1" \
summary="Kibana" \
description="Your window into the Elastic Stack."
+
+RUN mkdir /licenses && \
+ cp LICENSE.txt /licenses/LICENSE
{{/ubi}}
+USER kibana
+
ENTRYPOINT ["/usr/local/bin/dumb-init", "--"]
CMD ["/usr/local/bin/kibana-docker"]
diff --git a/src/dev/ci_setup/setup.sh b/src/dev/ci_setup/setup.sh
index 3351170c29e01..aabc1e75b9025 100755
--- a/src/dev/ci_setup/setup.sh
+++ b/src/dev/ci_setup/setup.sh
@@ -16,12 +16,6 @@ echo " -- TEST_ES_SNAPSHOT_VERSION='$TEST_ES_SNAPSHOT_VERSION'"
echo " -- installing node.js dependencies"
yarn kbn bootstrap --prefer-offline
-###
-### ensure Chromedriver install hook is triggered
-### when modules are up-to-date
-###
-node node_modules/chromedriver/install.js
-
###
### Download es snapshots
###
diff --git a/src/dev/ci_setup/setup_env.sh b/src/dev/ci_setup/setup_env.sh
index 5757d72f99582..72ec73ad810e6 100644
--- a/src/dev/ci_setup/setup_env.sh
+++ b/src/dev/ci_setup/setup_env.sh
@@ -134,13 +134,13 @@ export CYPRESS_DOWNLOAD_MIRROR="https://us-central1-elastic-kibana-184716.cloudf
export CHECKS_REPORTER_ACTIVE=false
# This is mainly for release-manager builds, which run in an environment that doesn't have Chrome installed
-# if [[ "$(which google-chrome-stable)" || "$(which google-chrome)" ]]; then
-# echo "Chrome detected, setting DETECT_CHROMEDRIVER_VERSION=true"
-# export DETECT_CHROMEDRIVER_VERSION=true
-# export CHROMEDRIVER_FORCE_DOWNLOAD=true
-# else
-# echo "Chrome not detected, installing default chromedriver binary for the package version"
-# fi
+if [[ "$(which google-chrome-stable)" || "$(which google-chrome)" ]]; then
+ echo "Chrome detected, setting DETECT_CHROMEDRIVER_VERSION=true"
+ export DETECT_CHROMEDRIVER_VERSION=true
+ export CHROMEDRIVER_FORCE_DOWNLOAD=true
+else
+ echo "Chrome not detected, installing default chromedriver binary for the package version"
+fi
### only run on pr jobs for elastic/kibana, checks-reporter doesn't work for other repos
if [[ "$ghprbPullId" && "$ghprbGhRepository" == 'elastic/kibana' ]] ; then
diff --git a/src/dev/constants.ts b/src/dev/constants.ts
index d1b89719c69b7..9ce18ffdc9bcd 100644
--- a/src/dev/constants.ts
+++ b/src/dev/constants.ts
@@ -17,10 +17,6 @@
* under the License.
*/
-import { dirname } from 'path';
-
-export const REPO_ROOT = dirname(require.resolve('../../package.json'));
-
// Files in directories of this name will be treated as Jest integration tests with instances of
// Elasticsearch and the Kibana server.
export const RESERVED_DIR_JEST_INTEGRATION_TESTS = 'integration_tests';
diff --git a/src/dev/eslint/lint_files.ts b/src/dev/eslint/lint_files.ts
index ba16163fc9bd3..ebd6bedb5f56c 100644
--- a/src/dev/eslint/lint_files.ts
+++ b/src/dev/eslint/lint_files.ts
@@ -19,9 +19,9 @@
import { CLIEngine } from 'eslint';
+import { REPO_ROOT } from '@kbn/utils';
import { createFailError, ToolingLog } from '@kbn/dev-utils';
import { File } from '../file';
-import { REPO_ROOT } from '../constants';
/**
* Lints a list of files with eslint. eslint reports are written to the log
diff --git a/src/dev/license_checker/run_check_licenses_cli.ts b/src/dev/license_checker/run_check_licenses_cli.ts
index 0267a1a90d4fe..70ebb43c788f9 100644
--- a/src/dev/license_checker/run_check_licenses_cli.ts
+++ b/src/dev/license_checker/run_check_licenses_cli.ts
@@ -17,12 +17,12 @@
* under the License.
*/
+import { REPO_ROOT } from '@kbn/utils';
import { run } from '@kbn/dev-utils';
import { getInstalledPackages } from '../npm';
import { LICENSE_WHITELIST, DEV_ONLY_LICENSE_WHITELIST, LICENSE_OVERRIDES } from './config';
import { assertLicensesValid } from './valid';
-import { REPO_ROOT } from '../constants';
run(
async ({ log, flags }) => {
diff --git a/src/dev/notice/cli.js b/src/dev/notice/cli.js
index 34217ef48a33b..ea0f884bb1ea0 100644
--- a/src/dev/notice/cli.js
+++ b/src/dev/notice/cli.js
@@ -22,9 +22,9 @@ import { resolve } from 'path';
import getopts from 'getopts';
import dedent from 'dedent';
+import { REPO_ROOT } from '@kbn/utils';
import { ToolingLog, pickLevelFromFlags } from '@kbn/dev-utils';
-import { REPO_ROOT } from '../constants';
import { generateNoticeFromSource } from './generate_notice_from_source';
const unknownFlags = [];
diff --git a/src/dev/npm/integration_tests/installed_packages.test.ts b/src/dev/npm/integration_tests/installed_packages.test.ts
index 58c954cbc12f7..3aeb5b106c2ec 100644
--- a/src/dev/npm/integration_tests/installed_packages.test.ts
+++ b/src/dev/npm/integration_tests/installed_packages.test.ts
@@ -21,8 +21,8 @@ import { resolve, sep } from 'path';
import { uniq } from 'lodash';
+import { REPO_ROOT } from '@kbn/utils';
import { getInstalledPackages, InstalledPackage } from '../installed_packages';
-import { REPO_ROOT } from '../../constants';
const FIXTURE1_ROOT = resolve(__dirname, '__fixtures__/fixture1');
diff --git a/src/dev/precommit_hook/get_files_for_commit.js b/src/dev/precommit_hook/get_files_for_commit.js
index dc5560be0d1ad..e700b58782174 100644
--- a/src/dev/precommit_hook/get_files_for_commit.js
+++ b/src/dev/precommit_hook/get_files_for_commit.js
@@ -20,7 +20,7 @@
import SimpleGit from 'simple-git';
import { fromNode as fcb } from 'bluebird';
-import { REPO_ROOT } from '../constants';
+import { REPO_ROOT } from '@kbn/utils';
import { File } from '../file';
/**
diff --git a/src/dev/run_check_file_casing.js b/src/dev/run_check_file_casing.js
index bdbf1827897e7..3acff74430abe 100644
--- a/src/dev/run_check_file_casing.js
+++ b/src/dev/run_check_file_casing.js
@@ -19,9 +19,9 @@
import globby from 'globby';
+import { REPO_ROOT } from '@kbn/utils';
import { run } from '@kbn/dev-utils';
import { File } from './file';
-import { REPO_ROOT } from './constants';
import { checkFileCasing } from './precommit_hook/check_file_casing';
run(async ({ log }) => {
diff --git a/src/dev/run_check_lockfile_symlinks.js b/src/dev/run_check_lockfile_symlinks.js
index 5ebb7952e2cf3..c4e040c4bffa3 100644
--- a/src/dev/run_check_lockfile_symlinks.js
+++ b/src/dev/run_check_lockfile_symlinks.js
@@ -21,9 +21,9 @@ import { existsSync, lstatSync, readFileSync, readlinkSync } from 'fs';
import globby from 'globby';
import { dirname } from 'path';
+import { REPO_ROOT } from '@kbn/utils';
import { run, createFailError } from '@kbn/dev-utils';
-import { REPO_ROOT } from './constants';
import { File } from './file';
import { matchesAnyGlob } from './globs';
diff --git a/src/dev/storybook/commands/clean.ts b/src/dev/storybook/commands/clean.ts
index 328c4d9e2c23c..539757d0e7ad2 100644
--- a/src/dev/storybook/commands/clean.ts
+++ b/src/dev/storybook/commands/clean.ts
@@ -18,7 +18,7 @@
*/
import { ToolingLog } from '@kbn/dev-utils';
-import { REPO_ROOT } from '@kbn/dev-utils';
+import { REPO_ROOT } from '@kbn/utils';
import { join } from 'path';
import del from 'del';
diff --git a/src/dev/storybook/run_storybook_cli.ts b/src/dev/storybook/run_storybook_cli.ts
index 7f97cff91aaaa..b1e8d882e5352 100644
--- a/src/dev/storybook/run_storybook_cli.ts
+++ b/src/dev/storybook/run_storybook_cli.ts
@@ -19,7 +19,7 @@
import { join } from 'path';
import { run, createFlagError } from '@kbn/dev-utils';
-import { REPO_ROOT } from '@kbn/dev-utils';
+import { REPO_ROOT } from '@kbn/utils';
import { storybookAliases } from './aliases';
import { clean } from './commands/clean';
diff --git a/src/dev/typescript/get_ts_project_for_absolute_path.ts b/src/dev/typescript/get_ts_project_for_absolute_path.ts
index 54d7e950834a4..0057263660b77 100644
--- a/src/dev/typescript/get_ts_project_for_absolute_path.ts
+++ b/src/dev/typescript/get_ts_project_for_absolute_path.ts
@@ -18,7 +18,7 @@
*/
import { relative, resolve } from 'path';
-import { REPO_ROOT } from '../constants';
+import { REPO_ROOT } from '@kbn/utils';
import { File } from '../file';
import { Project } from './project';
import { PROJECTS } from './projects';
diff --git a/src/dev/typescript/project.ts b/src/dev/typescript/project.ts
index 4cf87d812a0b3..811c1792f1988 100644
--- a/src/dev/typescript/project.ts
+++ b/src/dev/typescript/project.ts
@@ -23,7 +23,7 @@ import { basename, dirname, relative, resolve } from 'path';
import { IMinimatch, Minimatch } from 'minimatch';
import { parseConfigFileTextToJson } from 'typescript';
-import { REPO_ROOT } from '../constants';
+import { REPO_ROOT } from '@kbn/utils';
function makeMatchers(directory: string, patterns: string[]) {
return patterns.map(
diff --git a/src/dev/typescript/projects.ts b/src/dev/typescript/projects.ts
index 6fa07190dc43e..4d1e549e192b6 100644
--- a/src/dev/typescript/projects.ts
+++ b/src/dev/typescript/projects.ts
@@ -19,7 +19,7 @@
import glob from 'glob';
import { resolve } from 'path';
-import { REPO_ROOT } from '../constants';
+import { REPO_ROOT } from '@kbn/utils';
import { Project } from './project';
export const PROJECTS = [
diff --git a/src/dev/typescript/run_check_ts_projects_cli.ts b/src/dev/typescript/run_check_ts_projects_cli.ts
index b0c125ea47829..a095bef047711 100644
--- a/src/dev/typescript/run_check_ts_projects_cli.ts
+++ b/src/dev/typescript/run_check_ts_projects_cli.ts
@@ -22,8 +22,8 @@ import { resolve } from 'path';
import execa from 'execa';
import { run } from '@kbn/dev-utils';
+import { REPO_ROOT } from '@kbn/utils';
-const REPO_ROOT = resolve(__dirname, '../../../');
import { File } from '../file';
import { PROJECTS } from './projects';
diff --git a/src/dev/typescript/run_type_check_cli.ts b/src/dev/typescript/run_type_check_cli.ts
index e1fca23274a5a..00968b7259a30 100644
--- a/src/dev/typescript/run_type_check_cli.ts
+++ b/src/dev/typescript/run_type_check_cli.ts
@@ -98,7 +98,7 @@ export async function runTypeCheckCli() {
}
execInProjects(log, projects, process.execPath, (project) => [
- '--max-old-space-size=4096',
+ '--max-old-space-size=5120',
require.resolve('typescript/bin/tsc'),
...['--project', project.tsConfigPath],
...tscArgs,
diff --git a/src/legacy/server/config/schema.js b/src/legacy/server/config/schema.js
index ce7a500a00dc8..f8736fb30f90e 100644
--- a/src/legacy/server/config/schema.js
+++ b/src/legacy/server/config/schema.js
@@ -42,10 +42,7 @@ export default () =>
basePathProxyTarget: Joi.number().default(5603),
}).default(),
- pid: Joi.object({
- file: Joi.string(),
- exclusive: Joi.boolean().default(false),
- }).default(),
+ pid: HANDLED_IN_NEW_PLATFORM,
csp: HANDLED_IN_NEW_PLATFORM,
diff --git a/src/legacy/server/kbn_server.js b/src/legacy/server/kbn_server.js
index a5eefd140c8fa..24d00abb99a05 100644
--- a/src/legacy/server/kbn_server.js
+++ b/src/legacy/server/kbn_server.js
@@ -29,7 +29,6 @@ import { coreMixin } from './core';
import { loggingMixin } from './logging';
import warningsMixin from './warnings';
import { statusMixin } from './status';
-import pidMixin from './pid';
import configCompleteMixin from './config/complete';
import { optimizeMixin } from '../../optimize';
import * as Plugins from './plugins';
@@ -93,9 +92,6 @@ export default class KbnServer {
warningsMixin,
statusMixin,
- // writes pid file
- pidMixin,
-
// scan translations dirs, register locale files and initialize i18n engine.
i18nMixin,
diff --git a/src/legacy/server/logging/log_interceptor.js b/src/legacy/server/logging/log_interceptor.js
index 0754557044583..2298d83aa2857 100644
--- a/src/legacy/server/logging/log_interceptor.js
+++ b/src/legacy/server/logging/log_interceptor.js
@@ -20,7 +20,11 @@
import Stream from 'stream';
import { get, isEqual } from 'lodash';
-const GET_CLIENT_HELLO = /GET_CLIENT_HELLO:http/;
+/**
+ * Matches error messages when clients connect via HTTP instead of HTTPS; see unit test for full message. Warning: this can change when Node
+ * and its bundled OpenSSL binary are upgraded.
+ */
+const OPENSSL_GET_RECORD_REGEX = /ssl3_get_record:http/;
function doTagsMatch(event, tags) {
return isEqual(get(event, 'tags'), tags);
@@ -124,7 +128,7 @@ export class LogInterceptor extends Stream.Transform {
}
downgradeIfHTTPWhenHTTPS(event) {
- return downgradeIfErrorMessage(GET_CLIENT_HELLO, event);
+ return downgradeIfErrorMessage(OPENSSL_GET_RECORD_REGEX, event);
}
_transform(event, enc, next) {
diff --git a/src/legacy/server/logging/log_interceptor.test.js b/src/legacy/server/logging/log_interceptor.test.js
index c99373ebe0a63..492d1ffc8d167 100644
--- a/src/legacy/server/logging/log_interceptor.test.js
+++ b/src/legacy/server/logging/log_interceptor.test.js
@@ -147,7 +147,7 @@ describe('server logging LogInterceptor', () => {
describe('#downgradeIfHTTPWhenHTTPS', () => {
it('transforms http requests when serving https errors', () => {
const message =
- '40735139278848:error:1407609C:SSL routines:SSL23_GET_CLIENT_HELLO:http request:../deps/openssl/openssl/ssl/s23_srvr.c:394';
+ '4584650176:error:1408F09C:SSL routines:ssl3_get_record:http request:../deps/openssl/openssl/ssl/record/ssl3_record.c:322:\n';
const interceptor = new LogInterceptor();
const event = stubClientErrorEvent({ message });
assertDowngraded(interceptor.downgradeIfHTTPWhenHTTPS(event));
diff --git a/src/legacy/server/pid/index.js b/src/legacy/server/pid/index.js
deleted file mode 100644
index d7b9da1292252..0000000000000
--- a/src/legacy/server/pid/index.js
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Licensed to Elasticsearch B.V. under one or more contributor
- * license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright
- * ownership. Elasticsearch B.V. licenses this file to you under
- * the Apache License, Version 2.0 (the "License"); you may
- * not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import _ from 'lodash';
-import Boom from 'boom';
-import Bluebird from 'bluebird';
-import { unlinkSync as unlink } from 'fs';
-const writeFile = Bluebird.promisify(require('fs').writeFile);
-
-export default Bluebird.method(function (kbnServer, server, config) {
- const path = config.get('pid.file');
- if (!path) return;
-
- const pid = String(process.pid);
-
- return writeFile(path, pid, { flag: 'wx' })
- .catch(function (err) {
- if (err.code !== 'EEXIST') throw err;
-
- const message = `pid file already exists at ${path}`;
- const metadata = {
- path: path,
- pid: pid,
- };
-
- if (config.get('pid.exclusive')) {
- throw Boom.internal(message, { message, ...metadata });
- } else {
- server.log(['pid', 'warning'], message, metadata);
- }
-
- return writeFile(path, pid);
- })
- .then(function () {
- server.logWithMetadata(['pid', 'debug'], `wrote pid file to ${path}`, {
- path: path,
- pid: pid,
- });
-
- const clean = _.once(function () {
- unlink(path);
- });
-
- process.once('exit', clean); // for "natural" exits
- process.once('SIGINT', function () {
- // for Ctrl-C exits
- clean();
-
- // resend SIGINT
- process.kill(process.pid, 'SIGINT');
- });
-
- process.on('unhandledRejection', function (reason) {
- server.log(['warning'], `Detected an unhandled Promise rejection.\n${reason}`);
- });
- });
-});
diff --git a/src/plugins/apm_oss/server/tutorial/index_pattern.json b/src/plugins/apm_oss/server/tutorial/index_pattern.json
index 1d061f9e11e61..bb42b223c85ed 100644
--- a/src/plugins/apm_oss/server/tutorial/index_pattern.json
+++ b/src/plugins/apm_oss/server/tutorial/index_pattern.json
@@ -1,11 +1,11 @@
{
"attributes": {
- "fieldFormatMap": "{\"client.bytes\":{\"id\":\"bytes\"},\"client.nat.port\":{\"id\":\"string\"},\"client.port\":{\"id\":\"string\"},\"destination.bytes\":{\"id\":\"bytes\"},\"destination.nat.port\":{\"id\":\"string\"},\"destination.port\":{\"id\":\"string\"},\"event.duration\":{\"id\":\"duration\",\"params\":{\"inputFormat\":\"nanoseconds\",\"outputFormat\":\"asMilliseconds\",\"outputPrecision\":1}},\"event.sequence\":{\"id\":\"string\"},\"event.severity\":{\"id\":\"string\"},\"http.request.body.bytes\":{\"id\":\"bytes\"},\"http.request.bytes\":{\"id\":\"bytes\"},\"http.response.body.bytes\":{\"id\":\"bytes\"},\"http.response.bytes\":{\"id\":\"bytes\"},\"http.response.status_code\":{\"id\":\"string\"},\"log.syslog.facility.code\":{\"id\":\"string\"},\"log.syslog.priority\":{\"id\":\"string\"},\"network.bytes\":{\"id\":\"bytes\"},\"package.size\":{\"id\":\"string\"},\"process.parent.pgid\":{\"id\":\"string\"},\"process.parent.pid\":{\"id\":\"string\"},\"process.parent.ppid\":{\"id\":\"string\"},\"process.parent.thread.id\":{\"id\":\"string\"},\"process.pgid\":{\"id\":\"string\"},\"process.pid\":{\"id\":\"string\"},\"process.ppid\":{\"id\":\"string\"},\"process.thread.id\":{\"id\":\"string\"},\"server.bytes\":{\"id\":\"bytes\"},\"server.nat.port\":{\"id\":\"string\"},\"server.port\":{\"id\":\"string\"},\"source.bytes\":{\"id\":\"bytes\"},\"source.nat.port\":{\"id\":\"string\"},\"source.port\":{\"id\":\"string\"},\"system.cpu.total.norm.pct\":{\"id\":\"percent\"},\"system.memory.actual.free\":{\"id\":\"bytes\"},\"system.memory.total\":{\"id\":\"bytes\"},\"system.process.cpu.total.norm.pct\":{\"id\":\"percent\"},\"system.process.memory.rss.bytes\":{\"id\":\"bytes\"},\"system.process.memory.size\":{\"id\":\"bytes\"},\"url.port\":{\"id\":\"string\"},\"view spans\":{\"id\":\"url\",\"params\":{\"labelTemplate\":\"View Spans\"}}}",
- "fields": "[{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"@timestamp\",\"scripted\":false,\"searchable\":true,\"type\":\"date\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"labels\",\"scripted\":false,\"searchable\":true},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"message\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"tags\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"agent.ephemeral_id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"agent.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"agent.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"agent.type\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"agent.version\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"as.number\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"as.organization.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"as.organization.name.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"client.address\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"client.as.number\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"client.as.organization.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"client.as.organization.name.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"client.bytes\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"client.domain\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"client.geo.city_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"client.geo.continent_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"client.geo.country_iso_code\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"client.geo.country_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"client.geo.location\",\"scripted\":false,\"searchable\":true,\"type\":\"geo_point\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"client.geo.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"client.geo.region_iso_code\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"client.geo.region_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"client.ip\",\"scripted\":false,\"searchable\":true,\"type\":\"ip\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"client.mac\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"client.nat.ip\",\"scripted\":false,\"searchable\":true,\"type\":\"ip\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"client.nat.port\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"client.packets\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"client.port\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"client.registered_domain\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"client.top_level_domain\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"client.user.domain\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"client.user.email\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"client.user.full_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"client.user.full_name.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"client.user.group.domain\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"client.user.group.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"client.user.group.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"client.user.hash\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"client.user.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"client.user.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"client.user.name.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"cloud.account.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"cloud.availability_zone\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"cloud.instance.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"cloud.instance.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"cloud.machine.type\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"cloud.provider\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"cloud.region\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"code_signature.exists\",\"scripted\":false,\"searchable\":true,\"type\":\"boolean\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"code_signature.status\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"code_signature.subject_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"code_signature.trusted\",\"scripted\":false,\"searchable\":true,\"type\":\"boolean\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"code_signature.valid\",\"scripted\":false,\"searchable\":true,\"type\":\"boolean\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"container.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"container.image.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"container.image.tag\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"container.labels\",\"scripted\":false,\"searchable\":true},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"container.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"container.runtime\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"destination.address\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"destination.as.number\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"destination.as.organization.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"destination.as.organization.name.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"destination.bytes\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"destination.domain\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"destination.geo.city_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"destination.geo.continent_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"destination.geo.country_iso_code\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"destination.geo.country_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"destination.geo.location\",\"scripted\":false,\"searchable\":true,\"type\":\"geo_point\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"destination.geo.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"destination.geo.region_iso_code\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"destination.geo.region_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"destination.ip\",\"scripted\":false,\"searchable\":true,\"type\":\"ip\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"destination.mac\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"destination.nat.ip\",\"scripted\":false,\"searchable\":true,\"type\":\"ip\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"destination.nat.port\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"destination.packets\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"destination.port\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"destination.registered_domain\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"destination.top_level_domain\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"destination.user.domain\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"destination.user.email\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"destination.user.full_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"destination.user.full_name.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"destination.user.group.domain\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"destination.user.group.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"destination.user.group.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"destination.user.hash\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"destination.user.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"destination.user.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"destination.user.name.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"dll.code_signature.exists\",\"scripted\":false,\"searchable\":true,\"type\":\"boolean\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"dll.code_signature.status\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"dll.code_signature.subject_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"dll.code_signature.trusted\",\"scripted\":false,\"searchable\":true,\"type\":\"boolean\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"dll.code_signature.valid\",\"scripted\":false,\"searchable\":true,\"type\":\"boolean\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"dll.hash.md5\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"dll.hash.sha1\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"dll.hash.sha256\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"dll.hash.sha512\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"dll.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"dll.path\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"dll.pe.company\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"dll.pe.description\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"dll.pe.file_version\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"dll.pe.original_file_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"dll.pe.product\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"dns.answers\",\"scripted\":false,\"searchable\":true},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"dns.answers.class\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"dns.answers.data\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"dns.answers.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"dns.answers.ttl\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"dns.answers.type\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"dns.header_flags\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"dns.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"dns.op_code\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"dns.question.class\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"dns.question.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"dns.question.registered_domain\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"dns.question.subdomain\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"dns.question.top_level_domain\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"dns.question.type\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"dns.resolved_ip\",\"scripted\":false,\"searchable\":true,\"type\":\"ip\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"dns.response_code\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"dns.type\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"ecs.version\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"error.code\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":4,\"doc_values\":true,\"indexed\":true,\"name\":\"error.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"error.message\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"error.stack_trace\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"error.stack_trace.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"error.type\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"event.action\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"event.category\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"event.code\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"event.created\",\"scripted\":false,\"searchable\":true,\"type\":\"date\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"event.dataset\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"event.duration\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"event.end\",\"scripted\":false,\"searchable\":true,\"type\":\"date\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"event.hash\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"event.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"event.ingested\",\"scripted\":false,\"searchable\":true,\"type\":\"date\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"event.kind\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"event.module\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"event.original\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"event.outcome\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"event.provider\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"event.reference\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"event.risk_score\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"event.risk_score_norm\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"event.sequence\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"event.severity\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"event.start\",\"scripted\":false,\"searchable\":true,\"type\":\"date\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"event.timezone\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"event.type\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"event.url\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"file.accessed\",\"scripted\":false,\"searchable\":true,\"type\":\"date\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"file.attributes\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"file.code_signature.exists\",\"scripted\":false,\"searchable\":true,\"type\":\"boolean\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"file.code_signature.status\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"file.code_signature.subject_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"file.code_signature.trusted\",\"scripted\":false,\"searchable\":true,\"type\":\"boolean\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"file.code_signature.valid\",\"scripted\":false,\"searchable\":true,\"type\":\"boolean\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"file.created\",\"scripted\":false,\"searchable\":true,\"type\":\"date\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"file.ctime\",\"scripted\":false,\"searchable\":true,\"type\":\"date\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"file.device\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"file.directory\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"file.drive_letter\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"file.extension\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"file.gid\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"file.group\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"file.hash.md5\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"file.hash.sha1\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"file.hash.sha256\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"file.hash.sha512\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"file.inode\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"file.mime_type\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"file.mode\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"file.mtime\",\"scripted\":false,\"searchable\":true,\"type\":\"date\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"file.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"file.owner\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"file.path\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"file.path.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"file.pe.company\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"file.pe.description\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"file.pe.file_version\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"file.pe.original_file_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"file.pe.product\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"file.size\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"file.target_path\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"file.target_path.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"file.type\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"file.uid\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"geo.city_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"geo.continent_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"geo.country_iso_code\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"geo.country_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"geo.location\",\"scripted\":false,\"searchable\":true,\"type\":\"geo_point\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"geo.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"geo.region_iso_code\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"geo.region_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"group.domain\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"group.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"group.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"hash.md5\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"hash.sha1\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"hash.sha256\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"hash.sha512\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"host.architecture\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"host.domain\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"host.geo.city_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"host.geo.continent_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"host.geo.country_iso_code\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"host.geo.country_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"host.geo.location\",\"scripted\":false,\"searchable\":true,\"type\":\"geo_point\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"host.geo.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"host.geo.region_iso_code\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"host.geo.region_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"host.hostname\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"host.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"host.ip\",\"scripted\":false,\"searchable\":true,\"type\":\"ip\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"host.mac\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"host.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"host.os.family\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"host.os.full\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"host.os.full.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"host.os.kernel\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"host.os.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"host.os.name.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"host.os.platform\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"host.os.version\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"host.type\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"host.uptime\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"host.user.domain\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"host.user.email\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"host.user.full_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"host.user.full_name.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"host.user.group.domain\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"host.user.group.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"host.user.group.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"host.user.hash\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"host.user.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"host.user.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"host.user.name.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"http.request.body.bytes\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"http.request.body.content\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"http.request.body.content.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"http.request.bytes\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"http.request.method\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"http.request.referrer\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"http.response.body.bytes\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"http.response.body.content\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"http.response.body.content.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"http.response.bytes\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"http.response.status_code\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"http.version\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"interface.alias\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"interface.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"interface.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"log.level\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"log.logger\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"log.origin.file.line\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"log.origin.file.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"log.origin.function\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"log.original\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"log.syslog\",\"scripted\":false,\"searchable\":true},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"log.syslog.facility.code\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"log.syslog.facility.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"log.syslog.priority\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"log.syslog.severity.code\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"log.syslog.severity.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"network.application\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"network.bytes\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"network.community_id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"network.direction\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"network.forwarded_ip\",\"scripted\":false,\"searchable\":true,\"type\":\"ip\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"network.iana_number\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"network.inner\",\"scripted\":false,\"searchable\":true},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"network.inner.vlan.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"network.inner.vlan.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"network.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"network.packets\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"network.protocol\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"network.transport\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"network.type\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"network.vlan.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"network.vlan.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.egress\",\"scripted\":false,\"searchable\":true},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.egress.interface.alias\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.egress.interface.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.egress.interface.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.egress.vlan.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.egress.vlan.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.egress.zone\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.geo.city_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.geo.continent_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.geo.country_iso_code\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.geo.country_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.geo.location\",\"scripted\":false,\"searchable\":true,\"type\":\"geo_point\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.geo.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.geo.region_iso_code\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.geo.region_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.hostname\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.ingress\",\"scripted\":false,\"searchable\":true},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.ingress.interface.alias\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.ingress.interface.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.ingress.interface.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.ingress.vlan.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.ingress.vlan.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.ingress.zone\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.ip\",\"scripted\":false,\"searchable\":true,\"type\":\"ip\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.mac\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.os.family\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.os.full\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.os.full.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.os.kernel\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.os.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.os.name.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.os.platform\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.os.version\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.product\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.serial_number\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.type\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.vendor\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.version\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"organization.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"organization.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"organization.name.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"os.family\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"os.full\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"os.full.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"os.kernel\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"os.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"os.name.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"os.platform\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"os.version\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"package.architecture\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"package.build_version\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"package.checksum\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"package.description\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"package.install_scope\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"package.installed\",\"scripted\":false,\"searchable\":true,\"type\":\"date\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"package.license\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"package.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"package.path\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"package.reference\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"package.size\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"package.type\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"package.version\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"pe.company\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"pe.description\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"pe.file_version\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"pe.original_file_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"pe.product\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.args\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.args_count\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.code_signature.exists\",\"scripted\":false,\"searchable\":true,\"type\":\"boolean\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.code_signature.status\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.code_signature.subject_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.code_signature.trusted\",\"scripted\":false,\"searchable\":true,\"type\":\"boolean\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.code_signature.valid\",\"scripted\":false,\"searchable\":true,\"type\":\"boolean\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.command_line\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.command_line.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.entity_id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.executable\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.executable.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.exit_code\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.hash.md5\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.hash.sha1\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.hash.sha256\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.hash.sha512\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.name.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.parent.args\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.parent.args_count\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.parent.code_signature.exists\",\"scripted\":false,\"searchable\":true,\"type\":\"boolean\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.parent.code_signature.status\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.parent.code_signature.subject_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.parent.code_signature.trusted\",\"scripted\":false,\"searchable\":true,\"type\":\"boolean\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.parent.code_signature.valid\",\"scripted\":false,\"searchable\":true,\"type\":\"boolean\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.parent.command_line\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.parent.command_line.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.parent.entity_id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.parent.executable\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.parent.executable.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.parent.exit_code\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.parent.hash.md5\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.parent.hash.sha1\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.parent.hash.sha256\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.parent.hash.sha512\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.parent.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.parent.name.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.parent.pgid\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.parent.pid\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.parent.ppid\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.parent.start\",\"scripted\":false,\"searchable\":true,\"type\":\"date\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.parent.thread.id\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.parent.thread.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.parent.title\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.parent.title.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.parent.uptime\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.parent.working_directory\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.parent.working_directory.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.pe.company\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.pe.description\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.pe.file_version\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.pe.original_file_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.pe.product\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.pgid\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.pid\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.ppid\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.start\",\"scripted\":false,\"searchable\":true,\"type\":\"date\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.thread.id\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.thread.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.title\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.title.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.uptime\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.working_directory\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.working_directory.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"registry.data.bytes\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"registry.data.strings\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"registry.data.type\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"registry.hive\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"registry.key\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"registry.path\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"registry.value\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"related.hash\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"related.ip\",\"scripted\":false,\"searchable\":true,\"type\":\"ip\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"related.user\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"rule.author\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"rule.category\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"rule.description\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"rule.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"rule.license\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"rule.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"rule.reference\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"rule.ruleset\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"rule.uuid\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"rule.version\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"server.address\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"server.as.number\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"server.as.organization.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"server.as.organization.name.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"server.bytes\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"server.domain\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"server.geo.city_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"server.geo.continent_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"server.geo.country_iso_code\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"server.geo.country_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"server.geo.location\",\"scripted\":false,\"searchable\":true,\"type\":\"geo_point\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"server.geo.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"server.geo.region_iso_code\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"server.geo.region_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"server.ip\",\"scripted\":false,\"searchable\":true,\"type\":\"ip\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"server.mac\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"server.nat.ip\",\"scripted\":false,\"searchable\":true,\"type\":\"ip\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"server.nat.port\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"server.packets\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"server.port\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"server.registered_domain\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"server.top_level_domain\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"server.user.domain\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"server.user.email\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"server.user.full_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"server.user.full_name.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"server.user.group.domain\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"server.user.group.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"server.user.group.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"server.user.hash\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"server.user.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"server.user.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"server.user.name.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"service.ephemeral_id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"service.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"service.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"service.node.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"service.state\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"service.type\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"service.version\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"source.address\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"source.as.number\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"source.as.organization.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"source.as.organization.name.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"source.bytes\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"source.domain\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"source.geo.city_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"source.geo.continent_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"source.geo.country_iso_code\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"source.geo.country_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"source.geo.location\",\"scripted\":false,\"searchable\":true,\"type\":\"geo_point\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"source.geo.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"source.geo.region_iso_code\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"source.geo.region_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"source.ip\",\"scripted\":false,\"searchable\":true,\"type\":\"ip\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"source.mac\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"source.nat.ip\",\"scripted\":false,\"searchable\":true,\"type\":\"ip\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"source.nat.port\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"source.packets\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"source.port\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"source.registered_domain\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"source.top_level_domain\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"source.user.domain\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"source.user.email\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"source.user.full_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"source.user.full_name.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"source.user.group.domain\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"source.user.group.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"source.user.group.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"source.user.hash\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"source.user.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"source.user.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"source.user.name.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"threat.framework\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"threat.tactic.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"threat.tactic.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"threat.tactic.reference\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"threat.technique.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"threat.technique.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"threat.technique.name.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"threat.technique.reference\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"tls.cipher\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"tls.client.certificate\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"tls.client.certificate_chain\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"tls.client.hash.md5\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"tls.client.hash.sha1\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"tls.client.hash.sha256\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"tls.client.issuer\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"tls.client.ja3\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"tls.client.not_after\",\"scripted\":false,\"searchable\":true,\"type\":\"date\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"tls.client.not_before\",\"scripted\":false,\"searchable\":true,\"type\":\"date\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"tls.client.server_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"tls.client.subject\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"tls.client.supported_ciphers\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"tls.curve\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"tls.established\",\"scripted\":false,\"searchable\":true,\"type\":\"boolean\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"tls.next_protocol\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"tls.resumed\",\"scripted\":false,\"searchable\":true,\"type\":\"boolean\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"tls.server.certificate\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"tls.server.certificate_chain\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"tls.server.hash.md5\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"tls.server.hash.sha1\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"tls.server.hash.sha256\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"tls.server.issuer\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"tls.server.ja3s\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"tls.server.not_after\",\"scripted\":false,\"searchable\":true,\"type\":\"date\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"tls.server.not_before\",\"scripted\":false,\"searchable\":true,\"type\":\"date\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"tls.server.subject\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"tls.version\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"tls.version_protocol\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"tracing.trace.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"tracing.transaction.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"url.domain\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"url.extension\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"url.fragment\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"url.full\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"url.full.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"url.original\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"url.original.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"url.password\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"url.path\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"url.port\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"url.query\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"url.registered_domain\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"url.scheme\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"url.top_level_domain\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"url.username\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"user.domain\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"user.email\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"user.full_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"user.full_name.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"user.group.domain\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"user.group.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"user.group.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"user.hash\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"user.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"user.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"user.name.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"user_agent.device.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"user_agent.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"user_agent.original\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"user_agent.original.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"user_agent.os.family\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"user_agent.os.full\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"user_agent.os.full.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"user_agent.os.kernel\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"user_agent.os.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"user_agent.os.name.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"user_agent.os.platform\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"user_agent.os.version\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"user_agent.version\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"vlan.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"vlan.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"vulnerability.category\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"vulnerability.classification\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"vulnerability.description\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"vulnerability.description.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"vulnerability.enumeration\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"vulnerability.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"vulnerability.reference\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"vulnerability.report_id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"vulnerability.scanner.vendor\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"vulnerability.score.base\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"vulnerability.score.environmental\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"vulnerability.score.temporal\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"vulnerability.score.version\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"vulnerability.severity\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"agent.hostname\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"fields\",\"scripted\":false,\"searchable\":true},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"timeseries.instance\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"cloud.project.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"cloud.image.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"docker.container.labels\",\"scripted\":false,\"searchable\":true},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"host.containerized\",\"scripted\":false,\"searchable\":true,\"type\":\"boolean\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"host.os.build\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"host.os.codename\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"kubernetes.pod.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"kubernetes.pod.uid\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"kubernetes.namespace\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"kubernetes.node.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"kubernetes.labels.*\",\"scripted\":false,\"searchable\":true},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"kubernetes.annotations.*\",\"scripted\":false,\"searchable\":true},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"kubernetes.replicaset.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"kubernetes.deployment.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"kubernetes.statefulset.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"kubernetes.container.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"kubernetes.container.image\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"processor.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"processor.event\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":1,\"doc_values\":true,\"indexed\":true,\"name\":\"timestamp.us\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":false,\"enabled\":false,\"indexed\":false,\"name\":\"http.request.headers\",\"scripted\":false,\"searchable\":false},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"http.response.finished\",\"scripted\":false,\"searchable\":true,\"type\":\"boolean\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":false,\"enabled\":false,\"indexed\":false,\"name\":\"http.response.headers\",\"scripted\":false,\"searchable\":false},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"service.environment\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"service.language.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"service.language.version\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"service.runtime.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"service.runtime.version\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"service.framework.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"service.framework.version\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"transaction.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"transaction.sampled\",\"scripted\":false,\"searchable\":true,\"type\":\"boolean\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"transaction.type\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"transaction.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"transaction.name.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"transaction.duration.count\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"transaction.duration.sum.us\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"transaction.self_time.count\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"transaction.self_time.sum.us\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"transaction.breakdown.count\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":1,\"doc_values\":true,\"indexed\":true,\"name\":\"span.type\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":1,\"doc_values\":true,\"indexed\":true,\"name\":\"span.subtype\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"span.self_time.count\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"span.self_time.sum.us\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"trace.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"parent.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.listening\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.version_major\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"experimental\",\"scripted\":false,\"searchable\":true},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"cloud.account.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"cloud.project.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":2,\"doc_values\":true,\"indexed\":true,\"name\":\"error.culprit\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"error.grouping_key\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"error.exception.code\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":2,\"doc_values\":true,\"indexed\":true,\"name\":\"error.exception.message\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"error.exception.module\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":4,\"doc_values\":true,\"indexed\":true,\"name\":\"error.exception.type\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":2,\"doc_values\":true,\"indexed\":true,\"name\":\"error.exception.handled\",\"scripted\":false,\"searchable\":true,\"type\":\"boolean\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"error.log.level\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"error.log.logger_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":2,\"doc_values\":true,\"indexed\":true,\"name\":\"error.log.message\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"error.log.param_message\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"system.cpu.total.norm.pct\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"system.memory.total\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"system.memory.actual.free\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"system.process.cpu.total.norm.pct\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"system.process.memory.size\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"system.process.memory.rss.bytes\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"transaction.root\",\"scripted\":false,\"searchable\":true,\"type\":\"boolean\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":1,\"doc_values\":true,\"indexed\":true,\"name\":\"profile.cpu.ns\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":1,\"doc_values\":true,\"indexed\":true,\"name\":\"profile.samples.count\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":1,\"doc_values\":true,\"indexed\":true,\"name\":\"profile.alloc_objects.count\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":1,\"doc_values\":true,\"indexed\":true,\"name\":\"profile.alloc_space.bytes\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":1,\"doc_values\":true,\"indexed\":true,\"name\":\"profile.inuse_objects.count\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":1,\"doc_values\":true,\"indexed\":true,\"name\":\"profile.inuse_space.bytes\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":1,\"doc_values\":true,\"indexed\":true,\"name\":\"profile.duration\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"profile.top.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":1,\"doc_values\":true,\"indexed\":true,\"name\":\"profile.top.function\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":1,\"doc_values\":true,\"indexed\":true,\"name\":\"profile.top.filename\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":1,\"doc_values\":true,\"indexed\":true,\"name\":\"profile.top.line\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"profile.stack.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"profile.stack.function\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"profile.stack.filename\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"profile.stack.line\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"sourcemap.service.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"sourcemap.service.version\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"sourcemap.bundle_filepath\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"view spans\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"child.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"span.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":1,\"doc_values\":true,\"indexed\":true,\"name\":\"span.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":1,\"doc_values\":true,\"indexed\":true,\"name\":\"span.action\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":1,\"doc_values\":true,\"indexed\":true,\"name\":\"span.start.us\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":1,\"doc_values\":true,\"indexed\":true,\"name\":\"span.duration.us\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"span.sync\",\"scripted\":false,\"searchable\":true,\"type\":\"boolean\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"span.db.link\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"span.db.rows_affected\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"span.destination.service.type\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"span.destination.service.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"span.destination.service.resource\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"span.message.queue.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"span.message.age.ms\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"transaction.duration.us\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"transaction.result\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"transaction.marks\",\"scripted\":false,\"searchable\":true},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"transaction.marks.*.*\",\"scripted\":false,\"searchable\":true},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"transaction.span_count.dropped\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"transaction.message.queue.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"transaction.message.age.ms\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"transaction.duration.histogram\",\"scripted\":false,\"searchable\":true},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":false,\"indexed\":false,\"name\":\"_id\",\"scripted\":false,\"searchable\":false,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":false,\"indexed\":false,\"name\":\"_type\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":false,\"indexed\":false,\"name\":\"_index\",\"scripted\":false,\"searchable\":false,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":false,\"indexed\":false,\"name\":\"_score\",\"scripted\":false,\"searchable\":false,\"type\":\"number\"}]",
+ "fieldFormatMap": "{\"client.bytes\":{\"id\":\"bytes\"},\"client.nat.port\":{\"id\":\"string\"},\"client.port\":{\"id\":\"string\"},\"destination.bytes\":{\"id\":\"bytes\"},\"destination.nat.port\":{\"id\":\"string\"},\"destination.port\":{\"id\":\"string\"},\"event.duration\":{\"id\":\"duration\",\"params\":{\"inputFormat\":\"nanoseconds\",\"outputFormat\":\"asMilliseconds\",\"outputPrecision\":1}},\"event.sequence\":{\"id\":\"string\"},\"event.severity\":{\"id\":\"string\"},\"http.request.body.bytes\":{\"id\":\"bytes\"},\"http.request.bytes\":{\"id\":\"bytes\"},\"http.response.body.bytes\":{\"id\":\"bytes\"},\"http.response.bytes\":{\"id\":\"bytes\"},\"http.response.status_code\":{\"id\":\"string\"},\"log.syslog.facility.code\":{\"id\":\"string\"},\"log.syslog.priority\":{\"id\":\"string\"},\"network.bytes\":{\"id\":\"bytes\"},\"package.size\":{\"id\":\"string\"},\"process.parent.pgid\":{\"id\":\"string\"},\"process.parent.pid\":{\"id\":\"string\"},\"process.parent.ppid\":{\"id\":\"string\"},\"process.parent.thread.id\":{\"id\":\"string\"},\"process.pgid\":{\"id\":\"string\"},\"process.pid\":{\"id\":\"string\"},\"process.ppid\":{\"id\":\"string\"},\"process.thread.id\":{\"id\":\"string\"},\"server.bytes\":{\"id\":\"bytes\"},\"server.nat.port\":{\"id\":\"string\"},\"server.port\":{\"id\":\"string\"},\"source.bytes\":{\"id\":\"bytes\"},\"source.nat.port\":{\"id\":\"string\"},\"source.port\":{\"id\":\"string\"},\"system.cpu.total.norm.pct\":{\"id\":\"percent\"},\"system.memory.actual.free\":{\"id\":\"bytes\"},\"system.memory.total\":{\"id\":\"bytes\"},\"system.process.cgroup.memory.mem.limit.bytes\":{\"id\":\"bytes\"},\"system.process.cgroup.memory.mem.usage.bytes\":{\"id\":\"bytes\"},\"system.process.cgroup.memory.stats.inactive_file.bytes\":{\"id\":\"bytes\"},\"system.process.cpu.total.norm.pct\":{\"id\":\"percent\"},\"system.process.memory.rss.bytes\":{\"id\":\"bytes\"},\"system.process.memory.size\":{\"id\":\"bytes\"},\"url.port\":{\"id\":\"string\"},\"view spans\":{\"id\":\"url\",\"params\":{\"labelTemplate\":\"View Spans\"}}}",
+ "fields": "[{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"@timestamp\",\"scripted\":false,\"searchable\":true,\"type\":\"date\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"labels\",\"scripted\":false,\"searchable\":true},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"message\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"tags\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"agent.ephemeral_id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"agent.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"agent.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"agent.type\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"agent.version\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"as.number\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"as.organization.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"as.organization.name.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"client.address\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"client.as.number\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"client.as.organization.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"client.as.organization.name.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"client.bytes\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"client.domain\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"client.geo.city_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"client.geo.continent_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"client.geo.country_iso_code\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"client.geo.country_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"client.geo.location\",\"scripted\":false,\"searchable\":true,\"type\":\"geo_point\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"client.geo.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"client.geo.region_iso_code\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"client.geo.region_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"client.ip\",\"scripted\":false,\"searchable\":true,\"type\":\"ip\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"client.mac\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"client.nat.ip\",\"scripted\":false,\"searchable\":true,\"type\":\"ip\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"client.nat.port\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"client.packets\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"client.port\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"client.registered_domain\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"client.top_level_domain\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"client.user.domain\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"client.user.email\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"client.user.full_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"client.user.full_name.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"client.user.group.domain\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"client.user.group.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"client.user.group.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"client.user.hash\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"client.user.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"client.user.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"client.user.name.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"cloud.account.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"cloud.availability_zone\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"cloud.instance.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"cloud.instance.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"cloud.machine.type\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"cloud.provider\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"cloud.region\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"code_signature.exists\",\"scripted\":false,\"searchable\":true,\"type\":\"boolean\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"code_signature.status\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"code_signature.subject_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"code_signature.trusted\",\"scripted\":false,\"searchable\":true,\"type\":\"boolean\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"code_signature.valid\",\"scripted\":false,\"searchable\":true,\"type\":\"boolean\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"container.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"container.image.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"container.image.tag\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"container.labels\",\"scripted\":false,\"searchable\":true},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"container.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"container.runtime\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"destination.address\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"destination.as.number\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"destination.as.organization.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"destination.as.organization.name.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"destination.bytes\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"destination.domain\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"destination.geo.city_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"destination.geo.continent_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"destination.geo.country_iso_code\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"destination.geo.country_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"destination.geo.location\",\"scripted\":false,\"searchable\":true,\"type\":\"geo_point\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"destination.geo.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"destination.geo.region_iso_code\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"destination.geo.region_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"destination.ip\",\"scripted\":false,\"searchable\":true,\"type\":\"ip\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"destination.mac\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"destination.nat.ip\",\"scripted\":false,\"searchable\":true,\"type\":\"ip\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"destination.nat.port\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"destination.packets\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"destination.port\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"destination.registered_domain\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"destination.top_level_domain\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"destination.user.domain\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"destination.user.email\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"destination.user.full_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"destination.user.full_name.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"destination.user.group.domain\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"destination.user.group.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"destination.user.group.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"destination.user.hash\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"destination.user.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"destination.user.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"destination.user.name.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"dll.code_signature.exists\",\"scripted\":false,\"searchable\":true,\"type\":\"boolean\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"dll.code_signature.status\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"dll.code_signature.subject_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"dll.code_signature.trusted\",\"scripted\":false,\"searchable\":true,\"type\":\"boolean\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"dll.code_signature.valid\",\"scripted\":false,\"searchable\":true,\"type\":\"boolean\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"dll.hash.md5\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"dll.hash.sha1\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"dll.hash.sha256\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"dll.hash.sha512\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"dll.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"dll.path\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"dll.pe.company\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"dll.pe.description\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"dll.pe.file_version\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"dll.pe.original_file_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"dll.pe.product\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"dns.answers\",\"scripted\":false,\"searchable\":true},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"dns.answers.class\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"dns.answers.data\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"dns.answers.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"dns.answers.ttl\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"dns.answers.type\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"dns.header_flags\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"dns.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"dns.op_code\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"dns.question.class\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"dns.question.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"dns.question.registered_domain\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"dns.question.subdomain\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"dns.question.top_level_domain\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"dns.question.type\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"dns.resolved_ip\",\"scripted\":false,\"searchable\":true,\"type\":\"ip\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"dns.response_code\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"dns.type\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"ecs.version\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"error.code\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":4,\"doc_values\":true,\"indexed\":true,\"name\":\"error.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"error.message\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"error.stack_trace\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"error.stack_trace.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"error.type\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"event.action\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"event.category\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"event.code\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"event.created\",\"scripted\":false,\"searchable\":true,\"type\":\"date\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"event.dataset\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"event.duration\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"event.end\",\"scripted\":false,\"searchable\":true,\"type\":\"date\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"event.hash\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"event.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"event.ingested\",\"scripted\":false,\"searchable\":true,\"type\":\"date\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"event.kind\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"event.module\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"event.original\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"event.outcome\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"event.provider\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"event.reference\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"event.risk_score\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"event.risk_score_norm\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"event.sequence\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"event.severity\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"event.start\",\"scripted\":false,\"searchable\":true,\"type\":\"date\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"event.timezone\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"event.type\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"event.url\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"file.accessed\",\"scripted\":false,\"searchable\":true,\"type\":\"date\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"file.attributes\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"file.code_signature.exists\",\"scripted\":false,\"searchable\":true,\"type\":\"boolean\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"file.code_signature.status\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"file.code_signature.subject_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"file.code_signature.trusted\",\"scripted\":false,\"searchable\":true,\"type\":\"boolean\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"file.code_signature.valid\",\"scripted\":false,\"searchable\":true,\"type\":\"boolean\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"file.created\",\"scripted\":false,\"searchable\":true,\"type\":\"date\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"file.ctime\",\"scripted\":false,\"searchable\":true,\"type\":\"date\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"file.device\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"file.directory\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"file.drive_letter\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"file.extension\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"file.gid\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"file.group\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"file.hash.md5\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"file.hash.sha1\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"file.hash.sha256\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"file.hash.sha512\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"file.inode\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"file.mime_type\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"file.mode\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"file.mtime\",\"scripted\":false,\"searchable\":true,\"type\":\"date\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"file.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"file.owner\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"file.path\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"file.path.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"file.pe.company\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"file.pe.description\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"file.pe.file_version\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"file.pe.original_file_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"file.pe.product\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"file.size\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"file.target_path\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"file.target_path.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"file.type\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"file.uid\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"geo.city_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"geo.continent_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"geo.country_iso_code\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"geo.country_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"geo.location\",\"scripted\":false,\"searchable\":true,\"type\":\"geo_point\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"geo.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"geo.region_iso_code\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"geo.region_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"group.domain\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"group.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"group.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"hash.md5\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"hash.sha1\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"hash.sha256\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"hash.sha512\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"host.architecture\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"host.domain\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"host.geo.city_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"host.geo.continent_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"host.geo.country_iso_code\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"host.geo.country_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"host.geo.location\",\"scripted\":false,\"searchable\":true,\"type\":\"geo_point\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"host.geo.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"host.geo.region_iso_code\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"host.geo.region_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"host.hostname\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"host.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"host.ip\",\"scripted\":false,\"searchable\":true,\"type\":\"ip\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"host.mac\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"host.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"host.os.family\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"host.os.full\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"host.os.full.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"host.os.kernel\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"host.os.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"host.os.name.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"host.os.platform\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"host.os.version\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"host.type\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"host.uptime\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"host.user.domain\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"host.user.email\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"host.user.full_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"host.user.full_name.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"host.user.group.domain\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"host.user.group.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"host.user.group.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"host.user.hash\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"host.user.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"host.user.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"host.user.name.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"http.request.body.bytes\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"http.request.body.content\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"http.request.body.content.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"http.request.bytes\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"http.request.method\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"http.request.referrer\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"http.response.body.bytes\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"http.response.body.content\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"http.response.body.content.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"http.response.bytes\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"http.response.status_code\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"http.version\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"interface.alias\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"interface.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"interface.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"log.level\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"log.logger\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"log.origin.file.line\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"log.origin.file.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"log.origin.function\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"log.original\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"log.syslog\",\"scripted\":false,\"searchable\":true},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"log.syslog.facility.code\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"log.syslog.facility.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"log.syslog.priority\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"log.syslog.severity.code\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"log.syslog.severity.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"network.application\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"network.bytes\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"network.community_id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"network.direction\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"network.forwarded_ip\",\"scripted\":false,\"searchable\":true,\"type\":\"ip\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"network.iana_number\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"network.inner\",\"scripted\":false,\"searchable\":true},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"network.inner.vlan.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"network.inner.vlan.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"network.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"network.packets\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"network.protocol\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"network.transport\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"network.type\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"network.vlan.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"network.vlan.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.egress\",\"scripted\":false,\"searchable\":true},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.egress.interface.alias\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.egress.interface.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.egress.interface.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.egress.vlan.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.egress.vlan.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.egress.zone\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.geo.city_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.geo.continent_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.geo.country_iso_code\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.geo.country_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.geo.location\",\"scripted\":false,\"searchable\":true,\"type\":\"geo_point\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.geo.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.geo.region_iso_code\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.geo.region_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.hostname\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.ingress\",\"scripted\":false,\"searchable\":true},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.ingress.interface.alias\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.ingress.interface.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.ingress.interface.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.ingress.vlan.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.ingress.vlan.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.ingress.zone\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.ip\",\"scripted\":false,\"searchable\":true,\"type\":\"ip\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.mac\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.os.family\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.os.full\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.os.full.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.os.kernel\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.os.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.os.name.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.os.platform\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.os.version\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.product\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.serial_number\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.type\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.vendor\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.version\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"organization.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"organization.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"organization.name.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"os.family\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"os.full\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"os.full.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"os.kernel\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"os.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"os.name.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"os.platform\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"os.version\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"package.architecture\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"package.build_version\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"package.checksum\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"package.description\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"package.install_scope\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"package.installed\",\"scripted\":false,\"searchable\":true,\"type\":\"date\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"package.license\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"package.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"package.path\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"package.reference\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"package.size\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"package.type\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"package.version\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"pe.company\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"pe.description\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"pe.file_version\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"pe.original_file_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"pe.product\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.args\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.args_count\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.code_signature.exists\",\"scripted\":false,\"searchable\":true,\"type\":\"boolean\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.code_signature.status\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.code_signature.subject_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.code_signature.trusted\",\"scripted\":false,\"searchable\":true,\"type\":\"boolean\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.code_signature.valid\",\"scripted\":false,\"searchable\":true,\"type\":\"boolean\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.command_line\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.command_line.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.entity_id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.executable\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.executable.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.exit_code\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.hash.md5\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.hash.sha1\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.hash.sha256\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.hash.sha512\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.name.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.parent.args\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.parent.args_count\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.parent.code_signature.exists\",\"scripted\":false,\"searchable\":true,\"type\":\"boolean\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.parent.code_signature.status\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.parent.code_signature.subject_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.parent.code_signature.trusted\",\"scripted\":false,\"searchable\":true,\"type\":\"boolean\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.parent.code_signature.valid\",\"scripted\":false,\"searchable\":true,\"type\":\"boolean\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.parent.command_line\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.parent.command_line.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.parent.entity_id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.parent.executable\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.parent.executable.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.parent.exit_code\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.parent.hash.md5\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.parent.hash.sha1\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.parent.hash.sha256\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.parent.hash.sha512\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.parent.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.parent.name.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.parent.pgid\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.parent.pid\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.parent.ppid\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.parent.start\",\"scripted\":false,\"searchable\":true,\"type\":\"date\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.parent.thread.id\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.parent.thread.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.parent.title\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.parent.title.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.parent.uptime\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.parent.working_directory\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.parent.working_directory.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.pe.company\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.pe.description\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.pe.file_version\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.pe.original_file_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.pe.product\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.pgid\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.pid\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.ppid\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.start\",\"scripted\":false,\"searchable\":true,\"type\":\"date\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.thread.id\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.thread.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.title\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.title.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.uptime\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.working_directory\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.working_directory.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"registry.data.bytes\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"registry.data.strings\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"registry.data.type\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"registry.hive\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"registry.key\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"registry.path\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"registry.value\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"related.hash\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"related.ip\",\"scripted\":false,\"searchable\":true,\"type\":\"ip\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"related.user\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"rule.author\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"rule.category\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"rule.description\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"rule.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"rule.license\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"rule.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"rule.reference\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"rule.ruleset\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"rule.uuid\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"rule.version\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"server.address\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"server.as.number\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"server.as.organization.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"server.as.organization.name.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"server.bytes\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"server.domain\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"server.geo.city_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"server.geo.continent_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"server.geo.country_iso_code\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"server.geo.country_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"server.geo.location\",\"scripted\":false,\"searchable\":true,\"type\":\"geo_point\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"server.geo.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"server.geo.region_iso_code\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"server.geo.region_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"server.ip\",\"scripted\":false,\"searchable\":true,\"type\":\"ip\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"server.mac\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"server.nat.ip\",\"scripted\":false,\"searchable\":true,\"type\":\"ip\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"server.nat.port\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"server.packets\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"server.port\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"server.registered_domain\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"server.top_level_domain\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"server.user.domain\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"server.user.email\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"server.user.full_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"server.user.full_name.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"server.user.group.domain\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"server.user.group.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"server.user.group.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"server.user.hash\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"server.user.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"server.user.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"server.user.name.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"service.ephemeral_id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"service.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"service.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"service.node.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"service.state\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"service.type\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"service.version\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"source.address\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"source.as.number\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"source.as.organization.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"source.as.organization.name.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"source.bytes\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"source.domain\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"source.geo.city_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"source.geo.continent_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"source.geo.country_iso_code\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"source.geo.country_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"source.geo.location\",\"scripted\":false,\"searchable\":true,\"type\":\"geo_point\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"source.geo.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"source.geo.region_iso_code\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"source.geo.region_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"source.ip\",\"scripted\":false,\"searchable\":true,\"type\":\"ip\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"source.mac\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"source.nat.ip\",\"scripted\":false,\"searchable\":true,\"type\":\"ip\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"source.nat.port\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"source.packets\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"source.port\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"source.registered_domain\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"source.top_level_domain\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"source.user.domain\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"source.user.email\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"source.user.full_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"source.user.full_name.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"source.user.group.domain\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"source.user.group.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"source.user.group.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"source.user.hash\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"source.user.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"source.user.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"source.user.name.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"threat.framework\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"threat.tactic.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"threat.tactic.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"threat.tactic.reference\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"threat.technique.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"threat.technique.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"threat.technique.name.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"threat.technique.reference\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"tls.cipher\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"tls.client.certificate\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"tls.client.certificate_chain\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"tls.client.hash.md5\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"tls.client.hash.sha1\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"tls.client.hash.sha256\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"tls.client.issuer\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"tls.client.ja3\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"tls.client.not_after\",\"scripted\":false,\"searchable\":true,\"type\":\"date\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"tls.client.not_before\",\"scripted\":false,\"searchable\":true,\"type\":\"date\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"tls.client.server_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"tls.client.subject\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"tls.client.supported_ciphers\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"tls.curve\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"tls.established\",\"scripted\":false,\"searchable\":true,\"type\":\"boolean\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"tls.next_protocol\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"tls.resumed\",\"scripted\":false,\"searchable\":true,\"type\":\"boolean\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"tls.server.certificate\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"tls.server.certificate_chain\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"tls.server.hash.md5\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"tls.server.hash.sha1\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"tls.server.hash.sha256\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"tls.server.issuer\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"tls.server.ja3s\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"tls.server.not_after\",\"scripted\":false,\"searchable\":true,\"type\":\"date\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"tls.server.not_before\",\"scripted\":false,\"searchable\":true,\"type\":\"date\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"tls.server.subject\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"tls.version\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"tls.version_protocol\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"tracing.trace.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"tracing.transaction.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"url.domain\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"url.extension\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"url.fragment\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"url.full\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"url.full.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"url.original\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"url.original.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"url.password\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"url.path\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"url.port\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"url.query\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"url.registered_domain\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"url.scheme\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"url.top_level_domain\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"url.username\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"user.domain\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"user.email\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"user.full_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"user.full_name.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"user.group.domain\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"user.group.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"user.group.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"user.hash\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"user.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"user.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"user.name.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"user_agent.device.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"user_agent.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"user_agent.original\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"user_agent.original.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"user_agent.os.family\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"user_agent.os.full\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"user_agent.os.full.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"user_agent.os.kernel\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"user_agent.os.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"user_agent.os.name.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"user_agent.os.platform\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"user_agent.os.version\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"user_agent.version\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"vlan.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"vlan.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"vulnerability.category\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"vulnerability.classification\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"vulnerability.description\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"vulnerability.description.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"vulnerability.enumeration\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"vulnerability.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"vulnerability.reference\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"vulnerability.report_id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"vulnerability.scanner.vendor\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"vulnerability.score.base\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"vulnerability.score.environmental\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"vulnerability.score.temporal\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"vulnerability.score.version\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"vulnerability.severity\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"agent.hostname\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"fields\",\"scripted\":false,\"searchable\":true},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"timeseries.instance\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"cloud.project.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"cloud.image.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"docker.container.labels\",\"scripted\":false,\"searchable\":true},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"host.containerized\",\"scripted\":false,\"searchable\":true,\"type\":\"boolean\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"host.os.build\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"host.os.codename\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"kubernetes.pod.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"kubernetes.pod.uid\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"kubernetes.namespace\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"kubernetes.node.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"kubernetes.labels.*\",\"scripted\":false,\"searchable\":true},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"kubernetes.annotations.*\",\"scripted\":false,\"searchable\":true},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"kubernetes.replicaset.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"kubernetes.deployment.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"kubernetes.statefulset.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"kubernetes.container.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"kubernetes.container.image\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"processor.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"processor.event\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":1,\"doc_values\":true,\"indexed\":true,\"name\":\"timestamp.us\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":false,\"enabled\":false,\"indexed\":false,\"name\":\"http.request.headers\",\"scripted\":false,\"searchable\":false},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"http.response.finished\",\"scripted\":false,\"searchable\":true,\"type\":\"boolean\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":false,\"enabled\":false,\"indexed\":false,\"name\":\"http.response.headers\",\"scripted\":false,\"searchable\":false},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"service.environment\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"service.language.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"service.language.version\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"service.runtime.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"service.runtime.version\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"service.framework.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"service.framework.version\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"transaction.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"transaction.sampled\",\"scripted\":false,\"searchable\":true,\"type\":\"boolean\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"transaction.type\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"transaction.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"transaction.name.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"transaction.duration.count\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"transaction.duration.sum.us\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"transaction.self_time.count\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"transaction.self_time.sum.us\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"transaction.breakdown.count\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":1,\"doc_values\":true,\"indexed\":true,\"name\":\"span.type\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":1,\"doc_values\":true,\"indexed\":true,\"name\":\"span.subtype\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"span.self_time.count\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"span.self_time.sum.us\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"trace.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"parent.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.listening\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.version_major\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"experimental\",\"scripted\":false,\"searchable\":true},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"cloud.account.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"cloud.project.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":2,\"doc_values\":true,\"indexed\":true,\"name\":\"error.culprit\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"error.grouping_key\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"error.exception.code\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":2,\"doc_values\":true,\"indexed\":true,\"name\":\"error.exception.message\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"error.exception.module\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":4,\"doc_values\":true,\"indexed\":true,\"name\":\"error.exception.type\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":2,\"doc_values\":true,\"indexed\":true,\"name\":\"error.exception.handled\",\"scripted\":false,\"searchable\":true,\"type\":\"boolean\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"error.log.level\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"error.log.logger_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":2,\"doc_values\":true,\"indexed\":true,\"name\":\"error.log.message\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"error.log.param_message\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"system.cpu.total.norm.pct\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"system.memory.total\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"system.memory.actual.free\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"system.process.cpu.total.norm.pct\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"system.process.memory.size\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"system.process.memory.rss.bytes\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"system.process.cgroup.memory.mem.limit.bytes\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"system.process.cgroup.memory.mem.usage.bytes\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"system.process.cgroup.memory.stats.inactive_file.bytes\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"transaction.root\",\"scripted\":false,\"searchable\":true,\"type\":\"boolean\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":1,\"doc_values\":true,\"indexed\":true,\"name\":\"profile.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":1,\"doc_values\":true,\"indexed\":true,\"name\":\"profile.duration\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":1,\"doc_values\":true,\"indexed\":true,\"name\":\"profile.cpu.ns\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":1,\"doc_values\":true,\"indexed\":true,\"name\":\"profile.samples.count\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":1,\"doc_values\":true,\"indexed\":true,\"name\":\"profile.alloc_objects.count\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":1,\"doc_values\":true,\"indexed\":true,\"name\":\"profile.alloc_space.bytes\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":1,\"doc_values\":true,\"indexed\":true,\"name\":\"profile.inuse_objects.count\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":1,\"doc_values\":true,\"indexed\":true,\"name\":\"profile.inuse_space.bytes\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"profile.top.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":1,\"doc_values\":true,\"indexed\":true,\"name\":\"profile.top.function\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":1,\"doc_values\":true,\"indexed\":true,\"name\":\"profile.top.filename\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":1,\"doc_values\":true,\"indexed\":true,\"name\":\"profile.top.line\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"profile.stack.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"profile.stack.function\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"profile.stack.filename\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"profile.stack.line\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"sourcemap.service.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"sourcemap.service.version\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"sourcemap.bundle_filepath\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"view spans\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"child.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"span.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":1,\"doc_values\":true,\"indexed\":true,\"name\":\"span.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":1,\"doc_values\":true,\"indexed\":true,\"name\":\"span.action\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":1,\"doc_values\":true,\"indexed\":true,\"name\":\"span.start.us\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":1,\"doc_values\":true,\"indexed\":true,\"name\":\"span.duration.us\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"span.sync\",\"scripted\":false,\"searchable\":true,\"type\":\"boolean\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"span.db.link\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"span.db.rows_affected\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"span.destination.service.type\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"span.destination.service.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"span.destination.service.resource\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"span.message.queue.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"span.message.age.ms\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"transaction.duration.us\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"transaction.result\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"transaction.marks\",\"scripted\":false,\"searchable\":true},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"transaction.marks.*.*\",\"scripted\":false,\"searchable\":true},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"transaction.experience.cls\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"transaction.experience.fid\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"transaction.experience.tbt\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"transaction.span_count.dropped\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"transaction.message.queue.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"transaction.message.age.ms\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"transaction.duration.histogram\",\"scripted\":false,\"searchable\":true},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"metricset.period\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"span.destination.service.response_time.count\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"span.destination.service.response_time.sum.us\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":false,\"indexed\":false,\"name\":\"_id\",\"scripted\":false,\"searchable\":false,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":false,\"indexed\":false,\"name\":\"_type\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":false,\"indexed\":false,\"name\":\"_index\",\"scripted\":false,\"searchable\":false,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":false,\"indexed\":false,\"name\":\"_score\",\"scripted\":false,\"searchable\":false,\"type\":\"number\"}]",
"sourceFilters": "[{\"value\":\"sourcemap.sourcemap\"}]",
"timeFieldName": "@timestamp"
},
"id": "apm-*",
"type": "index-pattern",
"version": "1"
-}
\ No newline at end of file
+}
diff --git a/src/plugins/data/public/public.api.md b/src/plugins/data/public/public.api.md
index 09da0f462a3cc..a8fbbcb08d358 100644
--- a/src/plugins/data/public/public.api.md
+++ b/src/plugins/data/public/public.api.md
@@ -28,7 +28,6 @@ import { ExpressionAstFunction } from 'src/plugins/expressions/common';
import { ExpressionsSetup } from 'src/plugins/expressions/public';
import { History } from 'history';
import { Href } from 'history';
-import { HttpStart } from 'src/core/public';
import { IconType } from '@elastic/eui';
import { InjectedIntl } from '@kbn/i18n/react';
import { ISearchOptions as ISearchOptions_2 } from 'src/plugins/data/public';
@@ -1686,7 +1685,7 @@ export interface QueryStateChange extends QueryStateChangePartial {
// Warning: (ae-missing-release-tag) "QueryStringInput" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
-export const QueryStringInput: React.FC>;
+export const QueryStringInput: React.FC>;
// @public (undocumented)
export type QuerySuggestion = QuerySuggestionBasic | QuerySuggestionField;
@@ -2018,7 +2017,7 @@ export class SearchSource {
onRequestStart(handler: (searchSource: SearchSource, options?: ISearchOptions) => Promise): void;
serialize(): {
searchSourceJSON: string;
- references: import("../../../../../core/public").SavedObjectReference[];
+ references: import("../../../../../core/types").SavedObjectReference[];
};
setField(field: K, value: SearchSourceFields[K]): this;
setFields(newFields: SearchSourceFields): this;
diff --git a/src/plugins/data/public/search/fetch/types.ts b/src/plugins/data/public/search/fetch/types.ts
index 224a597766909..cdf10d8f1a1b0 100644
--- a/src/plugins/data/public/search/fetch/types.ts
+++ b/src/plugins/data/public/search/fetch/types.ts
@@ -17,9 +17,9 @@
* under the License.
*/
-import { HttpStart } from 'src/core/public';
-import { BehaviorSubject } from 'rxjs';
+import { SearchResponse } from 'elasticsearch';
import { GetConfigFn } from '../../../common';
+import { LegacyFetchHandlers } from '../legacy/types';
/**
* @internal
@@ -31,9 +31,17 @@ import { GetConfigFn } from '../../../common';
export type SearchRequest = Record;
export interface FetchHandlers {
- config: { get: GetConfigFn };
- http: HttpStart;
- loadingCount$: BehaviorSubject;
+ getConfig: GetConfigFn;
+ /**
+ * Callback which can be used to hook into responses, modify them, or perform
+ * side effects like displaying UI errors on the client.
+ */
+ onResponse: (request: SearchRequest, response: SearchResponse) => SearchResponse;
+ /**
+ * These handlers are only used by the legacy defaultSearchStrategy and can be removed
+ * once that strategy has been deprecated.
+ */
+ legacy: LegacyFetchHandlers;
}
export interface SearchError {
diff --git a/src/plugins/data/public/search/legacy/call_client.test.ts b/src/plugins/data/public/search/legacy/call_client.test.ts
index 943a02d22088d..0a7913b0a734f 100644
--- a/src/plugins/data/public/search/legacy/call_client.test.ts
+++ b/src/plugins/data/public/search/legacy/call_client.test.ts
@@ -17,18 +17,13 @@
* under the License.
*/
-import { coreMock } from '../../../../../core/public/mocks';
import { callClient } from './call_client';
import { SearchStrategySearchParams } from './types';
import { defaultSearchStrategy } from './default_search_strategy';
import { FetchHandlers } from '../fetch';
-import { handleResponse } from '../fetch/handle_response';
import { BehaviorSubject } from 'rxjs';
const mockAbortFn = jest.fn();
-jest.mock('../fetch/handle_response', () => ({
- handleResponse: jest.fn((request, response) => response),
-}));
jest.mock('./default_search_strategy', () => {
return {
@@ -50,32 +45,36 @@ jest.mock('./default_search_strategy', () => {
});
describe('callClient', () => {
+ const handleResponse = jest.fn().mockImplementation((req, res) => res);
+ const handlers = {
+ getConfig: jest.fn(),
+ onResponse: handleResponse,
+ legacy: {
+ callMsearch: jest.fn(),
+ loadingCount$: new BehaviorSubject(0),
+ },
+ } as FetchHandlers;
+
beforeEach(() => {
- (handleResponse as jest.Mock).mockClear();
+ handleResponse.mockClear();
});
test('Passes the additional arguments it is given to the search strategy', () => {
const searchRequests = [{ _searchStrategyId: 0 }];
- const args = {
- http: coreMock.createStart().http,
- legacySearchService: {},
- config: { get: jest.fn() },
- loadingCount$: new BehaviorSubject(0),
- } as FetchHandlers;
- callClient(searchRequests, [], args);
+ callClient(searchRequests, [], handlers);
expect(defaultSearchStrategy.search).toBeCalled();
expect((defaultSearchStrategy.search as any).mock.calls[0][0]).toEqual({
searchRequests,
- ...args,
+ ...handlers,
});
});
test('Returns the responses in the original order', async () => {
const searchRequests = [{ _searchStrategyId: 1 }, { _searchStrategyId: 0 }];
- const responses = await Promise.all(callClient(searchRequests, [], {} as FetchHandlers));
+ const responses = await Promise.all(callClient(searchRequests, [], handlers));
expect(responses[0]).toEqual({ id: searchRequests[0]._searchStrategyId });
expect(responses[1]).toEqual({ id: searchRequests[1]._searchStrategyId });
@@ -84,7 +83,7 @@ describe('callClient', () => {
test('Calls handleResponse with each request and response', async () => {
const searchRequests = [{ _searchStrategyId: 0 }, { _searchStrategyId: 1 }];
- const responses = callClient(searchRequests, [], {} as FetchHandlers);
+ const responses = callClient(searchRequests, [], handlers);
await Promise.all(responses);
expect(handleResponse).toBeCalledTimes(2);
@@ -105,7 +104,7 @@ describe('callClient', () => {
},
];
- callClient(searchRequests, requestOptions, {} as FetchHandlers);
+ callClient(searchRequests, requestOptions, handlers);
abortController.abort();
expect(mockAbortFn).toBeCalled();
diff --git a/src/plugins/data/public/search/legacy/call_client.ts b/src/plugins/data/public/search/legacy/call_client.ts
index d66796b9427a1..b87affdd59c54 100644
--- a/src/plugins/data/public/search/legacy/call_client.ts
+++ b/src/plugins/data/public/search/legacy/call_client.ts
@@ -19,7 +19,7 @@
import { SearchResponse } from 'elasticsearch';
import { ISearchOptions } from 'src/plugins/data/common';
-import { FetchHandlers, handleResponse } from '../fetch';
+import { FetchHandlers } from '../fetch';
import { defaultSearchStrategy } from './default_search_strategy';
import { SearchRequest } from '../index';
@@ -42,7 +42,7 @@ export function callClient(
});
searchRequests.forEach((request, i) => {
- const response = searching.then((results) => handleResponse(request, results[i]));
+ const response = searching.then((results) => fetchHandlers.onResponse(request, results[i]));
const { abortSignal = null } = requestOptionsMap.get(request) || {};
if (abortSignal) abortSignal.addEventListener('abort', abort);
requestResponseMap.set(request, response);
diff --git a/src/plugins/data/public/search/legacy/call_msearch.ts b/src/plugins/data/public/search/legacy/call_msearch.ts
new file mode 100644
index 0000000000000..fd4f8a07919f8
--- /dev/null
+++ b/src/plugins/data/public/search/legacy/call_msearch.ts
@@ -0,0 +1,37 @@
+/*
+ * Licensed to Elasticsearch B.V. under one or more contributor
+ * license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright
+ * ownership. Elasticsearch B.V. licenses this file to you under
+ * the Apache License, Version 2.0 (the "License"); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import { HttpStart } from 'src/core/public';
+import { LegacyFetchHandlers } from './types';
+
+/**
+ * Wrapper for calling the internal msearch endpoint from the client.
+ * This is needed to abstract away differences in the http service
+ * between client & server.
+ *
+ * @internal
+ */
+export function getCallMsearch({ http }: { http: HttpStart }): LegacyFetchHandlers['callMsearch'] {
+ return async ({ body, signal }) => {
+ return http.post('/internal/_msearch', {
+ body: JSON.stringify(body),
+ signal,
+ });
+ };
+}
diff --git a/src/plugins/data/public/search/legacy/default_search_strategy.test.ts b/src/plugins/data/public/search/legacy/default_search_strategy.test.ts
index e74ab49131430..ad59e5c6c9625 100644
--- a/src/plugins/data/public/search/legacy/default_search_strategy.test.ts
+++ b/src/plugins/data/public/search/legacy/default_search_strategy.test.ts
@@ -19,8 +19,9 @@
import { HttpStart } from 'src/core/public';
import { coreMock } from '../../../../../core/public/mocks';
+import { getCallMsearch } from './call_msearch';
import { defaultSearchStrategy } from './default_search_strategy';
-import { SearchStrategySearchParams } from './types';
+import { LegacyFetchHandlers, SearchStrategySearchParams } from './types';
import { BehaviorSubject } from 'rxjs';
const { search } = defaultSearchStrategy;
@@ -44,11 +45,12 @@ describe('defaultSearchStrategy', function () {
index: { title: 'foo' },
},
],
- http,
- config: {
- get: jest.fn(),
- },
- loadingCount$: new BehaviorSubject(0) as any,
+ getConfig: jest.fn(),
+ onResponse: (req, res) => res,
+ legacy: {
+ callMsearch: getCallMsearch({ http }),
+ loadingCount$: new BehaviorSubject(0) as any,
+ } as jest.Mocked,
};
});
diff --git a/src/plugins/data/public/search/legacy/default_search_strategy.ts b/src/plugins/data/public/search/legacy/default_search_strategy.ts
index cbcd0da20207f..bed86cb75cca6 100644
--- a/src/plugins/data/public/search/legacy/default_search_strategy.ts
+++ b/src/plugins/data/public/search/legacy/default_search_strategy.ts
@@ -29,12 +29,14 @@ export const defaultSearchStrategy: SearchStrategyProvider = {
},
};
-function msearch({ searchRequests, config, http, loadingCount$ }: SearchStrategySearchParams) {
+function msearch({ searchRequests, getConfig, legacy }: SearchStrategySearchParams) {
+ const { callMsearch, loadingCount$ } = legacy;
+
const requests = searchRequests.map(({ index, body }) => {
return {
header: {
index: index.title || index,
- preference: getPreference(config.get),
+ preference: getPreference(getConfig),
},
body,
};
@@ -55,12 +57,11 @@ function msearch({ searchRequests, config, http, loadingCount$ }: SearchStrategy
}
};
- const searching = http
- .post('/internal/_msearch', {
- body: JSON.stringify({ searches: requests }),
- signal: abortController.signal,
- })
- .then(({ body }) => body?.responses)
+ const searching = callMsearch({
+ body: { searches: requests },
+ signal: abortController.signal,
+ })
+ .then((res: any) => res?.body?.responses)
.finally(() => cleanup());
return {
diff --git a/src/plugins/data/public/search/legacy/fetch_soon.test.ts b/src/plugins/data/public/search/legacy/fetch_soon.test.ts
index d38a41cf5ffbc..7243ab158009a 100644
--- a/src/plugins/data/public/search/legacy/fetch_soon.test.ts
+++ b/src/plugins/data/public/search/legacy/fetch_soon.test.ts
@@ -67,25 +67,21 @@ describe('fetchSoon', () => {
});
test('should execute asap if config is set to not batch searches', () => {
- const config = {
- get: getConfigStub({ [UI_SETTINGS.COURIER_BATCH_SEARCHES]: false }),
- };
+ const getConfig = getConfigStub({ [UI_SETTINGS.COURIER_BATCH_SEARCHES]: false });
const request = {};
const options = {};
- fetchSoon(request, options, { config } as FetchHandlers);
+ fetchSoon(request, options, { getConfig } as FetchHandlers);
expect(callClient).toBeCalled();
});
test('should delay by 50ms if config is set to batch searches', () => {
- const config = {
- get: getConfigStub({ [UI_SETTINGS.COURIER_BATCH_SEARCHES]: true }),
- };
+ const getConfig = getConfigStub({ [UI_SETTINGS.COURIER_BATCH_SEARCHES]: true });
const request = {};
const options = {};
- fetchSoon(request, options, { config } as FetchHandlers);
+ fetchSoon(request, options, { getConfig } as FetchHandlers);
expect(callClient).not.toBeCalled();
jest.advanceTimersByTime(0);
@@ -95,14 +91,12 @@ describe('fetchSoon', () => {
});
test('should send a batch of requests to callClient', () => {
- const config = {
- get: getConfigStub({ [UI_SETTINGS.COURIER_BATCH_SEARCHES]: true }),
- };
+ const getConfig = getConfigStub({ [UI_SETTINGS.COURIER_BATCH_SEARCHES]: true });
const requests = [{ foo: 1 }, { foo: 2 }];
const options = [{ bar: 1 }, { bar: 2 }];
requests.forEach((request, i) => {
- fetchSoon(request, options[i] as ISearchOptions, { config } as FetchHandlers);
+ fetchSoon(request, options[i] as ISearchOptions, { getConfig } as FetchHandlers);
});
jest.advanceTimersByTime(50);
@@ -112,13 +106,11 @@ describe('fetchSoon', () => {
});
test('should return the response to the corresponding call for multiple batched requests', async () => {
- const config = {
- get: getConfigStub({ [UI_SETTINGS.COURIER_BATCH_SEARCHES]: true }),
- };
+ const getConfig = getConfigStub({ [UI_SETTINGS.COURIER_BATCH_SEARCHES]: true });
const requests = [{ _mockResponseId: 'foo' }, { _mockResponseId: 'bar' }];
const promises = requests.map((request) => {
- return fetchSoon(request, {}, { config } as FetchHandlers);
+ return fetchSoon(request, {}, { getConfig } as FetchHandlers);
});
jest.advanceTimersByTime(50);
const results = await Promise.all(promises);
@@ -127,18 +119,16 @@ describe('fetchSoon', () => {
});
test('should wait for the previous batch to start before starting a new batch', () => {
- const config = {
- get: getConfigStub({ [UI_SETTINGS.COURIER_BATCH_SEARCHES]: true }),
- };
+ const getConfig = getConfigStub({ [UI_SETTINGS.COURIER_BATCH_SEARCHES]: true });
const firstBatch = [{ foo: 1 }, { foo: 2 }];
const secondBatch = [{ bar: 1 }, { bar: 2 }];
firstBatch.forEach((request) => {
- fetchSoon(request, {}, { config } as FetchHandlers);
+ fetchSoon(request, {}, { getConfig } as FetchHandlers);
});
jest.advanceTimersByTime(50);
secondBatch.forEach((request) => {
- fetchSoon(request, {}, { config } as FetchHandlers);
+ fetchSoon(request, {}, { getConfig } as FetchHandlers);
});
expect(callClient).toBeCalledTimes(1);
diff --git a/src/plugins/data/public/search/legacy/fetch_soon.ts b/src/plugins/data/public/search/legacy/fetch_soon.ts
index 37c3827bb7bba..1c0573aa895d7 100644
--- a/src/plugins/data/public/search/legacy/fetch_soon.ts
+++ b/src/plugins/data/public/search/legacy/fetch_soon.ts
@@ -32,7 +32,7 @@ export async function fetchSoon(
options: ISearchOptions,
fetchHandlers: FetchHandlers
) {
- const msToDelay = fetchHandlers.config.get(UI_SETTINGS.COURIER_BATCH_SEARCHES) ? 50 : 0;
+ const msToDelay = fetchHandlers.getConfig(UI_SETTINGS.COURIER_BATCH_SEARCHES) ? 50 : 0;
return delayedFetch(request, options, fetchHandlers, msToDelay);
}
diff --git a/src/plugins/data/public/search/legacy/types.ts b/src/plugins/data/public/search/legacy/types.ts
index ed17db464feff..740bc22a7485c 100644
--- a/src/plugins/data/public/search/legacy/types.ts
+++ b/src/plugins/data/public/search/legacy/types.ts
@@ -17,10 +17,20 @@
* under the License.
*/
+import { BehaviorSubject } from 'rxjs';
import { SearchResponse } from 'elasticsearch';
import { FetchHandlers } from '../fetch';
import { SearchRequest } from '..';
+// @internal
+export interface LegacyFetchHandlers {
+ callMsearch: (params: {
+ body: SearchRequest;
+ signal: AbortSignal;
+ }) => Promise>>;
+ loadingCount$: BehaviorSubject;
+}
+
export interface SearchStrategySearchParams extends FetchHandlers {
searchRequests: SearchRequest[];
}
diff --git a/src/plugins/data/public/search/search_service.ts b/src/plugins/data/public/search/search_service.ts
index 6b73761c5a437..c41e1f78ee74e 100644
--- a/src/plugins/data/public/search/search_service.ts
+++ b/src/plugins/data/public/search/search_service.ts
@@ -21,6 +21,8 @@ import { Plugin, CoreSetup, CoreStart } from 'src/core/public';
import { BehaviorSubject } from 'rxjs';
import { ISearchSetup, ISearchStart, SearchEnhancements } from './types';
+import { handleResponse } from './fetch';
+import { getCallMsearch } from './legacy/call_msearch';
import { createSearchSource, SearchSource, SearchSourceDependencies } from './search_source';
import { AggsService, AggsStartDependencies } from './aggs';
import { IndexPatternsContract } from '../index_patterns/index_patterns';
@@ -49,7 +51,7 @@ export class SearchService implements Plugin {
private usageCollector?: SearchUsageCollector;
public setup(
- { http, getStartServices, injectedMetadata, notifications, uiSettings }: CoreSetup,
+ { http, getStartServices, notifications, uiSettings }: CoreSetup,
{ expressions, usageCollection }: SearchServiceSetupDependencies
): ISearchSetup {
this.usageCollector = createUsageCollector(getStartServices, usageCollection);
@@ -82,7 +84,7 @@ export class SearchService implements Plugin {
}
public start(
- { application, http, injectedMetadata, notifications, uiSettings }: CoreStart,
+ { application, http, notifications, uiSettings }: CoreStart,
{ fieldFormats, indexPatterns }: SearchServiceStartDependencies
): ISearchStart {
const search = ((request, options) => {
@@ -95,8 +97,11 @@ export class SearchService implements Plugin {
const searchSourceDependencies: SearchSourceDependencies = {
getConfig: uiSettings.get.bind(uiSettings),
search,
- http,
- loadingCount$,
+ onResponse: handleResponse,
+ legacy: {
+ callMsearch: getCallMsearch({ http }),
+ loadingCount$,
+ },
};
return {
diff --git a/src/plugins/data/public/search/search_source/create_search_source.test.ts b/src/plugins/data/public/search/search_source/create_search_source.test.ts
index bc1c7c06c8806..6b6cfb0c9b1ca 100644
--- a/src/plugins/data/public/search/search_source/create_search_source.test.ts
+++ b/src/plugins/data/public/search/search_source/create_search_source.test.ts
@@ -22,7 +22,6 @@ import { SearchSourceDependencies } from './search_source';
import { IIndexPattern } from '../../../common/index_patterns';
import { IndexPatternsContract } from '../../index_patterns/index_patterns';
import { Filter } from '../../../common/es_query/filters';
-import { coreMock } from '../../../../../core/public/mocks';
import { BehaviorSubject } from 'rxjs';
describe('createSearchSource', () => {
@@ -35,8 +34,11 @@ describe('createSearchSource', () => {
dependencies = {
getConfig: jest.fn(),
search: jest.fn(),
- http: coreMock.createStart().http,
- loadingCount$: new BehaviorSubject(0),
+ onResponse: (req, res) => res,
+ legacy: {
+ callMsearch: jest.fn(),
+ loadingCount$: new BehaviorSubject(0),
+ },
};
indexPatternContractMock = ({
diff --git a/src/plugins/data/public/search/search_source/mocks.ts b/src/plugins/data/public/search/search_source/mocks.ts
index adf53bee33fe1..f582861e37c15 100644
--- a/src/plugins/data/public/search/search_source/mocks.ts
+++ b/src/plugins/data/public/search/search_source/mocks.ts
@@ -18,7 +18,7 @@
*/
import { BehaviorSubject } from 'rxjs';
-import { httpServiceMock, uiSettingsServiceMock } from '../../../../../core/public/mocks';
+import { uiSettingsServiceMock } from '../../../../../core/public/mocks';
import { ISearchSource, SearchSource } from './search_source';
import { SearchSourceFields } from './types';
@@ -54,6 +54,9 @@ export const createSearchSourceMock = (fields?: SearchSourceFields) =>
new SearchSource(fields, {
getConfig: uiSettingsServiceMock.createStartContract().get,
search: jest.fn(),
- http: httpServiceMock.createStartContract(),
- loadingCount$: new BehaviorSubject(0),
+ onResponse: jest.fn().mockImplementation((req, res) => res),
+ legacy: {
+ callMsearch: jest.fn(),
+ loadingCount$: new BehaviorSubject(0),
+ },
});
diff --git a/src/plugins/data/public/search/search_source/search_source.test.ts b/src/plugins/data/public/search/search_source/search_source.test.ts
index 282a33e6d01f7..d9a9fb2f4fef3 100644
--- a/src/plugins/data/public/search/search_source/search_source.test.ts
+++ b/src/plugins/data/public/search/search_source/search_source.test.ts
@@ -22,7 +22,6 @@ import { GetConfigFn } from 'src/plugins/data/common';
import { SearchSource, SearchSourceDependencies } from './search_source';
import { IndexPattern, SortDirection } from '../..';
import { fetchSoon } from '../legacy';
-import { coreMock } from '../../../../../core/public/mocks';
jest.mock('../legacy', () => ({
fetchSoon: jest.fn().mockResolvedValue({}),
@@ -68,8 +67,11 @@ describe('SearchSource', () => {
searchSourceDependencies = {
getConfig: jest.fn(),
search: mockSearchMethod,
- http: coreMock.createStart().http,
- loadingCount$: new BehaviorSubject(0),
+ onResponse: (req, res) => res,
+ legacy: {
+ callMsearch: jest.fn(),
+ loadingCount$: new BehaviorSubject(0),
+ },
};
});
diff --git a/src/plugins/data/public/search/search_source/search_source.ts b/src/plugins/data/public/search/search_source/search_source.ts
index a39898e6a9f52..4afee223454e4 100644
--- a/src/plugins/data/public/search/search_source/search_source.ts
+++ b/src/plugins/data/public/search/search_source/search_source.ts
@@ -72,19 +72,12 @@
import { setWith } from '@elastic/safer-lodash-set';
import { uniqueId, uniq, extend, pick, difference, omit, isObject, keys, isFunction } from 'lodash';
import { map } from 'rxjs/operators';
-import { HttpStart } from 'src/core/public';
-import { BehaviorSubject } from 'rxjs';
import { normalizeSortRequest } from './normalize_sort_request';
import { filterDocvalueFields } from './filter_docvalue_fields';
import { fieldWildcardFilter } from '../../../../kibana_utils/common';
import { IIndexPattern, ISearchGeneric } from '../..';
import { SearchSourceOptions, SearchSourceFields } from './types';
-import {
- RequestFailure,
- handleResponse,
- getSearchParamsFromRequest,
- SearchRequest,
-} from '../fetch';
+import { FetchHandlers, RequestFailure, getSearchParamsFromRequest, SearchRequest } from '../fetch';
import {
getEsQueryConfig,
@@ -94,7 +87,6 @@ import {
ISearchOptions,
} from '../../../common';
import { getHighlightRequest } from '../../../common/field_formats';
-import { GetConfigFn } from '../../../common/types';
import { fetchSoon } from '../legacy';
import { extractReferences } from './extract_references';
@@ -114,11 +106,8 @@ export const searchSourceRequiredUiSettings = [
UI_SETTINGS.SORT_OPTIONS,
];
-export interface SearchSourceDependencies {
- getConfig: GetConfigFn;
+export interface SearchSourceDependencies extends FetchHandlers {
search: ISearchGeneric;
- http: HttpStart;
- loadingCount$: BehaviorSubject;
}
/** @public **/
@@ -321,14 +310,14 @@ export class SearchSource {
* @return {Observable>}
*/
private fetch$(searchRequest: SearchRequest, options: ISearchOptions) {
- const { search, getConfig } = this.dependencies;
+ const { search, getConfig, onResponse } = this.dependencies;
const params = getSearchParamsFromRequest(searchRequest, {
getConfig,
});
return search({ params, indexType: searchRequest.indexType }, options).pipe(
- map(({ rawResponse }) => handleResponse(searchRequest, rawResponse))
+ map(({ rawResponse }) => onResponse(searchRequest, rawResponse))
);
}
@@ -337,7 +326,7 @@ export class SearchSource {
* @return {Promise>}
*/
private async legacyFetch(searchRequest: SearchRequest, options: ISearchOptions) {
- const { http, getConfig, loadingCount$ } = this.dependencies;
+ const { getConfig, legacy, onResponse } = this.dependencies;
return await fetchSoon(
searchRequest,
@@ -346,9 +335,9 @@ export class SearchSource {
...options,
},
{
- http,
- config: { get: getConfig },
- loadingCount$,
+ getConfig,
+ onResponse,
+ legacy,
}
);
}
diff --git a/src/plugins/data/public/ui/shard_failure_modal/shard_failure_description.tsx b/src/plugins/data/public/ui/shard_failure_modal/shard_failure_description.tsx
index 3606bfbaeb1f9..1f124291669ec 100644
--- a/src/plugins/data/public/ui/shard_failure_modal/shard_failure_description.tsx
+++ b/src/plugins/data/public/ui/shard_failure_modal/shard_failure_description.tsx
@@ -17,9 +17,9 @@
* under the License.
*/
import React from 'react';
+import { getFlattenedObject } from '@kbn/std';
import { EuiCodeBlock, EuiDescriptionList, EuiSpacer } from '@elastic/eui';
import { ShardFailure } from './shard_failure_types';
-import { getFlattenedObject } from '../../../../../core/public';
import { ShardFailureDescriptionHeader } from './shard_failure_description_header';
/**
diff --git a/src/plugins/data/server/server.api.md b/src/plugins/data/server/server.api.md
index cd0369a5c4551..f5b1214185f53 100644
--- a/src/plugins/data/server/server.api.md
+++ b/src/plugins/data/server/server.api.md
@@ -117,6 +117,7 @@ import { NodesHotThreadsParams } from 'elasticsearch';
import { NodesInfoParams } from 'elasticsearch';
import { NodesStatsParams } from 'elasticsearch';
import { Observable } from 'rxjs';
+import { PathConfigType } from '@kbn/utils';
import { PingParams } from 'elasticsearch';
import { Plugin as Plugin_2 } from 'src/core/server';
import { PluginInitializerContext as PluginInitializerContext_2 } from 'src/core/server';
diff --git a/src/plugins/es_ui_shared/static/forms/hook_form_lib/components/use_field.test.tsx b/src/plugins/es_ui_shared/static/forms/hook_form_lib/components/use_field.test.tsx
index c14471991ccd3..dbf53a9f0a359 100644
--- a/src/plugins/es_ui_shared/static/forms/hook_form_lib/components/use_field.test.tsx
+++ b/src/plugins/es_ui_shared/static/forms/hook_form_lib/components/use_field.test.tsx
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-import React, { useEffect } from 'react';
+import React, { useEffect, FunctionComponent } from 'react';
import { act } from 'react-dom/test-utils';
import { registerTestBed, TestBed } from '../shared_imports';
@@ -237,4 +237,64 @@ describe(' ', () => {
expect(serializer).not.toBeCalled();
});
});
+
+ describe('custom components', () => {
+ interface MyForm {
+ name: string;
+ }
+
+ let formHook: FormHook | null = null;
+
+ beforeEach(() => {
+ formHook = null;
+ });
+
+ const onFormHook = (_form: FormHook) => {
+ formHook = _form;
+ };
+
+ const TestComp = ({
+ component,
+ onForm,
+ }: {
+ component: FunctionComponent;
+ onForm: (form: FormHook) => void;
+ }) => {
+ const { form } = useForm();
+
+ useEffect(() => {
+ onForm(form);
+ }, [onForm, form]);
+
+ return (
+
+ );
+ };
+
+ it('allows function components', () => {
+ const Component = () => ;
+ const setup = registerTestBed(TestComp, {
+ defaultProps: { onForm: onFormHook, component: Component },
+ memoryRouter: { wrapComponent: false },
+ });
+ const testBed = setup() as TestBed;
+
+ expect(testBed.exists('function-component')).toEqual(true);
+ expect(formHook?.getFormData()).toEqual({ name: 'myName' });
+ });
+
+ it('allows memoized function components', () => {
+ const Component = React.memo(() => );
+ const setup = registerTestBed(TestComp, {
+ defaultProps: { onForm: onFormHook, component: Component },
+ memoryRouter: { wrapComponent: false },
+ });
+ const testBed = setup() as TestBed;
+
+ expect(testBed.exists('memoized-component')).toEqual(true);
+ expect(formHook?.getFormData()).toEqual({ name: 'myName' });
+ });
+ });
});
diff --git a/src/plugins/es_ui_shared/static/forms/hook_form_lib/components/use_field.tsx b/src/plugins/es_ui_shared/static/forms/hook_form_lib/components/use_field.tsx
index 3a3ab0dab5e93..6b913f246abbb 100644
--- a/src/plugins/es_ui_shared/static/forms/hook_form_lib/components/use_field.tsx
+++ b/src/plugins/es_ui_shared/static/forms/hook_form_lib/components/use_field.tsx
@@ -49,7 +49,7 @@ function UseFieldComp(props: Props) {
} = props;
const form = useFormContext();
- const componentToRender = component ?? 'input';
+ const ComponentToRender = component ?? 'input';
// For backward compatibility we merge the "componentProps" prop into the "rest"
const propsToForward =
componentProps !== undefined ? { ...componentProps, ...rest } : { ...rest };
@@ -91,9 +91,9 @@ function UseFieldComp(props: Props) {
return children!(field);
}
- if (componentToRender === 'input') {
+ if (ComponentToRender === 'input') {
return (
- (props: Props) {
);
}
- return componentToRender({ field, ...propsToForward });
+ return ;
}
export const UseField = React.memo(UseFieldComp) as typeof UseFieldComp;
diff --git a/src/plugins/kibana_react/README.md b/src/plugins/kibana_react/README.md
index 3389af9f1800b..adbdb628ea9dd 100644
--- a/src/plugins/kibana_react/README.md
+++ b/src/plugins/kibana_react/README.md
@@ -2,7 +2,6 @@
Tools for building React applications in Kibana.
-
## Context
You can create React context that holds Core or plugin services that your plugin depends on.
@@ -51,7 +50,6 @@ import { KibanaContextProvider } from 'kibana-react';
```
-
## Accessing context
Using `useKibana` hook.
@@ -61,11 +59,7 @@ import { useKibana } from 'kibana-react';
const Demo = () => {
const kibana = useKibana();
- return (
-
- {kibana.services.uiSettings.get('theme:darkMode') ? 'dark' : 'light'}
-
- );
+ return {kibana.services.uiSettings.get('theme:darkMode') ? 'dark' : 'light'}
;
};
```
@@ -75,11 +69,7 @@ Using `withKibana()` higher order component.
import { withKibana } from 'kibana-react';
const Demo = ({ kibana }) => {
- return (
-
- {kibana.services.uiSettings.get('theme:darkMode') ? 'dark' : 'light'}
-
- );
+ return {kibana.services.uiSettings.get('theme:darkMode') ? 'dark' : 'light'}
;
};
export default withKibana(Demo);
@@ -92,21 +82,17 @@ import { UseKibana } from 'kibana-react';
const Demo = () => {
return (
- {kibana =>
-
- {kibana.services.uiSettings.get('theme:darkMode') ? 'dark' : 'light'}
-
- }
+
+ {(kibana) => {kibana.services.uiSettings.get('theme:darkMode') ? 'dark' : 'light'}
}
+
);
};
```
-
## `uiSettings` service
Wrappers around Core's `uiSettings` service.
-
### `useUiSetting` hook
`useUiSetting` synchronously returns the latest setting from `CoreStart['uiSettings']` service.
@@ -116,11 +102,7 @@ import { useUiSetting } from 'kibana-react';
const Demo = () => {
const darkMode = useUiSetting('theme:darkMode');
- return (
-
- {darkMode ? 'dark' : 'light'}
-
- );
+ return {darkMode ? 'dark' : 'light'}
;
};
```
@@ -130,7 +112,6 @@ const Demo = () => {
useUiSetting(key: string, defaultValue: T): T;
```
-
### `useUiSetting$` hook
`useUiSetting$` synchronously returns the latest setting from `CoreStart['uiSettings']` service and
@@ -141,11 +122,7 @@ import { useUiSetting$ } from 'kibana-react';
const Demo = () => {
const [darkMode] = useUiSetting$('theme:darkMode');
- return (
-
- {darkMode ? 'dark' : 'light'}
-
- );
+ return {darkMode ? 'dark' : 'light'}
;
};
```
@@ -155,7 +132,6 @@ const Demo = () => {
useUiSetting$(key: string, defaultValue: T): [T, (newValue: T) => void];
```
-
## `overlays` service
Wrapper around Core's `overlays` service, allows you to display React modals and flyouts
@@ -166,13 +142,11 @@ import { createKibanaReactContext } from 'kibana-react';
class MyPlugin {
start(core) {
- const { value: { overlays } } = createKibanaReactContext(core);
+ const {
+ value: { overlays },
+ } = createKibanaReactContext(core);
- overlays.openModal(
-
- Hello world!
-
- );
+ overlays.openModal(Hello world!
);
}
}
```
@@ -186,16 +160,11 @@ You can access `overlays` service through React context.
const Demo = () => {
const { overlays } = useKibana();
useEffect(() => {
- overlays.openModal(
-
- Oooops! {errorMessage}
-
- );
+ overlays.openModal(Oooops! {errorMessage}
);
}, [errorMessage]);
};
```
-
## `notifications` service
Wrapper around Core's `notifications` service, allows you to render React elements
@@ -206,11 +175,13 @@ import { createKibanaReactContext } from 'kibana-react';
class MyPlugin {
start(core) {
- const { value: { notifications } } = createKibanaReactContext(core);
+ const {
+ value: { notifications },
+ } = createKibanaReactContext(core);
notifications.toasts.show({
title: Hello
,
- body: world!
+ body: world!
,
});
}
}
@@ -234,3 +205,15 @@ const Demo = () => {
}, [errorMessage]);
};
```
+
+## RedirectAppLinks
+
+Utility component that will intercept click events on children anchor (``) elements to call
+`application.navigateToUrl` with the link's href. This will trigger SPA friendly navigation
+when the link points to a valid Kibana app.
+
+```tsx
+
+ Go to another-app
+
+```
diff --git a/src/plugins/kibana_utils/common/state_containers/README.md b/src/plugins/kibana_utils/common/state_containers/README.md
new file mode 100644
index 0000000000000..c623e8b306438
--- /dev/null
+++ b/src/plugins/kibana_utils/common/state_containers/README.md
@@ -0,0 +1,2 @@
+* [docs](../../docs/state_containers)
+* [api reference](https://github.com/elastic/kibana/tree/master/src/plugins/kibana_utils/docs/state_containers)
\ No newline at end of file
diff --git a/src/plugins/kibana_utils/docs/state_sync/README.md b/src/plugins/kibana_utils/docs/state_sync/README.md
index c84bf7f236330..6b4eb0cb1749b 100644
--- a/src/plugins/kibana_utils/docs/state_sync/README.md
+++ b/src/plugins/kibana_utils/docs/state_sync/README.md
@@ -3,6 +3,18 @@
State syncing utilities are a set of helpers for syncing your application state
with URL or browser storage.
+**When you should consider using state syncing utils:**
+
+- You want to sync your application state with URL in similar manner analyze applications do that.
+- You want to follow platform's <> out of the box.
+- You want to support `state:storeInSessionStore` escape hatch for URL overflowing out of the box.
+- You should also consider using them if you'd like to serialize state to different (not `rison`) format. Utils are composable, and you can implement your own `storage`.
+- In case you want to sync part of your state with URL, but other part of it with browser storage.
+
+**When you shouldn't look into using state syncing utils:**
+
+- Adding a query param flag or simple key/value to URL
+
They are designed to work together with [state containers](../state_containers). But state containers are not required.
State syncing utilities include:
@@ -42,9 +54,9 @@ stateContainer.set({ count: 2 });
stop();
```
-## Demos Plugins
+## Demo Plugins
-See demos plugins [here](../../../../../examples/state_containers_examples).
+See demo plugins [here](../../../../../examples/state_containers_examples).
To run them, start kibana with `--run-examples` flag.
diff --git a/src/plugins/kibana_utils/public/state_sync/README.md b/src/plugins/kibana_utils/public/state_sync/README.md
new file mode 100644
index 0000000000000..eb5f6e60958fc
--- /dev/null
+++ b/src/plugins/kibana_utils/public/state_sync/README.md
@@ -0,0 +1,3 @@
+- [docs](../../docs/state_sync)
+- [demo plugins](../../../../../examples/state_containers_examples): run Kibana with `--run-examples` flag.
+- [api reference](https://github.com/elastic/kibana/tree/master/src/plugins/kibana_utils/docs/state_sync)
diff --git a/src/plugins/share/server/routes/goto.ts b/src/plugins/share/server/routes/goto.ts
index 193f2acb87c95..0cd6d26adac26 100644
--- a/src/plugins/share/server/routes/goto.ts
+++ b/src/plugins/share/server/routes/goto.ts
@@ -19,11 +19,11 @@
import { CoreSetup, IRouter } from 'kibana/server';
import { schema } from '@kbn/config-schema';
+import { modifyUrl } from '@kbn/std';
import { shortUrlAssertValid } from './lib/short_url_assert_valid';
import { ShortUrlLookupService } from './lib/short_url_lookup';
import { getGotoPath } from '../../common/short_url_routes';
-import { modifyUrl } from '../../../../core/server';
export const createGotoRoute = ({
router,
diff --git a/src/plugins/telemetry/server/config.ts b/src/plugins/telemetry/server/config.ts
index ae9b70bb9f367..f547bf55091a7 100644
--- a/src/plugins/telemetry/server/config.ts
+++ b/src/plugins/telemetry/server/config.ts
@@ -18,8 +18,7 @@
*/
import { schema, TypeOf } from '@kbn/config-schema';
-// eslint-disable-next-line @kbn/eslint/no-restricted-paths
-import { getConfigPath } from '../../../core/server/path';
+import { getConfigPath } from '@kbn/utils';
import { ENDPOINT_VERSION } from '../common/constants';
export const configSchema = schema.object({
diff --git a/src/plugins/vis_type_timelion/server/plugin.ts b/src/plugins/vis_type_timelion/server/plugin.ts
index 52c50b0646299..c518b73bb3cde 100644
--- a/src/plugins/vis_type_timelion/server/plugin.ts
+++ b/src/plugins/vis_type_timelion/server/plugin.ts
@@ -21,10 +21,10 @@ import { i18n } from '@kbn/i18n';
import { first } from 'rxjs/operators';
import { TypeOf, schema } from '@kbn/config-schema';
import { RecursiveReadonly } from '@kbn/utility-types';
+import { deepFreeze } from '@kbn/std';
import { PluginStart } from '../../../../src/plugins/data/server';
import { CoreSetup, PluginInitializerContext } from '../../../../src/core/server';
-import { deepFreeze } from '../../../../src/core/server';
import { configSchema } from '../config';
import loadFunctions from './lib/load_functions';
import { functionsRoute } from './routes/functions';
diff --git a/src/plugins/visualizations/server/usage_collector/get_usage_collector.test.ts b/src/plugins/visualizations/server/usage_collector/get_usage_collector.test.ts
index 4a8e4b70ae070..108f270bc8eab 100644
--- a/src/plugins/visualizations/server/usage_collector/get_usage_collector.test.ts
+++ b/src/plugins/visualizations/server/usage_collector/get_usage_collector.test.ts
@@ -132,6 +132,16 @@ describe('Visualizations usage collector', () => {
expect(usageCollector.fetch).toEqual(expect.any(Function));
});
+ test('Returns undefined when no results found (undefined)', async () => {
+ const result = await usageCollector.fetch(getMockCallCluster(undefined as any));
+ expect(result).toBe(undefined);
+ });
+
+ test('Returns undefined when no results found (0 results)', async () => {
+ const result = await usageCollector.fetch(getMockCallCluster([]));
+ expect(result).toBe(undefined);
+ });
+
test('Summarizes visualizations response data', async () => {
const result = await usageCollector.fetch(getMockCallCluster(defaultMockSavedObjects));
diff --git a/src/plugins/visualizations/server/usage_collector/get_usage_collector.ts b/src/plugins/visualizations/server/usage_collector/get_usage_collector.ts
index 165c3ee649868..9ba09a3303b5f 100644
--- a/src/plugins/visualizations/server/usage_collector/get_usage_collector.ts
+++ b/src/plugins/visualizations/server/usage_collector/get_usage_collector.ts
@@ -55,7 +55,7 @@ async function getStats(callCluster: LegacyAPICaller, index: string) {
},
};
const esResponse: ESResponse = await callCluster('search', searchParams);
- const size = get(esResponse, 'hits.hits.length');
+ const size = get(esResponse, 'hits.hits.length', 0);
if (size < 1) {
return;
}
diff --git a/test/functional/page_objects/vega_chart_page.ts b/test/functional/page_objects/vega_chart_page.ts
index 557c6bfada01e..044b6b61790ac 100644
--- a/test/functional/page_objects/vega_chart_page.ts
+++ b/test/functional/page_objects/vega_chart_page.ts
@@ -17,7 +17,6 @@
* under the License.
*/
-import { Key } from 'selenium-webdriver';
import expect from '@kbn/expect';
import { FtrProviderContext } from '../ftr_provider_context';
@@ -94,9 +93,9 @@ export function VegaChartPageProvider({
const aceGutter = await this.getAceGutterContainer();
await aceGutter.doubleClick();
- await browser.pressKeys(Key.RIGHT);
- await browser.pressKeys(Key.LEFT);
- await browser.pressKeys(Key.LEFT);
+ await browser.pressKeys(browser.keys.RIGHT);
+ await browser.pressKeys(browser.keys.LEFT);
+ await browser.pressKeys(browser.keys.LEFT);
await browser.pressKeys(text);
}
@@ -105,7 +104,7 @@ export function VegaChartPageProvider({
await retry.try(async () => {
await aceGutter.doubleClick();
- await browser.pressKeys(Key.BACK_SPACE);
+ await browser.pressKeys(browser.keys.BACK_SPACE);
expect(await this.getSpec()).to.be('');
});
diff --git a/test/functional/page_objects/visual_builder_page.ts b/test/functional/page_objects/visual_builder_page.ts
index a95d535281fa3..6e49fd3b03494 100644
--- a/test/functional/page_objects/visual_builder_page.ts
+++ b/test/functional/page_objects/visual_builder_page.ts
@@ -58,7 +58,10 @@ export function VisualBuilderPageProvider({ getService, getPageObjects }: FtrPro
}
public async checkTabIsLoaded(testSubj: string, name: string) {
- const isPresent = await testSubjects.exists(testSubj, { timeout: 10000 });
+ let isPresent = false;
+ await retry.try(async () => {
+ isPresent = await testSubjects.exists(testSubj, { timeout: 20000 });
+ });
if (!isPresent) {
throw new Error(`TSVB ${name} tab is not loaded`);
}
@@ -130,8 +133,8 @@ export function VisualBuilderPageProvider({ getService, getPageObjects }: FtrPro
public async enterMarkdown(markdown: string) {
const input = await find.byCssSelector('.tvbMarkdownEditor__editor textarea');
await this.clearMarkdown();
- await input.type(markdown, { charByChar: true });
- await PageObjects.visChart.waitForVisualizationRenderingStabilized();
+ await input.type(markdown);
+ await PageObjects.common.sleep(3000);
}
public async clearMarkdown() {
diff --git a/test/functional/services/common/browser.ts b/test/functional/services/common/browser.ts
index e81845023a8fa..2f8e87c1d58d6 100644
--- a/test/functional/services/common/browser.ts
+++ b/test/functional/services/common/browser.ts
@@ -22,9 +22,9 @@ import { Key, Origin } from 'selenium-webdriver';
// @ts-ignore internal modules are not typed
import { LegacyActionSequence } from 'selenium-webdriver/lib/actions';
import { ProvidedType } from '@kbn/test/types/ftr';
+import { modifyUrl } from '@kbn/std';
import Jimp from 'jimp';
-import { modifyUrl } from '../../../../src/core/utils';
import { WebElementWrapper } from '../lib/web_element_wrapper';
import { FtrProviderContext } from '../../ftr_provider_context';
import { Browsers } from '../remote/browsers';
diff --git a/test/functional/services/remote/webdriver.ts b/test/functional/services/remote/webdriver.ts
index d51b32f3cc497..bd15d52bc0150 100644
--- a/test/functional/services/remote/webdriver.ts
+++ b/test/functional/services/remote/webdriver.ts
@@ -37,7 +37,7 @@ import { Executor } from 'selenium-webdriver/lib/http';
import { getLogger } from 'selenium-webdriver/lib/logging';
import { installDriver } from 'ms-chromium-edge-driver';
-import { REPO_ROOT } from '@kbn/dev-utils';
+import { REPO_ROOT } from '@kbn/utils';
import { pollForLogEntry$ } from './poll_for_log_entry';
import { createStdoutSocket } from './create_stdout_stream';
import { preventParallelCalls } from './prevent_parallel_calls';
diff --git a/x-pack/plugins/actions/server/lib/license_state.ts b/x-pack/plugins/actions/server/lib/license_state.ts
index 914aada08bb2c..1686d0201e96c 100644
--- a/x-pack/plugins/actions/server/lib/license_state.ts
+++ b/x-pack/plugins/actions/server/lib/license_state.ts
@@ -6,7 +6,7 @@
import { i18n } from '@kbn/i18n';
import { Observable, Subscription } from 'rxjs';
-import { assertNever } from '../../../../../src/core/server';
+import { assertNever } from '@kbn/std';
import { ILicense } from '../../../licensing/common/types';
import { PLUGIN } from '../constants/plugin';
import { ActionType } from '../types';
diff --git a/x-pack/plugins/alerts/server/lib/license_state.ts b/x-pack/plugins/alerts/server/lib/license_state.ts
index ea0106f717b02..b3204d886960f 100644
--- a/x-pack/plugins/alerts/server/lib/license_state.ts
+++ b/x-pack/plugins/alerts/server/lib/license_state.ts
@@ -6,9 +6,9 @@
import Boom from 'boom';
import { i18n } from '@kbn/i18n';
+import { assertNever } from '@kbn/std';
import { Observable, Subscription } from 'rxjs';
import { ILicense } from '../../../licensing/common/types';
-import { assertNever } from '../../../../../src/core/server';
import { PLUGIN } from '../constants/plugin';
export interface AlertingLicenseInformation {
diff --git a/x-pack/plugins/apm/e2e/cypress.json b/x-pack/plugins/apm/e2e/cypress.json
index 33304c2d8625f..19e09e6ad5bbf 100644
--- a/x-pack/plugins/apm/e2e/cypress.json
+++ b/x-pack/plugins/apm/e2e/cypress.json
@@ -21,5 +21,7 @@
"env": {
"elasticsearch_username": "admin",
"elasticsearch_password": "changeme"
- }
+ },
+ "viewportWidth": 1920,
+ "viewportHeight": 1080
}
diff --git a/x-pack/plugins/apm/e2e/cypress/integration/rum_dashboard.feature.disabled b/x-pack/plugins/apm/e2e/cypress/integration/csm_dashboard.feature
similarity index 72%
rename from x-pack/plugins/apm/e2e/cypress/integration/rum_dashboard.feature.disabled
rename to x-pack/plugins/apm/e2e/cypress/integration/csm_dashboard.feature
index 727898773904e..ac4188a598458 100644
--- a/x-pack/plugins/apm/e2e/cypress/integration/rum_dashboard.feature.disabled
+++ b/x-pack/plugins/apm/e2e/cypress/integration/csm_dashboard.feature
@@ -1,18 +1,23 @@
-Feature: RUM Dashboard
+Feature: CSM Dashboard
+
+ Scenario: Service name filter
+ Given a user browses the APM UI application for RUM Data
+ When the user changes the selected service name
+ Then it displays relevant client metrics
Scenario: Client metrics
When a user browses the APM UI application for RUM Data
Then should have correct client metrics
- Scenario Outline: Rum page filters
+ Scenario Outline: CSM page filters
When the user filters by ""
- Then it filters the client metrics
+ Then it filters the client metrics ""
Examples:
| filterName |
| os |
| location |
- Scenario: Display RUM Data components
+ Scenario: Display CSM Data components
When a user browses the APM UI application for RUM Data
Then should display percentile for page load chart
And should display tooltip on hover
@@ -22,7 +27,3 @@ Feature: RUM Dashboard
Given a user clicks the page load breakdown filter
When the user selected the breakdown
Then breakdown series should appear in chart
-
- Scenario: Service name filter
- When a user changes the selected service name
- Then it displays relevant client metrics
diff --git a/x-pack/plugins/apm/e2e/cypress/integration/snapshots.js b/x-pack/plugins/apm/e2e/cypress/integration/snapshots.js
index 6ee204781c8a7..c37326ee5b196 100644
--- a/x-pack/plugins/apm/e2e/cypress/integration/snapshots.js
+++ b/x-pack/plugins/apm/e2e/cypress/integration/snapshots.js
@@ -1,18 +1,3 @@
module.exports = {
- "__version": "4.9.0",
- "RUM Dashboard": {
- "Rum page filters (example #1)": {
- "1": "8 ",
- "2": "0.08 sec",
- "3": "0.01 sec"
- },
- "Rum page filters (example #2)": {
- "1": "28 ",
- "2": "0.07 sec",
- "3": "0.01 sec"
- },
- "Page load distribution chart legends": {
- "1": "Overall"
- }
- }
+ "__version": "4.9.0"
}
diff --git a/x-pack/plugins/apm/e2e/cypress/integration/snapshots.ts b/x-pack/plugins/apm/e2e/cypress/integration/snapshots.ts
new file mode 100644
index 0000000000000..c255328a77c12
--- /dev/null
+++ b/x-pack/plugins/apm/e2e/cypress/integration/snapshots.ts
@@ -0,0 +1,9 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License;
+ * you may not use this file except in compliance with the Elastic License.
+ */
+
+module.exports = {
+ __version: '4.9.0',
+};
diff --git a/x-pack/plugins/apm/e2e/cypress/support/step_definitions/rum/page_load_dist.ts b/x-pack/plugins/apm/e2e/cypress/support/step_definitions/csm/breakdown_filter.ts
similarity index 60%
rename from x-pack/plugins/apm/e2e/cypress/support/step_definitions/rum/page_load_dist.ts
rename to x-pack/plugins/apm/e2e/cypress/support/step_definitions/csm/breakdown_filter.ts
index d671bdc0078eb..acfbe6e0a4e78 100644
--- a/x-pack/plugins/apm/e2e/cypress/support/step_definitions/rum/page_load_dist.ts
+++ b/x-pack/plugins/apm/e2e/cypress/support/step_definitions/csm/breakdown_filter.ts
@@ -5,31 +5,38 @@
*/
import { Given, When, Then } from 'cypress-cucumber-preprocessor/steps';
+import { DEFAULT_TIMEOUT } from './csm_dashboard';
/** The default time in ms to wait for a Cypress command to complete */
-export const DEFAULT_TIMEOUT = 60 * 1000;
Given(`a user clicks the page load breakdown filter`, () => {
// wait for all loading to finish
cy.get('kbnLoadingIndicator').should('not.be.visible');
cy.get('.euiStat__title-isLoading').should('not.be.visible');
- const breakDownBtn = cy.get('[data-cy=breakdown-popover_pageLoad]');
+ const breakDownBtn = cy.get(
+ '[data-test-subj=pldBreakdownFilter]',
+ DEFAULT_TIMEOUT
+ );
breakDownBtn.click();
});
When(`the user selected the breakdown`, () => {
- cy.get('[data-cy=filter-breakdown-item_Browser]', {
- timeout: DEFAULT_TIMEOUT,
- }).click();
+ cy.get('[id="user_agent.name"]', DEFAULT_TIMEOUT).click();
// click outside popover to close it
cy.get('[data-cy=pageLoadDist]').click();
});
Then(`breakdown series should appear in chart`, () => {
cy.get('.euiLoadingChart').should('not.be.visible');
- cy.get('div.echLegendItem__label[title=Chrome] ', {
- timeout: DEFAULT_TIMEOUT,
- })
- .invoke('text')
- .should('eq', 'Chrome');
+
+ cy.get('[data-cy=pageLoadDist]').within(() => {
+ cy.get('div.echLegendItem__label[title=Chrome] ', DEFAULT_TIMEOUT)
+ .invoke('text')
+ .should('eq', 'Chrome');
+
+ cy.get('div.echLegendItem__label', DEFAULT_TIMEOUT).should(
+ 'have.text',
+ 'ChromeChrome Mobile WebViewSafariFirefoxMobile SafariChrome MobileChrome Mobile iOSOverall'
+ );
+ });
});
diff --git a/x-pack/plugins/apm/e2e/cypress/support/step_definitions/rum/client_metrics_helper.ts b/x-pack/plugins/apm/e2e/cypress/support/step_definitions/csm/client_metrics_helper.ts
similarity index 87%
rename from x-pack/plugins/apm/e2e/cypress/support/step_definitions/rum/client_metrics_helper.ts
rename to x-pack/plugins/apm/e2e/cypress/support/step_definitions/csm/client_metrics_helper.ts
index 1cc36059b8ff8..0b26c6de66f4b 100644
--- a/x-pack/plugins/apm/e2e/cypress/support/step_definitions/rum/client_metrics_helper.ts
+++ b/x-pack/plugins/apm/e2e/cypress/support/step_definitions/csm/client_metrics_helper.ts
@@ -4,7 +4,7 @@
* you may not use this file except in compliance with the Elastic License.
*/
-import { DEFAULT_TIMEOUT } from './rum_dashboard';
+import { DEFAULT_TIMEOUT } from './csm_dashboard';
/**
* Verifies the behavior of the client metrics component
@@ -21,9 +21,7 @@ export function verifyClientMetrics(
cy.get('kbnLoadingIndicator').should('not.be.visible');
if (checkTitleStatus) {
- cy.get('.euiStat__title', { timeout: DEFAULT_TIMEOUT }).should(
- 'be.visible'
- );
+ cy.get('.euiStat__title', DEFAULT_TIMEOUT).should('be.visible');
cy.get('.euiSelect-isLoading').should('not.be.visible');
}
diff --git a/x-pack/plugins/apm/e2e/cypress/support/step_definitions/rum/rum_dashboard.ts b/x-pack/plugins/apm/e2e/cypress/support/step_definitions/csm/csm_dashboard.ts
similarity index 83%
rename from x-pack/plugins/apm/e2e/cypress/support/step_definitions/rum/rum_dashboard.ts
rename to x-pack/plugins/apm/e2e/cypress/support/step_definitions/csm/csm_dashboard.ts
index 31aef30c4e23f..a57241a197ca4 100644
--- a/x-pack/plugins/apm/e2e/cypress/support/step_definitions/rum/rum_dashboard.ts
+++ b/x-pack/plugins/apm/e2e/cypress/support/step_definitions/csm/csm_dashboard.ts
@@ -9,20 +9,20 @@ import { loginAndWaitForPage } from '../../../integration/helpers';
import { verifyClientMetrics } from './client_metrics_helper';
/** The default time in ms to wait for a Cypress command to complete */
-export const DEFAULT_TIMEOUT = 60 * 1000;
+export const DEFAULT_TIMEOUT = { timeout: 60 * 1000 };
Given(`a user browses the APM UI application for RUM Data`, () => {
// open service overview page
const RANGE_FROM = 'now-24h';
const RANGE_TO = 'now';
- loginAndWaitForPage(`/app/apm/rum-preview`, {
+ loginAndWaitForPage(`/app/csm`, {
from: RANGE_FROM,
to: RANGE_TO,
});
});
Then(`should have correct client metrics`, () => {
- const metrics = ['0.01 sec', '0.08 sec', '55 '];
+ const metrics = ['4 ms', '0.06 s', '55 '];
verifyClientMetrics(metrics, true);
});
@@ -30,7 +30,7 @@ Then(`should have correct client metrics`, () => {
Then(`should display percentile for page load chart`, () => {
const pMarkers = '[data-cy=percentile-markers] span';
- cy.get('.euiLoadingChart', { timeout: DEFAULT_TIMEOUT }).should('be.visible');
+ cy.get('.euiLoadingChart', DEFAULT_TIMEOUT).should('be.visible');
// wait for all loading to finish
cy.get('kbnLoadingIndicator').should('not.be.visible');
@@ -52,10 +52,7 @@ Then(`should display chart legend`, () => {
cy.get('kbnLoadingIndicator').should('not.be.visible');
cy.get('.euiLoadingChart').should('not.be.visible');
- cy.get(chartLegend, { timeout: DEFAULT_TIMEOUT })
- .eq(0)
- .invoke('text')
- .snapshot();
+ cy.get(chartLegend, DEFAULT_TIMEOUT).eq(0).should('have.text', 'Overall');
});
Then(`should display tooltip on hover`, () => {
@@ -67,7 +64,7 @@ Then(`should display tooltip on hover`, () => {
cy.get('kbnLoadingIndicator').should('not.be.visible');
cy.get('.euiLoadingChart').should('not.be.visible');
- const marker = cy.get(pMarkers, { timeout: DEFAULT_TIMEOUT }).eq(0);
+ const marker = cy.get(pMarkers, DEFAULT_TIMEOUT).eq(0);
marker.invoke('show');
marker.trigger('mouseover', { force: true });
cy.get('span[data-cy=percentileTooltipTitle]').should('be.visible');
diff --git a/x-pack/plugins/apm/e2e/cypress/support/step_definitions/rum/rum_filters.ts b/x-pack/plugins/apm/e2e/cypress/support/step_definitions/csm/csm_filters.ts
similarity index 58%
rename from x-pack/plugins/apm/e2e/cypress/support/step_definitions/rum/rum_filters.ts
rename to x-pack/plugins/apm/e2e/cypress/support/step_definitions/csm/csm_filters.ts
index 2600e5d073328..c17845fd61468 100644
--- a/x-pack/plugins/apm/e2e/cypress/support/step_definitions/rum/rum_filters.ts
+++ b/x-pack/plugins/apm/e2e/cypress/support/step_definitions/csm/csm_filters.ts
@@ -5,7 +5,8 @@
*/
import { When, Then } from 'cypress-cucumber-preprocessor/steps';
-import { DEFAULT_TIMEOUT } from './rum_dashboard';
+import { DEFAULT_TIMEOUT } from './csm_dashboard';
+import { verifyClientMetrics } from './client_metrics_helper';
When(/^the user filters by "([^"]*)"$/, (filterName) => {
// wait for all loading to finish
@@ -14,29 +15,26 @@ When(/^the user filters by "([^"]*)"$/, (filterName) => {
cy.get(`#local-filter-${filterName}`).click();
if (filterName === 'os') {
- cy.get('button.euiSelectableListItem[title="Mac OS X"]', {
- timeout: DEFAULT_TIMEOUT,
- }).click();
+ cy.get('span.euiSelectableListItem__text', DEFAULT_TIMEOUT)
+ .contains('Mac OS X')
+ .click();
} else {
- cy.get('button.euiSelectableListItem[title="DE"]', {
- timeout: DEFAULT_TIMEOUT,
- }).click();
+ cy.get('span.euiSelectableListItem__text', DEFAULT_TIMEOUT)
+ .contains('DE')
+ .click();
}
cy.get('[data-cy=applyFilter]').click();
});
-Then(`it filters the client metrics`, () => {
- const clientMetrics = '[data-cy=client-metrics] .euiStat__title';
-
+Then(/^it filters the client metrics "([^"]*)"$/, (filterName) => {
// wait for all loading to finish
cy.get('kbnLoadingIndicator').should('not.be.visible');
cy.get('.euiStat__title-isLoading').should('not.be.visible');
- cy.get(clientMetrics).eq(2).invoke('text').snapshot();
-
- cy.get(clientMetrics).eq(1).invoke('text').snapshot();
+ const data =
+ filterName === 'os' ? ['5 ms', '0.06 s', '8 '] : ['4 ms', '0.05 s', '28 '];
- cy.get(clientMetrics).eq(0).invoke('text').snapshot();
+ verifyClientMetrics(data, true);
- cy.get('[data-cy=clearFilters]').click();
+ cy.get('[data-cy=clearFilters]', DEFAULT_TIMEOUT).click();
});
diff --git a/x-pack/plugins/apm/e2e/cypress/support/step_definitions/rum/service_name_filter.ts b/x-pack/plugins/apm/e2e/cypress/support/step_definitions/csm/service_name_filter.ts
similarity index 83%
rename from x-pack/plugins/apm/e2e/cypress/support/step_definitions/rum/service_name_filter.ts
rename to x-pack/plugins/apm/e2e/cypress/support/step_definitions/csm/service_name_filter.ts
index 68fc4d528543a..4169149bc7339 100644
--- a/x-pack/plugins/apm/e2e/cypress/support/step_definitions/rum/service_name_filter.ts
+++ b/x-pack/plugins/apm/e2e/cypress/support/step_definitions/csm/service_name_filter.ts
@@ -8,16 +8,16 @@ import { When, Then } from 'cypress-cucumber-preprocessor/steps';
import { DEFAULT_TIMEOUT } from '../apm';
import { verifyClientMetrics } from './client_metrics_helper';
-When('a user changes the selected service name', (filterName) => {
+When('the user changes the selected service name', (filterName) => {
// wait for all loading to finish
cy.get('kbnLoadingIndicator').should('not.be.visible');
cy.get(`[data-cy=serviceNameFilter]`, { timeout: DEFAULT_TIMEOUT }).select(
- 'opbean-client-rum'
+ 'client'
);
});
Then(`it displays relevant client metrics`, () => {
- const metrics = ['0.01 sec', '0.07 sec', '7 '];
+ const metrics = ['4 ms', '0.06 s', '55 '];
verifyClientMetrics(metrics, false);
});
diff --git a/x-pack/plugins/apm/public/components/app/RumDashboard/Breakdowns/BreakdownFilter.tsx b/x-pack/plugins/apm/public/components/app/RumDashboard/Breakdowns/BreakdownFilter.tsx
index 12d8efdbd27f3..91ce57c78b993 100644
--- a/x-pack/plugins/apm/public/components/app/RumDashboard/Breakdowns/BreakdownFilter.tsx
+++ b/x-pack/plugins/apm/public/components/app/RumDashboard/Breakdowns/BreakdownFilter.tsx
@@ -18,11 +18,13 @@ import { BreakdownItem } from '../../../../../typings/ui_filters';
interface Props {
selectedBreakdown: BreakdownItem | null;
onBreakdownChange: (value: BreakdownItem | null) => void;
+ dataTestSubj: string;
}
export function BreakdownFilter({
selectedBreakdown,
onBreakdownChange,
+ dataTestSubj,
}: Props) {
const NO_BREAKDOWN = 'noBreakdown';
@@ -84,6 +86,7 @@ export function BreakdownFilter({
options={options}
valueOfSelected={selectedBreakdown?.fieldName ?? NO_BREAKDOWN}
onChange={(value) => onOptionChange(value)}
+ data-test-subj={dataTestSubj}
/>
);
}
diff --git a/x-pack/plugins/apm/public/components/app/RumDashboard/PageLoadDistribution/index.tsx b/x-pack/plugins/apm/public/components/app/RumDashboard/PageLoadDistribution/index.tsx
index f63b914c73398..f97db3b42eecb 100644
--- a/x-pack/plugins/apm/public/components/app/RumDashboard/PageLoadDistribution/index.tsx
+++ b/x-pack/plugins/apm/public/components/app/RumDashboard/PageLoadDistribution/index.tsx
@@ -78,6 +78,7 @@ export function PageLoadDistribution() {
diff --git a/x-pack/plugins/apm/public/components/app/RumDashboard/PageViewsTrend/index.tsx b/x-pack/plugins/apm/public/components/app/RumDashboard/PageViewsTrend/index.tsx
index 62ecc4ddbaaca..2991f9a15f085 100644
--- a/x-pack/plugins/apm/public/components/app/RumDashboard/PageViewsTrend/index.tsx
+++ b/x-pack/plugins/apm/public/components/app/RumDashboard/PageViewsTrend/index.tsx
@@ -56,6 +56,7 @@ export function PageViewsTrend() {
diff --git a/x-pack/plugins/apm/public/components/app/ServiceMap/Cytoscape.tsx b/x-pack/plugins/apm/public/components/app/ServiceMap/Cytoscape.tsx
index 0b00c8a8bf093..41dacfd8b588a 100644
--- a/x-pack/plugins/apm/public/components/app/ServiceMap/Cytoscape.tsx
+++ b/x-pack/plugins/apm/public/components/app/ServiceMap/Cytoscape.tsx
@@ -4,24 +4,21 @@
* you may not use this file except in compliance with the Elastic License.
*/
+import cytoscape from 'cytoscape';
+import dagre from 'cytoscape-dagre';
+import isEqual from 'lodash/isEqual';
import React, {
createContext,
CSSProperties,
+ memo,
ReactNode,
useEffect,
useRef,
useState,
} from 'react';
-import cytoscape from 'cytoscape';
-import dagre from 'cytoscape-dagre';
-import { debounce } from 'lodash';
import { useTheme } from '../../../hooks/useTheme';
-import {
- getAnimationOptions,
- getCytoscapeOptions,
- getNodeHeight,
-} from './cytoscapeOptions';
-import { useUiTracker } from '../../../../../observability/public';
+import { getCytoscapeOptions } from './cytoscapeOptions';
+import { useCytoscapeEventHandlers } from './use_cytoscape_event_handlers';
cytoscape.use(dagre);
@@ -59,49 +56,7 @@ function useCytoscape(options: cytoscape.CytoscapeOptions) {
return [ref, cy] as [React.MutableRefObject, cytoscape.Core | undefined];
}
-function getLayoutOptions(nodeHeight: number): cytoscape.LayoutOptions {
- return {
- name: 'dagre',
- fit: true,
- padding: nodeHeight,
- spacingFactor: 1.2,
- // @ts-ignore
- nodeSep: nodeHeight,
- edgeSep: 32,
- rankSep: 128,
- rankDir: 'LR',
- ranker: 'network-simplex',
- };
-}
-
-/*
- * @notice
- * This product includes code in the function applyCubicBezierStyles that was
- * inspired by a public Codepen, which was available under a "MIT" license.
- *
- * Copyright (c) 2020 by Guillaume (https://codepen.io/guillaumethomas/pen/xxbbBKO)
- * MIT License http://www.opensource.org/licenses/mit-license
- */
-function applyCubicBezierStyles(edges: cytoscape.EdgeCollection) {
- edges.forEach((edge) => {
- const { x: x0, y: y0 } = edge.source().position();
- const { x: x1, y: y1 } = edge.target().position();
- const x = x1 - x0;
- const y = y1 - y0;
- const z = Math.sqrt(x * x + y * y);
- const costheta = z === 0 ? 0 : x / z;
- const alpha = 0.25;
- // Two values for control-point-distances represent a pair symmetric quadratic
- // bezier curves joined in the middle as a seamless cubic bezier curve:
- edge.style('control-point-distances', [
- -alpha * y * costheta,
- alpha * y * costheta,
- ]);
- edge.style('control-point-weights', [alpha, 1 - alpha]);
- });
-}
-
-export function Cytoscape({
+function CytoscapeComponent({
children,
elements,
height,
@@ -113,131 +68,31 @@ export function Cytoscape({
...getCytoscapeOptions(theme),
elements,
});
+ useCytoscapeEventHandlers({ cy, serviceName, theme });
- const nodeHeight = getNodeHeight(theme);
-
- // Add the height to the div style. The height is a separate prop because it
- // is required and can trigger rendering when changed.
- const divStyle = { ...style, height };
-
- const trackApmEvent = useUiTracker({ app: 'apm' });
-
- // Set up cytoscape event handlers
+ // Add items from the elements prop to the cytoscape collection and remove
+ // items that no longer are in the list, then trigger an event to notify
+ // the handlers that data has changed.
useEffect(() => {
- const resetConnectedEdgeStyle = (node?: cytoscape.NodeSingular) => {
- if (cy) {
- cy.edges().removeClass('highlight');
-
- if (node) {
- node.connectedEdges().addClass('highlight');
- }
- }
- };
+ if (cy && elements.length > 0) {
+ // We do a fit if we're going from 0 to >0 elements
+ const fit = cy.elements().length === 0;
- const dataHandler: cytoscape.EventHandler = (event) => {
- if (cy && cy.elements().length > 0) {
- if (serviceName) {
- resetConnectedEdgeStyle(cy.getElementById(serviceName));
- // Add the "primary" class to the node if its id matches the serviceName.
- if (cy.nodes().length > 0) {
- cy.nodes().removeClass('primary');
- cy.getElementById(serviceName).addClass('primary');
- }
- } else {
- resetConnectedEdgeStyle();
- }
- cy.layout(getLayoutOptions(nodeHeight)).run();
- }
- };
- let layoutstopDelayTimeout: NodeJS.Timeout;
- const layoutstopHandler: cytoscape.EventHandler = (event) => {
- // This 0ms timer is necessary to prevent a race condition
- // between the layout finishing rendering and viewport centering
- layoutstopDelayTimeout = setTimeout(() => {
- if (serviceName) {
- event.cy.animate({
- ...getAnimationOptions(theme),
- fit: {
- eles: event.cy.elements(),
- padding: nodeHeight,
- },
- center: {
- eles: event.cy.getElementById(serviceName),
- },
- });
- } else {
- event.cy.fit(undefined, nodeHeight);
- }
- }, 0);
- applyCubicBezierStyles(event.cy.edges());
- };
- // debounce hover tracking so it doesn't spam telemetry with redundant events
- const trackNodeEdgeHover = debounce(
- () => trackApmEvent({ metric: 'service_map_node_or_edge_hover' }),
- 1000
- );
- const mouseoverHandler: cytoscape.EventHandler = (event) => {
- trackNodeEdgeHover();
- event.target.addClass('hover');
- event.target.connectedEdges().addClass('nodeHover');
- };
- const mouseoutHandler: cytoscape.EventHandler = (event) => {
- event.target.removeClass('hover');
- event.target.connectedEdges().removeClass('nodeHover');
- };
- const selectHandler: cytoscape.EventHandler = (event) => {
- trackApmEvent({ metric: 'service_map_node_select' });
- resetConnectedEdgeStyle(event.target);
- };
- const unselectHandler: cytoscape.EventHandler = (event) => {
- resetConnectedEdgeStyle(
- serviceName ? event.cy.getElementById(serviceName) : undefined
- );
- };
- const debugHandler: cytoscape.EventHandler = (event) => {
- const debugEnabled = sessionStorage.getItem('apm_debug') === 'true';
- if (debugEnabled) {
- // eslint-disable-next-line no-console
- console.debug('cytoscape:', event);
- }
- };
- const dragHandler: cytoscape.EventHandler = (event) => {
- applyCubicBezierStyles(event.target.connectedEdges());
- };
-
- if (cy) {
- cy.on('data layoutstop select unselect', debugHandler);
- cy.on('data', dataHandler);
- cy.on('layoutstop', layoutstopHandler);
- cy.on('mouseover', 'edge, node', mouseoverHandler);
- cy.on('mouseout', 'edge, node', mouseoutHandler);
- cy.on('select', 'node', selectHandler);
- cy.on('unselect', 'node', unselectHandler);
- cy.on('drag', 'node', dragHandler);
-
- cy.remove(cy.elements());
cy.add(elements);
- cy.trigger('data');
+ // Remove any old elements that don't exist in the new set of elements.
+ const elementIds = elements.map((element) => element.data.id);
+ cy.elements().forEach((element) => {
+ if (!elementIds.includes(element.data('id'))) {
+ cy.remove(element);
+ }
+ });
+ cy.trigger('custom:data', [fit]);
}
+ }, [cy, elements]);
- return () => {
- if (cy) {
- cy.removeListener(
- 'data layoutstop select unselect',
- undefined,
- debugHandler
- );
- cy.removeListener('data', undefined, dataHandler);
- cy.removeListener('layoutstop', undefined, layoutstopHandler);
- cy.removeListener('mouseover', 'edge, node', mouseoverHandler);
- cy.removeListener('mouseout', 'edge, node', mouseoutHandler);
- cy.removeListener('select', 'node', selectHandler);
- cy.removeListener('unselect', 'node', unselectHandler);
- cy.removeListener('drag', 'node', dragHandler);
- }
- clearTimeout(layoutstopDelayTimeout);
- };
- }, [cy, elements, height, serviceName, trackApmEvent, nodeHeight, theme]);
+ // Add the height to the div style. The height is a separate prop because it
+ // is required and can trigger rendering when changed.
+ const divStyle = { ...style, height };
return (
@@ -247,3 +102,20 @@ export function Cytoscape({
);
}
+
+export const Cytoscape = memo(CytoscapeComponent, (prevProps, nextProps) => {
+ const prevElementIds = prevProps.elements
+ .map((element) => element.data.id)
+ .sort();
+ const nextElementIds = nextProps.elements
+ .map((element) => element.data.id)
+ .sort();
+
+ const propsAreEqual =
+ prevProps.height === nextProps.height &&
+ prevProps.serviceName === nextProps.serviceName &&
+ isEqual(prevProps.style, nextProps.style) &&
+ isEqual(prevElementIds, nextElementIds);
+
+ return propsAreEqual;
+});
diff --git a/x-pack/plugins/apm/public/components/app/ServiceMap/Popover/index.tsx b/x-pack/plugins/apm/public/components/app/ServiceMap/Popover/index.tsx
index 8291d94d91c48..c4272d2869016 100644
--- a/x-pack/plugins/apm/public/components/app/ServiceMap/Popover/index.tsx
+++ b/x-pack/plugins/apm/public/components/app/ServiceMap/Popover/index.tsx
@@ -70,7 +70,7 @@ export function Popover({ focusedServiceName }: PopoverProps) {
if (cy) {
cy.on('select', 'node', selectHandler);
cy.on('unselect', 'node', deselect);
- cy.on('data viewport', deselect);
+ cy.on('viewport', deselect);
cy.on('drag', 'node', deselect);
}
@@ -78,7 +78,7 @@ export function Popover({ focusedServiceName }: PopoverProps) {
if (cy) {
cy.removeListener('select', 'node', selectHandler);
cy.removeListener('unselect', 'node', deselect);
- cy.removeListener('data viewport', undefined, deselect);
+ cy.removeListener('viewport', undefined, deselect);
cy.removeListener('drag', 'node', deselect);
}
};
diff --git a/x-pack/plugins/apm/public/components/app/ServiceMap/use_cytoscape_event_handlers.test.tsx b/x-pack/plugins/apm/public/components/app/ServiceMap/use_cytoscape_event_handlers.test.tsx
new file mode 100644
index 0000000000000..4212d866c0853
--- /dev/null
+++ b/x-pack/plugins/apm/public/components/app/ServiceMap/use_cytoscape_event_handlers.test.tsx
@@ -0,0 +1,66 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License;
+ * you may not use this file except in compliance with the Elastic License.
+ */
+
+import { renderHook } from '@testing-library/react-hooks';
+import cytoscape from 'cytoscape';
+import { EuiTheme } from '../../../../../observability/public';
+import { useCytoscapeEventHandlers } from './use_cytoscape_event_handlers';
+import dagre from 'cytoscape-dagre';
+
+cytoscape.use(dagre);
+
+const theme = ({
+ eui: { avatarSizing: { l: { size: 10 } } },
+} as unknown) as EuiTheme;
+
+describe('useCytoscapeEventHandlers', () => {
+ describe('when cytoscape is undefined', () => {
+ it('runs', () => {
+ expect(() => {
+ renderHook(() => useCytoscapeEventHandlers({ cy: undefined, theme }));
+ }).not.toThrowError();
+ });
+ });
+
+ describe('when an element is dragged', () => {
+ it('sets the hasBeenDragged data', () => {
+ const cy = cytoscape({ elements: [{ data: { id: 'test' } }] });
+
+ renderHook(() => useCytoscapeEventHandlers({ cy, theme }));
+ cy.getElementById('test').trigger('drag');
+
+ expect(cy.getElementById('test').data('hasBeenDragged')).toEqual(true);
+ });
+ });
+
+ describe('when a node is hovered', () => {
+ it('applies the hover class', () => {
+ const cy = cytoscape({
+ elements: [{ data: { id: 'test' } }],
+ });
+ const node = cy.getElementById('test');
+
+ renderHook(() => useCytoscapeEventHandlers({ cy, theme }));
+ node.trigger('mouseover');
+
+ expect(node.hasClass('hover')).toEqual(true);
+ });
+ });
+
+ describe('when a node is un-hovered', () => {
+ it('removes the hover class', () => {
+ const cy = cytoscape({
+ elements: [{ data: { id: 'test' }, classes: 'hover' }],
+ });
+ const node = cy.getElementById('test');
+
+ renderHook(() => useCytoscapeEventHandlers({ cy, theme }));
+ node.trigger('mouseout');
+
+ expect(node.hasClass('hover')).toEqual(false);
+ });
+ });
+});
diff --git a/x-pack/plugins/apm/public/components/app/ServiceMap/use_cytoscape_event_handlers.ts b/x-pack/plugins/apm/public/components/app/ServiceMap/use_cytoscape_event_handlers.ts
new file mode 100644
index 0000000000000..3f879196f2a4f
--- /dev/null
+++ b/x-pack/plugins/apm/public/components/app/ServiceMap/use_cytoscape_event_handlers.ts
@@ -0,0 +1,188 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License;
+ * you may not use this file except in compliance with the Elastic License.
+ */
+
+import cytoscape from 'cytoscape';
+import debounce from 'lodash/debounce';
+import { useEffect } from 'react';
+import { EuiTheme, useUiTracker } from '../../../../../observability/public';
+import { getAnimationOptions, getNodeHeight } from './cytoscapeOptions';
+
+/*
+ * @notice
+ * This product includes code in the function applyCubicBezierStyles that was
+ * inspired by a public Codepen, which was available under a "MIT" license.
+ *
+ * Copyright (c) 2020 by Guillaume (https://codepen.io/guillaumethomas/pen/xxbbBKO)
+ * MIT License http://www.opensource.org/licenses/mit-license
+ */
+function applyCubicBezierStyles(edges: cytoscape.EdgeCollection) {
+ edges.forEach((edge) => {
+ const { x: x0, y: y0 } = edge.source().position();
+ const { x: x1, y: y1 } = edge.target().position();
+ const x = x1 - x0;
+ const y = y1 - y0;
+ const z = Math.sqrt(x * x + y * y);
+ const costheta = z === 0 ? 0 : x / z;
+ const alpha = 0.25;
+ // Two values for control-point-distances represent a pair symmetric quadratic
+ // bezier curves joined in the middle as a seamless cubic bezier curve:
+ edge.style('control-point-distances', [
+ -alpha * y * costheta,
+ alpha * y * costheta,
+ ]);
+ edge.style('control-point-weights', [alpha, 1 - alpha]);
+ });
+}
+
+function getLayoutOptions({
+ fit = false,
+ nodeHeight,
+ theme,
+}: {
+ fit?: boolean;
+ nodeHeight: number;
+ theme: EuiTheme;
+}): cytoscape.LayoutOptions {
+ const animationOptions = getAnimationOptions(theme);
+
+ // @ts-expect-error Some of the dagre-specific layout options don't work with
+ // the types.
+ return {
+ animationDuration: animationOptions.duration,
+ animationEasing: animationOptions.easing,
+ fit,
+ name: 'dagre',
+ animate: !fit,
+ padding: nodeHeight,
+ spacingFactor: 1.2,
+ nodeSep: nodeHeight,
+ edgeSep: 32,
+ rankSep: 128,
+ rankDir: 'LR',
+ ranker: 'network-simplex',
+ };
+}
+
+export function useCytoscapeEventHandlers({
+ cy,
+ serviceName,
+ theme,
+}: {
+ cy?: cytoscape.Core;
+ serviceName?: string;
+ theme: EuiTheme;
+}) {
+ const trackApmEvent = useUiTracker({ app: 'apm' });
+
+ useEffect(() => {
+ const nodeHeight = getNodeHeight(theme);
+
+ const resetConnectedEdgeStyle = (
+ cytoscapeInstance: cytoscape.Core,
+ node?: cytoscape.NodeSingular
+ ) => {
+ cytoscapeInstance.edges().removeClass('highlight');
+ if (node) {
+ node.connectedEdges().addClass('highlight');
+ }
+ };
+
+ const dataHandler: cytoscape.EventHandler = (event, fit) => {
+ if (serviceName) {
+ const node = event.cy.getElementById(serviceName);
+ resetConnectedEdgeStyle(event.cy, node);
+ // Add the "primary" class to the node if its id matches the serviceName.
+ if (event.cy.nodes().length > 0) {
+ event.cy.nodes().removeClass('primary');
+ node.addClass('primary');
+ }
+ } else {
+ resetConnectedEdgeStyle(event.cy);
+ }
+
+ // Run the layout on nodes that are not selected and have not been manually
+ // positioned.
+ event.cy
+ .elements('[!hasBeenDragged]')
+ .difference('node:selected')
+ .layout(getLayoutOptions({ fit, nodeHeight, theme }))
+ .run();
+ };
+
+ const layoutstopHandler: cytoscape.EventHandler = (event) => {
+ applyCubicBezierStyles(event.cy.edges());
+ };
+
+ // debounce hover tracking so it doesn't spam telemetry with redundant events
+ const trackNodeEdgeHover = debounce(
+ () => trackApmEvent({ metric: 'service_map_node_or_edge_hover' }),
+ 1000
+ );
+
+ const mouseoverHandler: cytoscape.EventHandler = (event) => {
+ trackNodeEdgeHover();
+ event.target.addClass('hover');
+ event.target.connectedEdges().addClass('nodeHover');
+ };
+ const mouseoutHandler: cytoscape.EventHandler = (event) => {
+ event.target.removeClass('hover');
+ event.target.connectedEdges().removeClass('nodeHover');
+ };
+ const selectHandler: cytoscape.EventHandler = (event) => {
+ trackApmEvent({ metric: 'service_map_node_select' });
+ resetConnectedEdgeStyle(event.target);
+ };
+ const unselectHandler: cytoscape.EventHandler = (event) => {
+ resetConnectedEdgeStyle(
+ event.cy,
+ serviceName ? event.cy.getElementById(serviceName) : undefined
+ );
+ };
+ const debugHandler: cytoscape.EventHandler = (event) => {
+ const debugEnabled = sessionStorage.getItem('apm_debug') === 'true';
+ if (debugEnabled) {
+ // eslint-disable-next-line no-console
+ console.debug('cytoscape:', event);
+ }
+ };
+
+ const dragHandler: cytoscape.EventHandler = (event) => {
+ applyCubicBezierStyles(event.target.connectedEdges());
+
+ if (!event.target.data('hasBeenDragged')) {
+ event.target.data('hasBeenDragged', true);
+ }
+ };
+
+ if (cy) {
+ cy.on('custom:data drag layoutstop select unselect', debugHandler);
+ cy.on('custom:data', dataHandler);
+ cy.on('layoutstop', layoutstopHandler);
+ cy.on('mouseover', 'edge, node', mouseoverHandler);
+ cy.on('mouseout', 'edge, node', mouseoutHandler);
+ cy.on('select', 'node', selectHandler);
+ cy.on('unselect', 'node', unselectHandler);
+ cy.on('drag', 'node', dragHandler);
+ }
+
+ return () => {
+ if (cy) {
+ cy.removeListener(
+ 'custom:data drag layoutstop select unselect',
+ undefined,
+ debugHandler
+ );
+ cy.removeListener('custom:data', undefined, dataHandler);
+ cy.removeListener('layoutstop', undefined, layoutstopHandler);
+ cy.removeListener('mouseover', 'edge, node', mouseoverHandler);
+ cy.removeListener('mouseout', 'edge, node', mouseoutHandler);
+ cy.removeListener('select', 'node', selectHandler);
+ cy.removeListener('unselect', 'node', unselectHandler);
+ cy.removeListener('drag', 'node', dragHandler);
+ }
+ };
+ }, [cy, serviceName, trackApmEvent, theme]);
+}
diff --git a/x-pack/plugins/canvas/server/routes/shareables/download.test.ts b/x-pack/plugins/canvas/server/routes/shareables/download.test.ts
index 1edf9f52e164a..8c0203eaf1042 100644
--- a/x-pack/plugins/canvas/server/routes/shareables/download.test.ts
+++ b/x-pack/plugins/canvas/server/routes/shareables/download.test.ts
@@ -4,9 +4,10 @@
* you may not use this file except in compliance with the Elastic License.
*/
-jest.mock('fs');
-
import fs from 'fs';
+import { when } from 'jest-when';
+import { SHAREABLE_RUNTIME_FILE } from '../../../shareable_runtime/constants';
+
import { kibanaResponseFactory, RequestHandlerContext, RequestHandler } from 'src/core/server';
import { httpServerMock } from 'src/core/server/mocks';
import { initializeDownloadShareableWorkpadRoute } from './download';
@@ -14,7 +15,6 @@ import { getMockedRouterDeps } from '../test_helpers';
const mockRouteContext = {} as RequestHandlerContext;
const path = `api/canvas/workpad/find`;
-const mockRuntime = 'Canvas shareable runtime';
describe('Download Canvas shareables runtime', () => {
let routeHandler: RequestHandler;
@@ -31,17 +31,18 @@ describe('Download Canvas shareables runtime', () => {
});
it(`returns 200 with canvas shareables runtime`, async () => {
+ const content = 'Canvas shareable runtime';
+ const spy = jest.spyOn(fs, 'readFileSync').mockImplementation();
+ when(spy).calledWith(SHAREABLE_RUNTIME_FILE).mockReturnValue(content);
+
const request = httpServerMock.createKibanaRequest({
method: 'get',
path,
});
- const readFileSyncMock = fs.readFileSync as jest.Mock;
- readFileSyncMock.mockReturnValueOnce(mockRuntime);
-
const response = await routeHandler(mockRouteContext, request, kibanaResponseFactory);
expect(response.status).toBe(200);
- expect(response.payload).toMatchInlineSnapshot(`"Canvas shareable runtime"`);
+ expect(response.payload).toMatchInlineSnapshot(`"${content}"`);
});
});
diff --git a/x-pack/plugins/canvas/server/routes/shareables/mock_shareable_workpad.json b/x-pack/plugins/canvas/server/routes/shareables/mock_shareable_workpad.json
deleted file mode 100644
index e69de29bb2d1d..0000000000000
diff --git a/x-pack/plugins/enterprise_search/public/applications/shared/layout/layout.test.tsx b/x-pack/plugins/enterprise_search/public/applications/shared/layout/layout.test.tsx
index 4053f2f4bb613..623e6e47167d2 100644
--- a/x-pack/plugins/enterprise_search/public/applications/shared/layout/layout.test.tsx
+++ b/x-pack/plugins/enterprise_search/public/applications/shared/layout/layout.test.tsx
@@ -6,7 +6,7 @@
import React from 'react';
import { shallow } from 'enzyme';
-import { EuiPageSideBar, EuiButton } from '@elastic/eui';
+import { EuiPageSideBar, EuiButton, EuiPageBody } from '@elastic/eui';
import { Layout, INavContext } from './layout';
@@ -15,6 +15,13 @@ describe('Layout', () => {
const wrapper = shallow( );
expect(wrapper.find('.enterpriseSearchLayout')).toHaveLength(1);
+ expect(wrapper.find(EuiPageBody).prop('restrictWidth')).toBeFalsy();
+ });
+
+ it('passes the restrictWidth prop', () => {
+ const wrapper = shallow( );
+
+ expect(wrapper.find(EuiPageBody).prop('restrictWidth')).toEqual(true);
});
it('renders navigation', () => {
diff --git a/x-pack/plugins/enterprise_search/public/applications/shared/layout/layout.tsx b/x-pack/plugins/enterprise_search/public/applications/shared/layout/layout.tsx
index b4497140b65b7..e122c4d5cfdfa 100644
--- a/x-pack/plugins/enterprise_search/public/applications/shared/layout/layout.tsx
+++ b/x-pack/plugins/enterprise_search/public/applications/shared/layout/layout.tsx
@@ -14,6 +14,7 @@ import './layout.scss';
interface ILayoutProps {
navigation: React.ReactNode;
+ restrictWidth?: boolean;
}
export interface INavContext {
@@ -21,7 +22,7 @@ export interface INavContext {
}
export const NavContext = React.createContext({});
-export const Layout: React.FC = ({ children, navigation }) => {
+export const Layout: React.FC = ({ children, navigation, restrictWidth }) => {
const [isNavOpen, setIsNavOpen] = useState(false);
const toggleNavigation = () => setIsNavOpen(!isNavOpen);
const closeNavigation = () => setIsNavOpen(false);
@@ -54,7 +55,9 @@ export const Layout: React.FC = ({ children, navigation }) => {
{navigation}
- {children}
+
+ {children}
+
);
};
diff --git a/x-pack/plugins/enterprise_search/public/plugin.ts b/x-pack/plugins/enterprise_search/public/plugin.ts
index 63f334811ce31..0ef58a7c03f10 100644
--- a/x-pack/plugins/enterprise_search/public/plugin.ts
+++ b/x-pack/plugins/enterprise_search/public/plugin.ts
@@ -53,6 +53,7 @@ export class EnterpriseSearchPlugin implements Plugin {
core.application.register({
id: ENTERPRISE_SEARCH_PLUGIN.ID,
title: ENTERPRISE_SEARCH_PLUGIN.NAV_TITLE,
+ euiIconType: ENTERPRISE_SEARCH_PLUGIN.LOGO,
appRoute: ENTERPRISE_SEARCH_PLUGIN.URL,
category: DEFAULT_APP_CATEGORIES.enterpriseSearch,
mount: async (params: AppMountParameters) => {
diff --git a/x-pack/plugins/features/server/plugin.ts b/x-pack/plugins/features/server/plugin.ts
index 8a799887bba09..857bba4c606d4 100644
--- a/x-pack/plugins/features/server/plugin.ts
+++ b/x-pack/plugins/features/server/plugin.ts
@@ -4,6 +4,7 @@
* you may not use this file except in compliance with the Elastic License.
*/
import { RecursiveReadonly } from '@kbn/utility-types';
+import { deepFreeze } from '@kbn/std';
import {
CoreSetup,
CoreStart,
@@ -12,7 +13,6 @@ import {
PluginInitializerContext,
} from '../../../../src/core/server';
import { Capabilities as UICapabilities } from '../../../../src/core/server';
-import { deepFreeze } from '../../../../src/core/server';
import { PluginSetupContract as TimelionSetupContract } from '../../../../src/plugins/vis_type_timelion/server';
import { FeatureRegistry } from './feature_registry';
import { uiCapabilitiesForFeatures } from './ui_capabilities_for_features';
diff --git a/x-pack/plugins/global_search_bar/public/components/search_bar.tsx b/x-pack/plugins/global_search_bar/public/components/search_bar.tsx
index 25ca1b07321c7..d00349e21a7e4 100644
--- a/x-pack/plugins/global_search_bar/public/components/search_bar.tsx
+++ b/x-pack/plugins/global_search_bar/public/components/search_bar.tsx
@@ -197,18 +197,6 @@ export function SearchBar({ globalSearch, navigateToUrl }: Props) {
),
}}
/>
- Shortcut,
- how: (
-
- {isMac ? 'Command + /' : 'Control + /'}
-
- ),
- }}
- />
}
diff --git a/x-pack/plugins/graph/public/state_management/url_templates.ts b/x-pack/plugins/graph/public/state_management/url_templates.ts
index 19de52d444209..9149a27a4f986 100644
--- a/x-pack/plugins/graph/public/state_management/url_templates.ts
+++ b/x-pack/plugins/graph/public/state_management/url_templates.ts
@@ -7,6 +7,7 @@
import actionCreatorFactory from 'typescript-fsa';
import { reducerWithInitialState } from 'typescript-fsa-reducers/dist';
import { i18n } from '@kbn/i18n';
+import { modifyUrl } from '@kbn/std';
import rison from 'rison-node';
import { takeEvery, select } from 'redux-saga/effects';
import { format, parse } from 'url';
@@ -17,7 +18,6 @@ import { setDatasource, IndexpatternDatasource, requestDatasource } from './data
import { outlinkEncoders } from '../helpers/outlink_encoders';
import { urlTemplatePlaceholder } from '../helpers/url_template';
import { matchesOne } from './helpers';
-import { modifyUrl } from '../../../../../src/core/public';
const actionCreator = actionCreatorFactory('x-pack/graph/urlTemplates');
diff --git a/x-pack/plugins/index_lifecycle_management/__jest__/components/edit_policy.test.tsx b/x-pack/plugins/index_lifecycle_management/__jest__/components/edit_policy.test.tsx
index 28b25c3eb4530..3867c30655379 100644
--- a/x-pack/plugins/index_lifecycle_management/__jest__/components/edit_policy.test.tsx
+++ b/x-pack/plugins/index_lifecycle_management/__jest__/components/edit_policy.test.tsx
@@ -275,6 +275,40 @@ describe('edit policy', () => {
save(rendered);
expectedErrorMessages(rendered, [positiveNumbersAboveZeroErrorMessage]);
});
+ test('should show forcemerge input when rollover enabled', () => {
+ const rendered = mountWithIntl(component);
+ setPolicyName(rendered, 'mypolicy');
+ expect(findTestSubject(rendered, 'hot-forceMergeSwitch').exists()).toBeTruthy();
+ });
+ test('should hide forcemerge input when rollover is disabled', () => {
+ const rendered = mountWithIntl(component);
+ setPolicyName(rendered, 'mypolicy');
+ noRollover(rendered);
+ rendered.update();
+ expect(findTestSubject(rendered, 'hot-forceMergeSwitch').exists()).toBeFalsy();
+ });
+ test('should show positive number required above zero error when trying to save hot phase with 0 for force merge', async () => {
+ const rendered = mountWithIntl(component);
+ setPolicyName(rendered, 'mypolicy');
+ findTestSubject(rendered, 'hot-forceMergeSwitch').simulate('click');
+ rendered.update();
+ const forcemergeInput = findTestSubject(rendered, 'hot-selectedForceMergeSegments');
+ forcemergeInput.simulate('change', { target: { value: '0' } });
+ rendered.update();
+ save(rendered);
+ expectedErrorMessages(rendered, [positiveNumbersAboveZeroErrorMessage]);
+ });
+ test('should show positive number above 0 required error when trying to save hot phase with -1 for force merge', async () => {
+ const rendered = mountWithIntl(component);
+ setPolicyName(rendered, 'mypolicy');
+ findTestSubject(rendered, 'hot-forceMergeSwitch').simulate('click');
+ rendered.update();
+ const forcemergeInput = findTestSubject(rendered, 'hot-selectedForceMergeSegments');
+ forcemergeInput.simulate('change', { target: { value: '-1' } });
+ rendered.update();
+ save(rendered);
+ expectedErrorMessages(rendered, [positiveNumbersAboveZeroErrorMessage]);
+ });
test('should show positive number required error when trying to save with -1 for index priority', () => {
const rendered = mountWithIntl(component);
noRollover(rendered);
@@ -364,10 +398,10 @@ describe('edit policy', () => {
setPolicyName(rendered, 'mypolicy');
await activatePhase(rendered, 'warm');
setPhaseAfter(rendered, 'warm', '1');
- findTestSubject(rendered, 'forceMergeSwitch').simulate('click');
+ findTestSubject(rendered, 'warm-forceMergeSwitch').simulate('click');
rendered.update();
- const shrinkInput = rendered.find('input#warm-selectedForceMergeSegments');
- shrinkInput.simulate('change', { target: { value: '0' } });
+ const forcemergeInput = findTestSubject(rendered, 'warm-selectedForceMergeSegments');
+ forcemergeInput.simulate('change', { target: { value: '0' } });
rendered.update();
save(rendered);
expectedErrorMessages(rendered, [positiveNumbersAboveZeroErrorMessage]);
@@ -378,10 +412,10 @@ describe('edit policy', () => {
setPolicyName(rendered, 'mypolicy');
await activatePhase(rendered, 'warm');
setPhaseAfter(rendered, 'warm', '1');
- findTestSubject(rendered, 'forceMergeSwitch').simulate('click');
+ findTestSubject(rendered, 'warm-forceMergeSwitch').simulate('click');
rendered.update();
- const shrinkInput = rendered.find('input#warm-selectedForceMergeSegments');
- shrinkInput.simulate('change', { target: { value: '-1' } });
+ const forcemergeInput = findTestSubject(rendered, 'warm-selectedForceMergeSegments');
+ forcemergeInput.simulate('change', { target: { value: '-1' } });
rendered.update();
save(rendered);
expectedErrorMessages(rendered, [positiveNumbersAboveZeroErrorMessage]);
diff --git a/x-pack/plugins/index_lifecycle_management/common/types/policies.ts b/x-pack/plugins/index_lifecycle_management/common/types/policies.ts
index d88d5b5021a25..97effee44533a 100644
--- a/x-pack/plugins/index_lifecycle_management/common/types/policies.ts
+++ b/x-pack/plugins/index_lifecycle_management/common/types/policies.ts
@@ -41,6 +41,9 @@ export interface SerializedHotPhase extends SerializedPhase {
max_age?: string;
max_docs?: number;
};
+ forcemerge?: {
+ max_num_segments: number;
+ };
set_priority?: {
priority: number | null;
};
@@ -131,7 +134,15 @@ export interface PhaseWithIndexPriority {
phaseIndexPriority: string;
}
-export interface HotPhase extends CommonPhaseSettings, PhaseWithIndexPriority {
+export interface PhaseWithForcemergeAction {
+ forceMergeEnabled: boolean;
+ selectedForceMergeSegments: string;
+}
+
+export interface HotPhase
+ extends CommonPhaseSettings,
+ PhaseWithIndexPriority,
+ PhaseWithForcemergeAction {
rolloverEnabled: boolean;
selectedMaxSizeStored: string;
selectedMaxSizeStoredUnits: string;
@@ -144,12 +155,11 @@ export interface WarmPhase
extends CommonPhaseSettings,
PhaseWithMinAge,
PhaseWithAllocationAction,
- PhaseWithIndexPriority {
+ PhaseWithIndexPriority,
+ PhaseWithForcemergeAction {
warmPhaseOnRollover: boolean;
shrinkEnabled: boolean;
selectedPrimaryShardCount: string;
- forceMergeEnabled: boolean;
- selectedForceMergeSegments: string;
}
export interface ColdPhase
diff --git a/x-pack/plugins/index_lifecycle_management/public/application/constants/policy.ts b/x-pack/plugins/index_lifecycle_management/public/application/constants/policy.ts
index 4fd74da06f1b3..f11860d36faf8 100644
--- a/x-pack/plugins/index_lifecycle_management/public/application/constants/policy.ts
+++ b/x-pack/plugins/index_lifecycle_management/public/application/constants/policy.ts
@@ -20,6 +20,8 @@ export const defaultNewHotPhase: HotPhase = {
selectedMaxAgeUnits: 'd',
selectedMaxSizeStored: '50',
selectedMaxSizeStoredUnits: 'gb',
+ forceMergeEnabled: false,
+ selectedForceMergeSegments: '',
phaseIndexPriority: '100',
selectedMaxDocuments: '',
};
diff --git a/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/forcemerge.tsx b/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/forcemerge.tsx
new file mode 100644
index 0000000000000..50cc7fd8b3274
--- /dev/null
+++ b/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/forcemerge.tsx
@@ -0,0 +1,97 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License;
+ * you may not use this file except in compliance with the Elastic License.
+ */
+
+import { FormattedMessage } from '@kbn/i18n/react';
+import {
+ EuiDescribedFormGroup,
+ EuiFieldNumber,
+ EuiSpacer,
+ EuiSwitch,
+ EuiTextColor,
+} from '@elastic/eui';
+import { i18n } from '@kbn/i18n';
+import React from 'react';
+import { LearnMoreLink } from './learn_more_link';
+import { ErrableFormRow } from './form_errors';
+import { Phases, PhaseWithForcemergeAction } from '../../../../../common/types';
+import { PhaseValidationErrors } from '../../../services/policies/policy_validation';
+
+const forcemergeLabel = i18n.translate('xpack.indexLifecycleMgmt.warmPhase.forceMergeDataLabel', {
+ defaultMessage: 'Force merge data',
+});
+
+interface Props {
+ errors?: PhaseValidationErrors;
+ phase: keyof Phases & string;
+ phaseData: PhaseWithForcemergeAction;
+ setPhaseData: (dataKey: keyof PhaseWithForcemergeAction, value: boolean | string) => void;
+ isShowingErrors: boolean;
+}
+export const Forcemerge: React.FunctionComponent = ({
+ errors,
+ phaseData,
+ phase,
+ setPhaseData,
+ isShowingErrors,
+}) => {
+ return (
+
+
+
+ }
+ description={
+
+ {' '}
+
+
+ }
+ titleSize="xs"
+ fullWidth
+ >
+ {
+ setPhaseData('forceMergeEnabled', e.target.checked);
+ }}
+ aria-controls="forcemergeContent"
+ />
+
+
+
+ {phaseData.forceMergeEnabled ? (
+
+ {
+ setPhaseData('selectedForceMergeSegments', e.target.value);
+ }}
+ min={1}
+ />
+
+ ) : null}
+
+
+ );
+};
diff --git a/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/index.ts b/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/index.ts
index e933c46e98491..4410c4bb38397 100644
--- a/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/index.ts
+++ b/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/index.ts
@@ -15,3 +15,4 @@ export { PhaseErrorMessage } from './phase_error_message';
export { PolicyJsonFlyout } from './policy_json_flyout';
export { SetPriorityInput } from './set_priority_input';
export { SnapshotPolicies } from './snapshot_policies';
+export { Forcemerge } from './forcemerge';
diff --git a/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/phases/hot_phase.tsx b/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/phases/hot_phase.tsx
index 59949ad93fa5d..7682b92488086 100644
--- a/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/phases/hot_phase.tsx
+++ b/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/phases/hot_phase.tsx
@@ -27,6 +27,7 @@ import {
PhaseErrorMessage,
ErrableFormRow,
SetPriorityInput,
+ Forcemerge,
} from '../components';
const maxSizeStoredUnits = [
@@ -313,6 +314,15 @@ export class HotPhase extends PureComponent {
) : null}
+ {phaseData.rolloverEnabled ? (
+
+ ) : null}
errors={errors}
phaseData={phaseData}
diff --git a/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/phases/warm_phase.tsx b/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/phases/warm_phase.tsx
index 71286475bcfe9..c806056899cac 100644
--- a/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/phases/warm_phase.tsx
+++ b/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/phases/warm_phase.tsx
@@ -29,6 +29,7 @@ import {
SetPriorityInput,
NodeAllocation,
MinAgeInput,
+ Forcemerge,
} from '../components';
const shrinkLabel = i18n.translate('xpack.indexLifecycleMgmt.warmPhase.shrinkIndexLabel', {
@@ -42,10 +43,6 @@ const moveToWarmPhaseOnRolloverLabel = i18n.translate(
}
);
-const forcemergeLabel = i18n.translate('xpack.indexLifecycleMgmt.warmPhase.forceMergeDataLabel', {
- defaultMessage: 'Force merge data',
-});
-
const warmProperty: keyof Phases = 'warm';
const phaseProperty = (propertyName: keyof WarmPhaseInterface) => propertyName;
@@ -262,64 +259,13 @@ export class WarmPhase extends PureComponent {
-
-
-
- }
- description={
-
- {' '}
-
-
- }
- titleSize="xs"
- fullWidth
- >
- {
- setPhaseData(phaseProperty('forceMergeEnabled'), e.target.checked);
- }}
- aria-controls="forcemergeContent"
- />
-
-
-
- {phaseData.forceMergeEnabled ? (
-
- {
- setPhaseData(phaseProperty('selectedForceMergeSegments'), e.target.value);
- }}
- min={1}
- />
-
- ) : null}
-
-
+
errors={errors}
phaseData={phaseData}
diff --git a/x-pack/plugins/index_lifecycle_management/public/application/services/policies/hot_phase.ts b/x-pack/plugins/index_lifecycle_management/public/application/services/policies/hot_phase.ts
index fb7f74efeb66e..4ef4890b5ffe3 100644
--- a/x-pack/plugins/index_lifecycle_management/public/application/services/policies/hot_phase.ts
+++ b/x-pack/plugins/index_lifecycle_management/public/application/services/policies/hot_phase.ts
@@ -24,6 +24,8 @@ const hotPhaseInitialization: HotPhase = {
selectedMaxAgeUnits: 'd',
selectedMaxSizeStored: '',
selectedMaxSizeStoredUnits: 'gb',
+ forceMergeEnabled: false,
+ selectedForceMergeSegments: '',
phaseIndexPriority: '',
selectedMaxDocuments: '',
};
@@ -58,6 +60,12 @@ export const hotPhaseFromES = (phaseSerialized?: SerializedHotPhase): HotPhase =
}
}
+ if (actions.forcemerge) {
+ const forcemerge = actions.forcemerge;
+ phase.forceMergeEnabled = true;
+ phase.selectedForceMergeSegments = forcemerge.max_num_segments.toString();
+ }
+
if (actions.set_priority) {
phase.phaseIndexPriority = actions.set_priority.priority
? actions.set_priority.priority.toString()
@@ -93,8 +101,19 @@ export const hotPhaseToES = (
if (isNumber(phase.selectedMaxDocuments)) {
esPhase.actions.rollover.max_docs = parseInt(phase.selectedMaxDocuments, 10);
}
+ if (phase.forceMergeEnabled && isNumber(phase.selectedForceMergeSegments)) {
+ esPhase.actions.forcemerge = {
+ max_num_segments: parseInt(phase.selectedForceMergeSegments, 10),
+ };
+ } else {
+ delete esPhase.actions.forcemerge;
+ }
} else {
delete esPhase.actions.rollover;
+ // forcemerge is only allowed if rollover is enabled
+ if (esPhase.actions.forcemerge) {
+ delete esPhase.actions.forcemerge;
+ }
}
if (isNumber(phase.phaseIndexPriority)) {
@@ -147,6 +166,15 @@ export const validateHotPhase = (phase: HotPhase): PhaseValidationErrors) => {
});
});
await act(async () => {
- find('processorSettingsForm.submitButton').simulate('click');
+ find('addProcessorForm.submitButton').simulate('click');
});
},
@@ -166,7 +166,7 @@ const createActions = (testBed: TestBed) => {
});
});
await act(async () => {
- find('processorSettingsForm.submitButton').simulate('click');
+ find('addProcessorForm.submitButton').simulate('click');
});
},
@@ -202,8 +202,10 @@ type TestSubject =
| 'pipelineEditorDoneButton'
| 'pipelineEditorOnFailureToggle'
| 'addProcessorsButtonLevel1'
- | 'processorSettingsForm'
- | 'processorSettingsForm.submitButton'
+ | 'editProcessorForm'
+ | 'editProcessorForm.submitButton'
+ | 'addProcessorForm.submitButton'
+ | 'addProcessorForm'
| 'processorOptionsEditor'
| 'processorSettingsFormFlyout'
| 'processorTypeSelector'
diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/__jest__/pipeline_processors_editor.test.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/__jest__/pipeline_processors_editor.test.tsx
index 38c652f41e5e1..74ae8b8894b9f 100644
--- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/__jest__/pipeline_processors_editor.test.tsx
+++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/__jest__/pipeline_processors_editor.test.tsx
@@ -180,7 +180,7 @@ describe('Pipeline Editor', () => {
it('prevents moving a processor while in edit mode', () => {
const { find, exists } = testBed;
find('processors>0.manageItemButton').simulate('click');
- expect(exists('processorSettingsForm')).toBe(true);
+ expect(exists('editProcessorForm')).toBe(true);
expect(find('processors>0.moveItemButton').props().disabled).toBe(true);
expect(find('processors>1.moveItemButton').props().disabled).toBe(true);
});
diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/__jest__/test_pipeline.helpers.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/__jest__/test_pipeline.helpers.tsx
index fec3259fa019b..f4c89d7a1058a 100644
--- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/__jest__/test_pipeline.helpers.tsx
+++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/__jest__/test_pipeline.helpers.tsx
@@ -140,8 +140,8 @@ const createActions = (testBed: TestBed) => {
component.update();
},
- clickProcessorOutputTab() {
- act(() => {
+ async clickProcessorOutputTab() {
+ await act(async () => {
find('outputTab').simulate('click');
});
component.update();
@@ -224,7 +224,8 @@ type TestSubject =
| 'processorStatusIcon'
| 'documentsTab'
| 'manageItemButton'
- | 'processorSettingsForm'
+ | 'addProcessorForm'
+ | 'editProcessorForm'
| 'configurationTab'
| 'outputTab'
| 'processorOutputTabContent'
diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/__jest__/test_pipeline.test.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/__jest__/test_pipeline.test.tsx
index 339c840bb86f1..e5118a6e465af 100644
--- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/__jest__/test_pipeline.test.tsx
+++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/__jest__/test_pipeline.test.tsx
@@ -44,7 +44,7 @@ describe('Test pipeline', () => {
describe('Test pipeline actions', () => {
it('should successfully add sample documents and execute the pipeline', async () => {
- const { find, actions, exists } = testBed;
+ const { actions, exists } = testBed;
httpRequestsMockHelpers.setSimulatePipelineResponse(SIMULATE_RESPONSE);
@@ -59,7 +59,6 @@ describe('Test pipeline', () => {
expect(exists('testPipelineFlyout')).toBe(true);
expect(exists('documentsTabContent')).toBe(true);
expect(exists('outputTabContent')).toBe(false);
- expect(find('outputTab').props().disabled).toEqual(true);
// Add sample documents and click run
actions.addDocumentsJson(JSON.stringify(DOCUMENTS));
@@ -89,21 +88,25 @@ describe('Test pipeline', () => {
});
// Verify output tab is active
- expect(find('outputTab').props().disabled).toEqual(false);
expect(exists('documentsTabContent')).toBe(false);
expect(exists('outputTabContent')).toBe(true);
// Click reload button and verify request
const totalRequests = server.requests.length;
await actions.clickRefreshOutputButton();
- expect(server.requests.length).toBe(totalRequests + 1);
+ // There will be two requests made to the simulate API
+ // the second request will have verbose enabled to update the processor results
+ expect(server.requests.length).toBe(totalRequests + 2);
+ expect(server.requests[server.requests.length - 2].url).toBe(
+ '/api/ingest_pipelines/simulate'
+ );
expect(server.requests[server.requests.length - 1].url).toBe(
'/api/ingest_pipelines/simulate'
);
// Click verbose toggle and verify request
await actions.toggleVerboseSwitch();
- expect(server.requests.length).toBe(totalRequests + 2);
+ expect(server.requests.length).toBe(totalRequests + 3);
expect(server.requests[server.requests.length - 1].url).toBe(
'/api/ingest_pipelines/simulate'
);
@@ -228,10 +231,10 @@ describe('Test pipeline', () => {
// Click processor to open manage flyout
await actions.clickProcessor('processors>0');
// Verify flyout opened
- expect(exists('processorSettingsForm')).toBe(true);
+ expect(exists('editProcessorForm')).toBe(true);
// Navigate to "Output" tab
- actions.clickProcessorOutputTab();
+ await actions.clickProcessorOutputTab();
// Verify content
expect(exists('processorOutputTabContent')).toBe(true);
});
diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/documents_dropdown/documents_dropdown.scss b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/documents_dropdown/documents_dropdown.scss
deleted file mode 100644
index c5b14dc129b0e..0000000000000
--- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/documents_dropdown/documents_dropdown.scss
+++ /dev/null
@@ -1,3 +0,0 @@
-.documentsDropdown__selectContainer {
- max-width: 200px;
-}
diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/documents_dropdown/documents_dropdown.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/documents_dropdown/documents_dropdown.tsx
deleted file mode 100644
index e26b6a2890fe4..0000000000000
--- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/documents_dropdown/documents_dropdown.tsx
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
- * or more contributor license agreements. Licensed under the Elastic License;
- * you may not use this file except in compliance with the Elastic License.
- */
-import { i18n } from '@kbn/i18n';
-import React, { FunctionComponent } from 'react';
-import { EuiSelect, EuiFlexGroup, EuiFlexItem, EuiText } from '@elastic/eui';
-
-import { Document } from '../../types';
-
-import './documents_dropdown.scss';
-
-const i18nTexts = {
- ariaLabel: i18n.translate(
- 'xpack.ingestPipelines.pipelineEditor.testPipeline.documentsDropdownAriaLabel',
- {
- defaultMessage: 'Select documents',
- }
- ),
- dropdownLabel: i18n.translate(
- 'xpack.ingestPipelines.pipelineEditor.testPipeline.documentsdropdownLabel',
- {
- defaultMessage: 'Documents:',
- }
- ),
- buttonLabel: i18n.translate('xpack.ingestPipelines.pipelineEditor.testPipeline.buttonLabel', {
- defaultMessage: 'Add documents',
- }),
-};
-
-const getDocumentOptions = (documents: Document[]) =>
- documents.map((doc, index) => ({
- value: index,
- text: doc._id,
- }));
-
-interface Props {
- documents: Document[];
- selectedDocumentIndex: number;
- updateSelectedDocument: (index: number) => void;
-}
-
-export const DocumentsDropdown: FunctionComponent = ({
- documents,
- selectedDocumentIndex,
- updateSelectedDocument,
-}) => {
- return (
-
-
-
- {i18nTexts.dropdownLabel}
-
-
-
- {
- updateSelectedDocument(Number(e.target.value));
- }}
- aria-label={i18nTexts.ariaLabel}
- data-test-subj="documentsDropdown"
- />
-
-
- );
-};
diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/index.ts b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/index.ts
index 435d0ed66c4b0..d476202aa43bb 100644
--- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/index.ts
+++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/index.ts
@@ -4,11 +4,7 @@
* you may not use this file except in compliance with the Elastic License.
*/
-export {
- ManageProcessorForm,
- ManageProcessorFormOnSubmitArg,
- OnSubmitHandler,
-} from './manage_processor_form';
+export { ProcessorForm, ProcessorFormOnSubmitArg, OnSubmitHandler } from './processor_form';
export { ProcessorsTree, ProcessorInfo, OnActionHandler } from './processors_tree';
@@ -22,6 +18,4 @@ export { OnDoneLoadJsonHandler, LoadFromJsonButton } from './load_from_json';
export { TestPipelineActions } from './test_pipeline';
-export { DocumentsDropdown } from './documents_dropdown';
-
export { PipelineProcessorsItemTooltip, Position } from './pipeline_processors_editor_item_tooltip';
diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/manage_processor_form.container.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/manage_processor_form.container.tsx
deleted file mode 100644
index 083529921b0a7..0000000000000
--- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/manage_processor_form.container.tsx
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
- * or more contributor license agreements. Licensed under the Elastic License;
- * you may not use this file except in compliance with the Elastic License.
- */
-
-import React, { FunctionComponent, useCallback, useEffect } from 'react';
-
-import { useForm, OnFormUpdateArg, FormData, useKibana } from '../../../../../shared_imports';
-import { ProcessorInternal } from '../../types';
-
-import { ManageProcessorForm as ViewComponent } from './manage_processor_form';
-
-export type ManageProcessorFormOnSubmitArg = Omit;
-
-export type OnSubmitHandler = (processor: ManageProcessorFormOnSubmitArg) => void;
-
-export type OnFormUpdateHandler = (form: OnFormUpdateArg) => void;
-
-interface Props {
- onFormUpdate: OnFormUpdateHandler;
- onSubmit: OnSubmitHandler;
- isOnFailure: boolean;
- onOpen: () => void;
- onClose: () => void;
- processor?: ProcessorInternal;
-}
-
-export const ManageProcessorForm: FunctionComponent = ({
- processor,
- onFormUpdate,
- onSubmit,
- ...rest
-}) => {
- const { services } = useKibana();
-
- const handleSubmit = useCallback(
- async (data: FormData, isValid: boolean) => {
- if (isValid) {
- const { type, customOptions, fields } = data;
- onSubmit({
- type,
- options: customOptions ? customOptions : fields,
- });
- }
- },
- [onSubmit]
- );
-
- const maybeProcessorOptions = processor?.options;
- const { form } = useForm({
- defaultValue: { fields: maybeProcessorOptions ?? {} },
- onSubmit: handleSubmit,
- });
-
- useEffect(() => {
- const subscription = form.subscribe(onFormUpdate);
- return subscription.unsubscribe;
-
- // TODO: Address this issue
- // For some reason adding `form` object to the dependencies array here is causing an
- // infinite update loop.
- // eslint-disable-next-line react-hooks/exhaustive-deps
- }, [onFormUpdate]);
-
- return (
-
- );
-};
diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/manage_processor_form.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/manage_processor_form.tsx
deleted file mode 100644
index ee8ca71e58446..0000000000000
--- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/manage_processor_form.tsx
+++ /dev/null
@@ -1,236 +0,0 @@
-/*
- * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
- * or more contributor license agreements. Licensed under the Elastic License;
- * you may not use this file except in compliance with the Elastic License.
- */
-
-import { i18n } from '@kbn/i18n';
-import { FormattedMessage } from '@kbn/i18n/react';
-import React, { FunctionComponent, memo, useEffect, useState } from 'react';
-import {
- EuiButton,
- EuiButtonEmpty,
- EuiFlyout,
- EuiFlyoutHeader,
- EuiFlyoutBody,
- EuiFlyoutFooter,
- EuiTabs,
- EuiTab,
- EuiTitle,
- EuiFlexGroup,
- EuiFlexItem,
- EuiSpacer,
-} from '@elastic/eui';
-
-import { Form, FormDataProvider, FormHook } from '../../../../../shared_imports';
-import { ProcessorInternal } from '../../types';
-import { useTestPipelineContext } from '../../context';
-import { getProcessorDescriptor } from '../shared';
-
-import { ProcessorSettingsFields } from './processor_settings_fields';
-import { DocumentationButton } from './documentation_button';
-import { ProcessorOutput } from './processor_output';
-
-export interface Props {
- isOnFailure: boolean;
- processor?: ProcessorInternal;
- form: FormHook;
- onClose: () => void;
- onOpen: () => void;
- esDocsBasePath: string;
-}
-
-const updateButtonLabel = i18n.translate(
- 'xpack.ingestPipelines.settingsFormOnFailureFlyout.updateButtonLabel',
- { defaultMessage: 'Update' }
-);
-
-const addButtonLabel = i18n.translate(
- 'xpack.ingestPipelines.settingsFormOnFailureFlyout.addButtonLabel',
- { defaultMessage: 'Add' }
-);
-
-const cancelButtonLabel = i18n.translate(
- 'xpack.ingestPipelines.settingsFormOnFailureFlyout.cancelButtonLabel',
- { defaultMessage: 'Cancel' }
-);
-
-export type TabType = 'configuration' | 'output';
-
-interface Tab {
- id: TabType;
- name: string;
-}
-
-const tabs: Tab[] = [
- {
- id: 'configuration',
- name: i18n.translate(
- 'xpack.ingestPipelines.settingsFormOnFailureFlyout.configurationTabTitle',
- {
- defaultMessage: 'Configuration',
- }
- ),
- },
- {
- id: 'output',
- name: i18n.translate('xpack.ingestPipelines.settingsFormOnFailureFlyout.outputTabTitle', {
- defaultMessage: 'Output',
- }),
- },
-];
-
-const getFlyoutTitle = (isOnFailure: boolean, isExistingProcessor: boolean) => {
- if (isExistingProcessor) {
- return isOnFailure ? (
-
- ) : (
-
- );
- }
-
- return isOnFailure ? (
-
- ) : (
-
- );
-};
-
-export const ManageProcessorForm: FunctionComponent = memo(
- ({ processor, form, isOnFailure, onClose, onOpen, esDocsBasePath }) => {
- const { testPipelineData, setCurrentTestPipelineData } = useTestPipelineContext();
- const {
- testOutputPerProcessor,
- config: { selectedDocumentIndex, documents },
- } = testPipelineData;
-
- const processorOutput =
- processor &&
- testOutputPerProcessor &&
- testOutputPerProcessor[selectedDocumentIndex][processor.id];
-
- const updateSelectedDocument = (index: number) => {
- setCurrentTestPipelineData({
- type: 'updateActiveDocument',
- payload: {
- config: {
- selectedDocumentIndex: index,
- },
- },
- });
- };
-
- useEffect(
- () => {
- onOpen();
- },
- [] /* eslint-disable-line react-hooks/exhaustive-deps */
- );
-
- const [activeTab, setActiveTab] = useState('configuration');
-
- let flyoutContent: React.ReactNode;
-
- if (activeTab === 'output') {
- flyoutContent = (
-
- );
- } else {
- flyoutContent = ;
- }
-
- return (
-
- );
- },
- (previous, current) => {
- return previous.processor === current.processor;
- }
-);
diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processor_output.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processor_output.tsx
deleted file mode 100644
index c30fdad969b24..0000000000000
--- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processor_output.tsx
+++ /dev/null
@@ -1,217 +0,0 @@
-/*
- * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
- * or more contributor license agreements. Licensed under the Elastic License;
- * you may not use this file except in compliance with the Elastic License.
- */
-
-import React from 'react';
-import { i18n } from '@kbn/i18n';
-
-import {
- EuiAccordion,
- EuiCallOut,
- EuiCodeBlock,
- EuiText,
- EuiFlexGroup,
- EuiFlexItem,
- EuiSpacer,
-} from '@elastic/eui';
-
-import { ProcessorResult, Document } from '../../types';
-import { DocumentsDropdown } from '../documents_dropdown';
-
-export interface Props {
- processorOutput?: ProcessorResult;
- documents: Document[];
- selectedDocumentIndex: number;
- updateSelectedDocument: (index: number) => void;
-}
-
-const i18nTexts = {
- noOutputCalloutTitle: i18n.translate(
- 'xpack.ingestPipelines.processorOutput.noOutputCalloutTitle',
- {
- defaultMessage: 'Unable to load the processor output.',
- }
- ),
- tabDescription: i18n.translate('xpack.ingestPipelines.processorOutput.descriptionText', {
- defaultMessage:
- 'View how the processor affects the ingest document as it passes through the pipeline.',
- }),
- skippedCalloutTitle: i18n.translate('xpack.ingestPipelines.processorOutput.skippedCalloutTitle', {
- defaultMessage: 'The processor was not run.',
- }),
- droppedCalloutTitle: i18n.translate('xpack.ingestPipelines.processorOutput.droppedCalloutTitle', {
- defaultMessage: 'The document was dropped.',
- }),
- processorOutputLabel: i18n.translate(
- 'xpack.ingestPipelines.processorOutput.processorOutputCodeBlockLabel',
- {
- defaultMessage: 'Processor output',
- }
- ),
- processorErrorLabel: i18n.translate(
- 'xpack.ingestPipelines.processorOutput.processorErrorCodeBlockLabel',
- {
- defaultMessage: 'Processor error',
- }
- ),
- prevProcessorLabel: i18n.translate(
- 'xpack.ingestPipelines.processorOutput.previousOutputCodeBlockLabel',
- {
- defaultMessage: 'View previous processor output',
- }
- ),
- processorIgnoredErrorLabel: i18n.translate(
- 'xpack.ingestPipelines.processorOutput.ignoredErrorCodeBlockLabel',
- {
- defaultMessage: 'View ignored error',
- }
- ),
-};
-
-export const ProcessorOutput: React.FunctionComponent = ({
- processorOutput,
- documents,
- selectedDocumentIndex,
- updateSelectedDocument,
-}) => {
- // This code should not be reached,
- // but if for some reason the output is undefined, we render a callout message
- if (!processorOutput) {
- return ;
- }
-
- const {
- prevProcessorResult,
- doc: currentResult,
- ignored_error: ignoredError,
- error,
- status,
- } = processorOutput!;
-
- return (
-
-
- {i18nTexts.tabDescription}
-
-
- {/* There is no output for "skipped" status, so we render an info callout */}
- {status === 'skipped' && (
- <>
-
-
- >
- )}
-
- {/* There is no output for "dropped status", so we render a warning callout */}
- {status === 'dropped' && (
- <>
-
-
- >
- )}
-
- {currentResult && (
- <>
-
-
-
-
- {i18nTexts.processorOutputLabel}
-
-
-
-
-
-
-
-
-
- {JSON.stringify(currentResult, null, 2)}
-
- >
- )}
-
- {error && (
- <>
-
-
-
-
- {i18nTexts.processorErrorLabel}
-
-
-
-
-
-
-
-
-
- {JSON.stringify(error, null, 2)}
-
- >
- )}
-
- {prevProcessorResult?.doc && (
- <>
-
-
-
- {i18nTexts.prevProcessorLabel}
-
- }
- >
- <>
-
-
-
- {JSON.stringify(prevProcessorResult.doc, null, 2)}
-
- >
-
- >
- )}
-
- {ignoredError && (
- <>
-
-
-
- {i18nTexts.processorIgnoredErrorLabel}
-
- }
- >
- <>
-
-
-
- {JSON.stringify(ignoredError, null, 2)}
-
- >
-
- >
- )}
-
- );
-};
diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/pipeline_processors_editor_item/pipeline_processors_editor_item.scss b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/pipeline_processors_editor_item/pipeline_processors_editor_item.scss
index d9c3d84eec082..55630fa96d9b0 100644
--- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/pipeline_processors_editor_item/pipeline_processors_editor_item.scss
+++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/pipeline_processors_editor_item/pipeline_processors_editor_item.scss
@@ -63,6 +63,6 @@
&__statusContainer {
// Prevent content jump when spinner renders
- min-width: 12px;
+ min-width: 15px;
}
}
diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/pipeline_processors_editor_item_status.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/pipeline_processors_editor_item_status.tsx
index a58d482022b4d..08d456b47180c 100644
--- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/pipeline_processors_editor_item_status.tsx
+++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/pipeline_processors_editor_item_status.tsx
@@ -6,11 +6,12 @@
import React, { FunctionComponent } from 'react';
import { i18n } from '@kbn/i18n';
-import { EuiToolTip, EuiIcon } from '@elastic/eui';
+import { EuiToolTip, EuiIcon, IconType } from '@elastic/eui';
import { ProcessorStatus } from '../types';
+import { ErrorIcon, ErrorIgnoredIcon, SkippedIcon } from './shared';
interface ProcessorStatusIcon {
- icon: string;
+ icon: IconType;
iconColor: string;
label: string;
}
@@ -24,28 +25,28 @@ const processorStatusToIconMap: Record = {
}),
},
error: {
- icon: 'crossInACircleFilled',
+ icon: ErrorIcon,
iconColor: 'danger',
label: i18n.translate('xpack.ingestPipelines.pipelineEditorItem.errorStatusAriaLabel', {
defaultMessage: 'Error',
}),
},
error_ignored: {
- icon: 'alert',
- iconColor: 'warning',
+ icon: ErrorIgnoredIcon,
+ iconColor: 'danger',
label: i18n.translate('xpack.ingestPipelines.pipelineEditorItem.errorIgnoredStatusAriaLabel', {
defaultMessage: 'Error ignored',
}),
},
dropped: {
- icon: 'alert',
- iconColor: 'warning',
+ icon: 'indexClose',
+ iconColor: 'subdued',
label: i18n.translate('xpack.ingestPipelines.pipelineEditorItem.droppedStatusAriaLabel', {
defaultMessage: 'Dropped',
}),
},
skipped: {
- icon: 'dot',
+ icon: SkippedIcon,
iconColor: 'subdued',
label: i18n.translate('xpack.ingestPipelines.pipelineEditorItem.skippedStatusAriaLabel', {
defaultMessage: 'Skipped',
@@ -53,7 +54,7 @@ const processorStatusToIconMap: Record = {
},
inactive: {
icon: 'dot',
- iconColor: 'subdued',
+ iconColor: '#D3DAE6', // $euiColorLightShade
label: i18n.translate('xpack.ingestPipelines.pipelineEditorItem.inactiveStatusAriaLabel', {
defaultMessage: 'Not run',
}),
@@ -64,7 +65,7 @@ const processorStatusToIconMap: Record = {
// This is not expected and likely means we need to modify the code to support a new status
const unknownStatus = {
icon: 'dot',
- iconColor: 'subdued',
+ iconColor: '#D3DAE6', // $euiColorLightShade
label: i18n.translate('xpack.ingestPipelines.pipelineEditorItem.unknownStatusAriaLabel', {
defaultMessage: 'Unknown',
}),
diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/processor_form/add_processor_form.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/processor_form/add_processor_form.tsx
new file mode 100644
index 0000000000000..5231a3d17811b
--- /dev/null
+++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/processor_form/add_processor_form.tsx
@@ -0,0 +1,134 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License;
+ * you may not use this file except in compliance with the Elastic License.
+ */
+
+import { i18n } from '@kbn/i18n';
+import { FormattedMessage } from '@kbn/i18n/react';
+import React, { FunctionComponent, useEffect } from 'react';
+import {
+ EuiButton,
+ EuiButtonEmpty,
+ EuiFlyout,
+ EuiFlyoutHeader,
+ EuiFlyoutBody,
+ EuiFlyoutFooter,
+ EuiTitle,
+ EuiFlexGroup,
+ EuiFlexItem,
+} from '@elastic/eui';
+
+import { Form, FormDataProvider, FormHook } from '../../../../../shared_imports';
+import { getProcessorDescriptor } from '../shared';
+
+import { DocumentationButton } from './documentation_button';
+import { ProcessorSettingsFields } from './processor_settings_fields';
+
+interface Fields {
+ fields: { [key: string]: any };
+}
+export interface Props {
+ isOnFailure: boolean;
+ form: FormHook;
+ onOpen: () => void;
+ esDocsBasePath: string;
+ closeFlyout: () => void;
+ handleSubmit: (shouldCloseFlyout?: boolean) => Promise;
+}
+
+const addButtonLabel = i18n.translate(
+ 'xpack.ingestPipelines.addProcessorFormOnFailureFlyout.addButtonLabel',
+ { defaultMessage: 'Add' }
+);
+
+const cancelButtonLabel = i18n.translate(
+ 'xpack.ingestPipelines.addProcesorFormOnFailureFlyout.cancelButtonLabel',
+ { defaultMessage: 'Cancel' }
+);
+
+const getFlyoutTitle = (isOnFailure: boolean) => {
+ return isOnFailure ? (
+
+ ) : (
+
+ );
+};
+
+export const AddProcessorForm: FunctionComponent = ({
+ isOnFailure,
+ onOpen,
+ form,
+ esDocsBasePath,
+ closeFlyout,
+ handleSubmit,
+}) => {
+ useEffect(
+ () => {
+ onOpen();
+ },
+ [] /* eslint-disable-line react-hooks/exhaustive-deps */
+ );
+
+ return (
+
+ );
+};
diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/documentation_button.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/processor_form/documentation_button.tsx
similarity index 100%
rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/documentation_button.tsx
rename to x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/processor_form/documentation_button.tsx
diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/processor_form/edit_processor_form.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/processor_form/edit_processor_form.tsx
new file mode 100644
index 0000000000000..e449ed75b6343
--- /dev/null
+++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/processor_form/edit_processor_form.tsx
@@ -0,0 +1,253 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License;
+ * you may not use this file except in compliance with the Elastic License.
+ */
+
+import { i18n } from '@kbn/i18n';
+import { FormattedMessage } from '@kbn/i18n/react';
+import React, { FunctionComponent, useEffect, useState } from 'react';
+import {
+ EuiButton,
+ EuiButtonEmpty,
+ EuiFlyout,
+ EuiFlyoutHeader,
+ EuiFlyoutBody,
+ EuiFlyoutFooter,
+ EuiTabs,
+ EuiTab,
+ EuiTitle,
+ EuiFlexGroup,
+ EuiFlexItem,
+ EuiSpacer,
+} from '@elastic/eui';
+
+import { Form, FormDataProvider, FormHook } from '../../../../../shared_imports';
+import { ProcessorInternal } from '../../types';
+import { useTestPipelineContext } from '../../context';
+import { getProcessorDescriptor } from '../shared';
+
+import { ProcessorSettingsFields } from './processor_settings_fields';
+import { DocumentationButton } from './documentation_button';
+import { ProcessorOutput } from './processor_output';
+import { Fields } from './processor_form.container';
+
+export interface Props {
+ isOnFailure: boolean;
+ form: FormHook;
+ onOpen: () => void;
+ esDocsBasePath: string;
+ closeFlyout: () => void;
+ resetProcessors: () => void;
+ handleSubmit: (shouldCloseFlyout?: boolean) => Promise;
+ getProcessor: () => ProcessorInternal;
+}
+
+const updateButtonLabel = i18n.translate(
+ 'xpack.ingestPipelines.processorFormFlyout.updateButtonLabel',
+ { defaultMessage: 'Update' }
+);
+
+const cancelButtonLabel = i18n.translate(
+ 'xpack.ingestPipelines.processorFormFlyout.cancelButtonLabel',
+ { defaultMessage: 'Cancel' }
+);
+
+export type TabType = 'configuration' | 'output';
+
+interface Tab {
+ id: TabType;
+ name: string;
+}
+
+const tabs: Tab[] = [
+ {
+ id: 'configuration',
+ name: i18n.translate(
+ 'xpack.ingestPipelines.settingsFormOnFailureFlyout.configurationTabTitle',
+ {
+ defaultMessage: 'Configuration',
+ }
+ ),
+ },
+ {
+ id: 'output',
+ name: i18n.translate('xpack.ingestPipelines.settingsFormOnFailureFlyout.outputTabTitle', {
+ defaultMessage: 'Output',
+ }),
+ },
+];
+
+const getFlyoutTitle = (isOnFailure: boolean) => {
+ return isOnFailure ? (
+
+ ) : (
+
+ );
+};
+
+export const EditProcessorForm: FunctionComponent = ({
+ getProcessor,
+ form,
+ isOnFailure,
+ onOpen,
+ esDocsBasePath,
+ closeFlyout,
+ handleSubmit,
+ resetProcessors,
+}) => {
+ const { testPipelineData, setCurrentTestPipelineData } = useTestPipelineContext();
+ const {
+ testOutputPerProcessor,
+ config: { selectedDocumentIndex, documents },
+ isExecutingPipeline,
+ } = testPipelineData;
+
+ const processor = getProcessor();
+
+ const processorOutput =
+ processor &&
+ testOutputPerProcessor &&
+ testOutputPerProcessor[selectedDocumentIndex][processor.id];
+
+ const updateSelectedDocument = (index: number) => {
+ setCurrentTestPipelineData({
+ type: 'updateActiveDocument',
+ payload: {
+ config: {
+ selectedDocumentIndex: index,
+ },
+ },
+ });
+ };
+
+ useEffect(
+ () => {
+ onOpen();
+ },
+ [] /* eslint-disable-line react-hooks/exhaustive-deps */
+ );
+
+ const [activeTab, setActiveTab] = useState('configuration');
+
+ let flyoutContent: React.ReactNode;
+
+ if (activeTab === 'output') {
+ flyoutContent = (
+
+ );
+ } else {
+ flyoutContent = ;
+ }
+
+ return (
+
+ );
+};
diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/field_components/index.ts b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/processor_form/field_components/index.ts
similarity index 100%
rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/field_components/index.ts
rename to x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/processor_form/field_components/index.ts
diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/field_components/text_editor.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/processor_form/field_components/text_editor.tsx
similarity index 100%
rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/field_components/text_editor.tsx
rename to x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/processor_form/field_components/text_editor.tsx
diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/field_components/xjson_editor.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/processor_form/field_components/xjson_editor.tsx
similarity index 100%
rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/field_components/xjson_editor.tsx
rename to x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/processor_form/field_components/xjson_editor.tsx
diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/index.ts b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/processor_form/index.ts
similarity index 71%
rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/index.ts
rename to x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/processor_form/index.ts
index 986bd52e911bf..5a8d2522f1376 100644
--- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/index.ts
+++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/processor_form/index.ts
@@ -5,7 +5,7 @@
*/
export {
- ManageProcessorForm,
- ManageProcessorFormOnSubmitArg,
+ ProcessorFormContainer as ProcessorForm,
+ ProcessorFormOnSubmitArg,
OnSubmitHandler,
-} from './manage_processor_form.container';
+} from './processor_form.container';
diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/processor_form/processor_form.container.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/processor_form/processor_form.container.tsx
new file mode 100644
index 0000000000000..332908d0756f2
--- /dev/null
+++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/processor_form/processor_form.container.tsx
@@ -0,0 +1,127 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License;
+ * you may not use this file except in compliance with the Elastic License.
+ */
+
+import React, { FunctionComponent, useCallback, useEffect, useRef } from 'react';
+
+import { useForm, OnFormUpdateArg, FormData, useKibana } from '../../../../../shared_imports';
+import { ProcessorInternal } from '../../types';
+
+import { EditProcessorForm } from './edit_processor_form';
+import { AddProcessorForm } from './add_processor_form';
+
+export type ProcessorFormOnSubmitArg = Omit;
+
+export type OnSubmitHandler = (processor: ProcessorFormOnSubmitArg) => void;
+
+export type OnFormUpdateHandler = (form: OnFormUpdateArg) => void;
+
+export interface Fields {
+ fields: { [key: string]: any };
+}
+
+interface Props {
+ onFormUpdate: OnFormUpdateHandler;
+ onSubmit: OnSubmitHandler;
+ isOnFailure: boolean;
+ onOpen: () => void;
+ onClose: () => void;
+ processor?: ProcessorInternal;
+}
+
+export const ProcessorFormContainer: FunctionComponent = ({
+ processor,
+ onFormUpdate,
+ onSubmit,
+ onClose,
+ ...rest
+}) => {
+ const { services } = useKibana();
+
+ // We need to keep track of the processor form state if the user
+ // has made config changes, navigated between tabs (Configuration vs. Output)
+ // and has not yet submitted the form
+ const unsavedFormState = useRef();
+
+ const getProcessor = useCallback((): ProcessorInternal => {
+ let options;
+
+ if (unsavedFormState?.current) {
+ options = unsavedFormState.current;
+ } else {
+ options = processor?.options ?? {};
+ }
+
+ return { ...processor, options } as ProcessorInternal;
+ }, [processor, unsavedFormState]);
+
+ const { form } = useForm({
+ defaultValue: { fields: getProcessor().options },
+ });
+
+ const handleSubmit = useCallback(
+ async (shouldCloseFlyout: boolean = true) => {
+ const { isValid, data } = await form.submit();
+
+ if (isValid) {
+ const { type, customOptions, fields } = data as FormData;
+ const options = customOptions ? customOptions : fields;
+
+ unsavedFormState.current = options;
+
+ onSubmit({
+ type,
+ options,
+ });
+
+ if (shouldCloseFlyout) {
+ onClose();
+ }
+ }
+ },
+ [form, onClose, onSubmit]
+ );
+
+ const resetProcessors = useCallback(() => {
+ onSubmit({
+ type: processor!.type,
+ options: processor?.options || {},
+ });
+ }, [onSubmit, processor]);
+
+ useEffect(() => {
+ const subscription = form.subscribe(onFormUpdate);
+ return subscription.unsubscribe;
+
+ // TODO: Address this issue
+ // For some reason adding `form` object to the dependencies array here is causing an
+ // infinite update loop.
+ // eslint-disable-next-line react-hooks/exhaustive-deps
+ }, [onFormUpdate]);
+
+ if (processor) {
+ return (
+
+ );
+ } else {
+ return (
+
+ );
+ }
+};
diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/processor_form/processor_output/index.ts b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/processor_form/processor_output/index.ts
new file mode 100644
index 0000000000000..3b506fc9296e3
--- /dev/null
+++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/processor_form/processor_output/index.ts
@@ -0,0 +1,7 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License;
+ * you may not use this file except in compliance with the Elastic License.
+ */
+
+export { ProcessorOutput } from './processor_output';
diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/processor_form/processor_output/processor_output.scss b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/processor_form/processor_output/processor_output.scss
new file mode 100644
index 0000000000000..e1b5eb83584ff
--- /dev/null
+++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/processor_form/processor_output/processor_output.scss
@@ -0,0 +1,12 @@
+.processorOutput {
+ &__callOut {
+ &--customIcon {
+ .euiCallOutHeader {
+ align-items: center;
+ }
+ }
+ &__codeBlock > pre {
+ background: transparent;
+ }
+ }
+}
diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/processor_form/processor_output/processor_output.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/processor_form/processor_output/processor_output.tsx
new file mode 100644
index 0000000000000..bd0ce6ca2cd52
--- /dev/null
+++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/processor_form/processor_output/processor_output.tsx
@@ -0,0 +1,240 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License;
+ * you may not use this file except in compliance with the Elastic License.
+ */
+
+import React, { FunctionComponent } from 'react';
+import { i18n } from '@kbn/i18n';
+
+import {
+ EuiAccordion,
+ EuiCallOut,
+ EuiCodeBlock,
+ EuiText,
+ EuiSpacer,
+ EuiSelect,
+} from '@elastic/eui';
+
+import { SectionLoading } from '../../../../../../shared_imports';
+import { ProcessorResult, Document } from '../../../types';
+import { ErrorIcon, ErrorIgnoredIcon, SkippedIcon } from '../../shared';
+
+import './processor_output.scss';
+
+export interface Props {
+ processorOutput?: ProcessorResult;
+ documents: Document[];
+ selectedDocumentIndex: number;
+ updateSelectedDocument: (index: number) => void;
+ isExecuting?: boolean;
+}
+
+const i18nTexts = {
+ tabDescription: i18n.translate('xpack.ingestPipelines.processorOutput.descriptionText', {
+ defaultMessage:
+ 'View how the processor affects the ingest document as it passes through the pipeline.',
+ }),
+ skippedCalloutTitle: i18n.translate('xpack.ingestPipelines.processorOutput.skippedCalloutTitle', {
+ defaultMessage: 'The processor was not run.',
+ }),
+ droppedCalloutTitle: i18n.translate('xpack.ingestPipelines.processorOutput.droppedCalloutTitle', {
+ defaultMessage: 'The document was dropped.',
+ }),
+ noOutputCalloutTitle: i18n.translate(
+ 'xpack.ingestPipelines.processorOutput.noOutputCalloutTitle',
+ {
+ defaultMessage: 'Output is not available for this processor.',
+ }
+ ),
+ processorOutputLabel: i18n.translate(
+ 'xpack.ingestPipelines.processorOutput.processorOutputCodeBlockLabel',
+ {
+ defaultMessage: 'Data out',
+ }
+ ),
+ processorErrorTitle: i18n.translate(
+ 'xpack.ingestPipelines.processorOutput.processorErrorCodeBlockLabel',
+ {
+ defaultMessage: 'There was an error',
+ }
+ ),
+ prevProcessorLabel: i18n.translate(
+ 'xpack.ingestPipelines.processorOutput.processorInputCodeBlockLabel',
+ {
+ defaultMessage: 'Data in',
+ }
+ ),
+ processorIgnoredErrorTitle: i18n.translate(
+ 'xpack.ingestPipelines.processorOutput.ignoredErrorCodeBlockLabel',
+ {
+ defaultMessage: 'There was an error that was ignored',
+ }
+ ),
+ documentsDropdownLabel: i18n.translate(
+ 'xpack.ingestPipelines.processorOutput.documentsDropdownLabel',
+ {
+ defaultMessage: 'Test data:',
+ }
+ ),
+ loadingMessage: i18n.translate('xpack.ingestPipelines.processorOutput.loadingMessage', {
+ defaultMessage: 'Loading processor output…',
+ }),
+};
+
+export const ProcessorOutput: FunctionComponent = ({
+ processorOutput,
+ documents,
+ selectedDocumentIndex,
+ updateSelectedDocument,
+ isExecuting,
+}) => {
+ if (isExecuting) {
+ return {i18nTexts.loadingMessage} ;
+ }
+
+ if (!processorOutput) {
+ return ;
+ }
+
+ const {
+ processorInput,
+ doc: currentResult,
+ ignored_error: ignoredError,
+ error,
+ status,
+ } = processorOutput!;
+
+ const NoOutputCallOut: FunctionComponent = () => (
+
+ );
+
+ const getOutputContent = () => {
+ switch (status) {
+ case 'skipped':
+ return (
+
+ );
+ case 'dropped':
+ return ;
+ case 'success':
+ if (currentResult) {
+ return (
+
+ {JSON.stringify(currentResult, null, 2)}
+
+ );
+ }
+
+ return ;
+ case 'error':
+ return (
+
+
+ {JSON.stringify(error, null, 2)}
+
+
+ );
+ case 'error_ignored':
+ return (
+
+
+ {JSON.stringify(ignoredError, null, 2)}
+
+
+ );
+ default:
+ return ;
+ }
+ };
+
+ return (
+
+
+ {i18nTexts.tabDescription}
+
+
+
+
+ {/* Documents dropdown */}
+
({
+ value: index,
+ text: i18n.translate('xpack.ingestPipelines.processorOutput.documentLabel', {
+ defaultMessage: 'Document {number}',
+ values: {
+ number: index + 1,
+ },
+ }),
+ }))}
+ value={selectedDocumentIndex}
+ onChange={(e) => {
+ updateSelectedDocument(Number(e.target.value));
+ }}
+ aria-label={i18nTexts.documentsDropdownLabel}
+ prepend={i18nTexts.documentsDropdownLabel}
+ />
+
+
+
+ {/* Data-in accordion */}
+
+ {i18nTexts.prevProcessorLabel}
+
+ }
+ >
+ <>
+
+
+
+ {/* If there is no processorInput defined (i.e., it's the first processor), we provide the sample document */}
+ {JSON.stringify(
+ processorInput ? processorInput : documents[selectedDocumentIndex],
+ null,
+ 2
+ )}
+
+ >
+
+
+
+
+ {/* Data-out content */}
+
+ {i18nTexts.processorOutputLabel}
+
+
+
+
+ {getOutputContent()}
+
+ );
+};
diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processor_settings_fields.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/processor_form/processor_settings_fields.tsx
similarity index 100%
rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processor_settings_fields.tsx
rename to x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/processor_form/processor_settings_fields.tsx
diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/append.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/processor_form/processors/append.tsx
similarity index 100%
rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/append.tsx
rename to x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/processor_form/processors/append.tsx
diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/bytes.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/processor_form/processors/bytes.tsx
similarity index 100%
rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/bytes.tsx
rename to x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/processor_form/processors/bytes.tsx
diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/circle.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/processor_form/processors/circle.tsx
similarity index 100%
rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/circle.tsx
rename to x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/processor_form/processors/circle.tsx
diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/common_fields/common_processor_fields.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/processor_form/processors/common_fields/common_processor_fields.tsx
similarity index 100%
rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/common_fields/common_processor_fields.tsx
rename to x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/processor_form/processors/common_fields/common_processor_fields.tsx
diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/common_fields/field_name_field.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/processor_form/processors/common_fields/field_name_field.tsx
similarity index 100%
rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/common_fields/field_name_field.tsx
rename to x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/processor_form/processors/common_fields/field_name_field.tsx
diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/common_fields/ignore_missing_field.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/processor_form/processors/common_fields/ignore_missing_field.tsx
similarity index 100%
rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/common_fields/ignore_missing_field.tsx
rename to x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/processor_form/processors/common_fields/ignore_missing_field.tsx
diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/common_fields/index.ts b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/processor_form/processors/common_fields/index.ts
similarity index 100%
rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/common_fields/index.ts
rename to x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/processor_form/processors/common_fields/index.ts
diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/common_fields/processor_type_field.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/processor_form/processors/common_fields/processor_type_field.tsx
similarity index 100%
rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/common_fields/processor_type_field.tsx
rename to x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/processor_form/processors/common_fields/processor_type_field.tsx
diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/common_fields/properties_field.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/processor_form/processors/common_fields/properties_field.tsx
similarity index 100%
rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/common_fields/properties_field.tsx
rename to x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/processor_form/processors/common_fields/properties_field.tsx
diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/common_fields/target_field.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/processor_form/processors/common_fields/target_field.tsx
similarity index 100%
rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/common_fields/target_field.tsx
rename to x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/processor_form/processors/common_fields/target_field.tsx
diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/convert.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/processor_form/processors/convert.tsx
similarity index 100%
rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/convert.tsx
rename to x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/processor_form/processors/convert.tsx
diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/csv.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/processor_form/processors/csv.tsx
similarity index 100%
rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/csv.tsx
rename to x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/processor_form/processors/csv.tsx
diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/custom.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/processor_form/processors/custom.tsx
similarity index 96%
rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/custom.tsx
rename to x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/processor_form/processors/custom.tsx
index c2aab62cf8933..f49e77501f931 100644
--- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/custom.tsx
+++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/processor_form/processors/custom.tsx
@@ -17,6 +17,7 @@ import {
const { emptyField, isJsonField } = fieldValidators;
import { XJsonEditor } from '../field_components';
+import { Fields } from '../processor_form.container';
import { EDITOR_PX_HEIGHT } from './shared';
const customConfig: FieldConfig = {
@@ -60,7 +61,7 @@ const customConfig: FieldConfig = {
};
interface Props {
- defaultOptions?: any;
+ defaultOptions?: Fields['fields'];
}
/**
diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/date.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/processor_form/processors/date.tsx
similarity index 100%
rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/date.tsx
rename to x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/processor_form/processors/date.tsx
diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/date_index_name.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/processor_form/processors/date_index_name.tsx
similarity index 100%
rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/date_index_name.tsx
rename to x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/processor_form/processors/date_index_name.tsx
diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/dissect.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/processor_form/processors/dissect.tsx
similarity index 100%
rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/dissect.tsx
rename to x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/processor_form/processors/dissect.tsx
diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/dot_expander.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/processor_form/processors/dot_expander.tsx
similarity index 100%
rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/dot_expander.tsx
rename to x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/processor_form/processors/dot_expander.tsx
diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/drop.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/processor_form/processors/drop.tsx
similarity index 100%
rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/drop.tsx
rename to x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/processor_form/processors/drop.tsx
diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/enrich.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/processor_form/processors/enrich.tsx
similarity index 100%
rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/enrich.tsx
rename to x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/processor_form/processors/enrich.tsx
diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/fail.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/processor_form/processors/fail.tsx
similarity index 100%
rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/fail.tsx
rename to x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/processor_form/processors/fail.tsx
diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/foreach.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/processor_form/processors/foreach.tsx
similarity index 100%
rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/foreach.tsx
rename to x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/processor_form/processors/foreach.tsx
diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/geoip.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/processor_form/processors/geoip.tsx
similarity index 100%
rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/geoip.tsx
rename to x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/processor_form/processors/geoip.tsx
diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/grok.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/processor_form/processors/grok.tsx
similarity index 100%
rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/grok.tsx
rename to x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/processor_form/processors/grok.tsx
diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/gsub.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/processor_form/processors/gsub.tsx
similarity index 100%
rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/gsub.tsx
rename to x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/processor_form/processors/gsub.tsx
diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/html_strip.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/processor_form/processors/html_strip.tsx
similarity index 100%
rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/html_strip.tsx
rename to x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/processor_form/processors/html_strip.tsx
diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/index.ts b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/processor_form/processors/index.ts
similarity index 100%
rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/index.ts
rename to x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/processor_form/processors/index.ts
diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/inference.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/processor_form/processors/inference.tsx
similarity index 100%
rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/inference.tsx
rename to x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/processor_form/processors/inference.tsx
diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/join.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/processor_form/processors/join.tsx
similarity index 100%
rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/join.tsx
rename to x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/processor_form/processors/join.tsx
diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/json.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/processor_form/processors/json.tsx
similarity index 100%
rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/json.tsx
rename to x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/processor_form/processors/json.tsx
diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/kv.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/processor_form/processors/kv.tsx
similarity index 100%
rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/kv.tsx
rename to x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/processor_form/processors/kv.tsx
diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/lowercase.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/processor_form/processors/lowercase.tsx
similarity index 100%
rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/lowercase.tsx
rename to x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/processor_form/processors/lowercase.tsx
diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/pipeline.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/processor_form/processors/pipeline.tsx
similarity index 100%
rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/pipeline.tsx
rename to x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/processor_form/processors/pipeline.tsx
diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/remove.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/processor_form/processors/remove.tsx
similarity index 100%
rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/remove.tsx
rename to x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/processor_form/processors/remove.tsx
diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/rename.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/processor_form/processors/rename.tsx
similarity index 100%
rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/rename.tsx
rename to x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/processor_form/processors/rename.tsx
diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/script.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/processor_form/processors/script.tsx
similarity index 100%
rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/script.tsx
rename to x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/processor_form/processors/script.tsx
diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/set.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/processor_form/processors/set.tsx
similarity index 100%
rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/set.tsx
rename to x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/processor_form/processors/set.tsx
diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/set_security_user.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/processor_form/processors/set_security_user.tsx
similarity index 100%
rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/set_security_user.tsx
rename to x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/processor_form/processors/set_security_user.tsx
diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/shared.ts b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/processor_form/processors/shared.ts
similarity index 100%
rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/shared.ts
rename to x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/processor_form/processors/shared.ts
diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/sort.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/processor_form/processors/sort.tsx
similarity index 100%
rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/sort.tsx
rename to x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/processor_form/processors/sort.tsx
diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/split.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/processor_form/processors/split.tsx
similarity index 100%
rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/split.tsx
rename to x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/processor_form/processors/split.tsx
diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/trim.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/processor_form/processors/trim.tsx
similarity index 100%
rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/trim.tsx
rename to x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/processor_form/processors/trim.tsx
diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/uppercase.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/processor_form/processors/uppercase.tsx
similarity index 100%
rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/uppercase.tsx
rename to x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/processor_form/processors/uppercase.tsx
diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/url_decode.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/processor_form/processors/url_decode.tsx
similarity index 100%
rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/url_decode.tsx
rename to x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/processor_form/processors/url_decode.tsx
diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/user_agent.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/processor_form/processors/user_agent.tsx
similarity index 100%
rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/user_agent.tsx
rename to x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/processor_form/processors/user_agent.tsx
diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/shared/index.ts b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/shared/index.ts
index 1b4b975b5305e..3f258bf279e42 100644
--- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/shared/index.ts
+++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/shared/index.ts
@@ -9,3 +9,5 @@ export {
mapProcessorTypeToDescriptor,
ProcessorType,
} from './map_processor_type_to_form';
+
+export { ErrorIcon, ErrorIgnoredIcon, SkippedIcon } from './status_icons';
diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/shared/map_processor_type_to_form.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/shared/map_processor_type_to_form.tsx
index 95a8d35c119a6..8d9260f3c822c 100644
--- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/shared/map_processor_type_to_form.tsx
+++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/shared/map_processor_type_to_form.tsx
@@ -46,7 +46,7 @@ import {
UrlDecode,
UserAgent,
FormFieldsComponent,
-} from '../manage_processor_form/processors';
+} from '../processor_form/processors';
interface FieldDescriptor {
FieldsComponent?: FormFieldsComponent;
diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/shared/status_icons/error_icon.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/shared/status_icons/error_icon.tsx
new file mode 100644
index 0000000000000..58cb56d4f768d
--- /dev/null
+++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/shared/status_icons/error_icon.tsx
@@ -0,0 +1,18 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License;
+ * you may not use this file except in compliance with the Elastic License.
+ */
+
+import React, { FunctionComponent } from 'react';
+
+export const ErrorIcon: FunctionComponent = () => (
+
+
+
+);
diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/shared/status_icons/error_ignored_icon.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/shared/status_icons/error_ignored_icon.tsx
new file mode 100644
index 0000000000000..74ceda7687f02
--- /dev/null
+++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/shared/status_icons/error_ignored_icon.tsx
@@ -0,0 +1,24 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License;
+ * you may not use this file except in compliance with the Elastic License.
+ */
+
+import React, { FunctionComponent } from 'react';
+
+export const ErrorIgnoredIcon: FunctionComponent = () => (
+
+
+
+
+);
diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/shared/status_icons/index.ts b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/shared/status_icons/index.ts
new file mode 100644
index 0000000000000..9fe0871e445eb
--- /dev/null
+++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/shared/status_icons/index.ts
@@ -0,0 +1,9 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License;
+ * you may not use this file except in compliance with the Elastic License.
+ */
+
+export { ErrorIcon } from './error_icon';
+export { ErrorIgnoredIcon } from './error_ignored_icon';
+export { SkippedIcon } from './skipped_icon';
diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/shared/status_icons/skipped_icon.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/shared/status_icons/skipped_icon.tsx
new file mode 100644
index 0000000000000..c540bd3790fb0
--- /dev/null
+++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/shared/status_icons/skipped_icon.tsx
@@ -0,0 +1,18 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License;
+ * you may not use this file except in compliance with the Elastic License.
+ */
+
+import React, { FunctionComponent } from 'react';
+
+export const SkippedIcon: FunctionComponent = () => (
+
+
+
+);
diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/test_pipeline/add_documents_button.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/test_pipeline/add_documents_button.tsx
index e3ef9a9ee5390..26492454cbcf5 100644
--- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/test_pipeline/add_documents_button.tsx
+++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/test_pipeline/add_documents_button.tsx
@@ -6,6 +6,7 @@
import { i18n } from '@kbn/i18n';
import React, { FunctionComponent } from 'react';
import { EuiButtonEmpty } from '@elastic/eui';
+import { TestPipelineFlyoutTab } from './test_pipeline_flyout_tabs';
const i18nTexts = {
buttonLabel: i18n.translate('xpack.ingestPipelines.pipelineEditor.testPipeline.buttonLabel', {
@@ -14,16 +15,15 @@ const i18nTexts = {
};
interface Props {
- openTestPipelineFlyout: () => void;
+ openFlyout: (activeFlyoutTab: TestPipelineFlyoutTab) => void;
}
-export const AddDocumentsButton: FunctionComponent = ({ openTestPipelineFlyout }) => {
+export const AddDocumentsButton: FunctionComponent = ({ openFlyout }) => {
return (
openFlyout('documents')}
data-test-subj="addDocumentsButton"
- iconType="plusInCircleFilled"
>
{i18nTexts.buttonLabel}
diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/test_pipeline/documents_dropdown/documents_dropdown.scss b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/test_pipeline/documents_dropdown/documents_dropdown.scss
new file mode 100644
index 0000000000000..5deb48a2f01a7
--- /dev/null
+++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/test_pipeline/documents_dropdown/documents_dropdown.scss
@@ -0,0 +1,3 @@
+.documentsDropdownPanel {
+ min-width: 200px;
+}
diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/test_pipeline/documents_dropdown/documents_dropdown.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/test_pipeline/documents_dropdown/documents_dropdown.tsx
new file mode 100644
index 0000000000000..269a697a33c17
--- /dev/null
+++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/test_pipeline/documents_dropdown/documents_dropdown.tsx
@@ -0,0 +1,138 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License;
+ * you may not use this file except in compliance with the Elastic License.
+ */
+import { i18n } from '@kbn/i18n';
+import React, { FunctionComponent, useState } from 'react';
+import {
+ EuiButton,
+ EuiPopover,
+ EuiButtonEmpty,
+ EuiPopoverTitle,
+ EuiSelectable,
+ EuiHorizontalRule,
+ EuiFlexGroup,
+ EuiFlexItem,
+ EuiSpacer,
+} from '@elastic/eui';
+
+import { Document } from '../../../types';
+
+import { TestPipelineFlyoutTab } from '../test_pipeline_flyout_tabs';
+
+import './documents_dropdown.scss';
+
+const i18nTexts = {
+ dropdownLabel: i18n.translate(
+ 'xpack.ingestPipelines.pipelineEditor.testPipeline.documentsdropdown.dropdownLabel',
+ {
+ defaultMessage: 'Documents:',
+ }
+ ),
+ addDocumentsButtonLabel: i18n.translate(
+ 'xpack.ingestPipelines.pipelineEditor.testPipeline.documentsDropdown.buttonLabel',
+ {
+ defaultMessage: 'Add documents',
+ }
+ ),
+ popoverTitle: i18n.translate(
+ 'xpack.ingestPipelines.pipelineEditor.testPipeline.documentsDropdown.popoverTitle',
+ {
+ defaultMessage: 'Test documents',
+ }
+ ),
+};
+
+interface Props {
+ documents: Document[];
+ selectedDocumentIndex: number;
+ updateSelectedDocument: (index: number) => void;
+ openFlyout: (activeFlyoutTab: TestPipelineFlyoutTab) => void;
+}
+
+export const DocumentsDropdown: FunctionComponent = ({
+ documents,
+ selectedDocumentIndex,
+ updateSelectedDocument,
+ openFlyout,
+}) => {
+ const [showPopover, setShowPopover] = useState(false);
+
+ const managePipelineButton = (
+ setShowPopover((previousBool) => !previousBool)}
+ iconType="arrowDown"
+ iconSide="right"
+ >
+ {i18n.translate('xpack.ingestPipelines.pipelineEditor.testPipeline.selectedDocumentLabel', {
+ defaultMessage: 'Document {selectedDocument}',
+ values: {
+ selectedDocument: selectedDocumentIndex + 1,
+ },
+ })}
+
+ );
+
+ return (
+ setShowPopover(false)}
+ button={managePipelineButton}
+ panelPaddingSize="none"
+ withTitle
+ repositionOnScroll
+ data-test-subj="documentsDropdown"
+ panelClassName="documentsDropdownPanel"
+ >
+ ({
+ key: index.toString(),
+ checked: selectedDocumentIndex === index ? 'on' : undefined,
+ label: i18n.translate('xpack.ingestPipelines.pipelineEditor.testPipeline.documentLabel', {
+ defaultMessage: 'Document {documentNumber}',
+ values: {
+ documentNumber: index + 1,
+ },
+ }),
+ }))}
+ onChange={(newOptions) => {
+ const selectedOption = newOptions.find((option) => option.checked === 'on');
+ if (selectedOption) {
+ updateSelectedDocument(Number(selectedOption.key!));
+ }
+
+ setShowPopover(false);
+ }}
+ >
+ {(list, search) => (
+
+ {i18nTexts.popoverTitle}
+ {list}
+
+ )}
+
+
+
+
+
+
+ {
+ openFlyout('documents');
+ setShowPopover(false);
+ }}
+ data-test-subj="addDocumentsButton"
+ >
+ {i18nTexts.addDocumentsButtonLabel}
+
+
+
+
+
+
+ );
+};
diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/documents_dropdown/index.ts b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/test_pipeline/documents_dropdown/index.ts
similarity index 100%
rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/documents_dropdown/index.ts
rename to x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/test_pipeline/documents_dropdown/index.ts
diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/test_pipeline/test_output_button.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/test_pipeline/test_output_button.tsx
index 6fd1adad54f84..9018042229590 100644
--- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/test_pipeline/test_output_button.tsx
+++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/test_pipeline/test_output_button.tsx
@@ -5,7 +5,8 @@
*/
import { i18n } from '@kbn/i18n';
import React, { FunctionComponent } from 'react';
-import { EuiButton, EuiToolTip } from '@elastic/eui';
+import { EuiButton } from '@elastic/eui';
+import { TestPipelineFlyoutTab } from './test_pipeline_flyout_tabs';
const i18nTexts = {
buttonLabel: i18n.translate(
@@ -14,46 +15,15 @@ const i18nTexts = {
defaultMessage: 'View output',
}
),
- disabledButtonTooltipLabel: i18n.translate(
- 'xpack.ingestPipelines.pipelineEditor.testPipeline.outputButtonTooltipLabel',
- {
- defaultMessage: 'Add documents to view the output',
- }
- ),
};
interface Props {
- isDisabled: boolean;
- openTestPipelineFlyout: () => void;
+ openFlyout: (activeFlyoutTab: TestPipelineFlyoutTab) => void;
}
-export const TestOutputButton: FunctionComponent = ({
- isDisabled,
- openTestPipelineFlyout,
-}) => {
- if (isDisabled) {
- return (
- {i18nTexts.disabledButtonTooltipLabel}
}>
-
- {i18nTexts.buttonLabel}
-
-
- );
- }
-
+export const TestOutputButton: FunctionComponent = ({ openFlyout }) => {
return (
-
+ openFlyout('output')} data-test-subj="viewOutputButton">
{i18nTexts.buttonLabel}
);
diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/test_pipeline/test_pipeline_actions.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/test_pipeline/test_pipeline_actions.tsx
index eb9d9352e4b90..cec02db26729d 100644
--- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/test_pipeline/test_pipeline_actions.tsx
+++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/test_pipeline/test_pipeline_actions.tsx
@@ -4,15 +4,24 @@
* you may not use this file except in compliance with the Elastic License.
*/
import React, { FunctionComponent, useState } from 'react';
+import { i18n } from '@kbn/i18n';
+import { EuiFlexGroup, EuiFlexItem, EuiText } from '@elastic/eui';
-import { EuiFlexGroup, EuiFlexItem } from '@elastic/eui';
import { useTestPipelineContext, usePipelineProcessorsContext } from '../../context';
-
-import { DocumentsDropdown } from '../documents_dropdown';
+import { DocumentsDropdown } from './documents_dropdown';
import { TestPipelineFlyoutTab } from './test_pipeline_flyout_tabs';
import { AddDocumentsButton } from './add_documents_button';
import { TestOutputButton } from './test_output_button';
-import { TestPipelineFlyout } from './test_pipeline_flyout';
+import { TestPipelineFlyout } from './test_pipeline_flyout.container';
+
+const i18nTexts = {
+ testPipelineActionsLabel: i18n.translate(
+ 'xpack.ingestPipelines.pipelineEditor.testPipeline.testPipelineActionsLabel',
+ {
+ defaultMessage: 'Test pipeline:',
+ }
+ ),
+};
export const TestPipelineActions: FunctionComponent = () => {
const { testPipelineData, setCurrentTestPipelineData } = useTestPipelineContext();
@@ -40,35 +49,42 @@ export const TestPipelineActions: FunctionComponent = () => {
});
};
+ const openFlyout = (activeTab: TestPipelineFlyoutTab) => {
+ setOpenTestPipelineFlyout(true);
+ setActiveFlyoutTab(activeTab);
+ };
+
return (
<>
-
+
+
+
+
+ {i18nTexts.testPipelineActionsLabel}
+
+
+
+
{documents ? (
) : (
- {
- setOpenTestPipelineFlyout(true);
- setActiveFlyoutTab('documents');
- }}
- />
+
)}
-
- {
- setOpenTestPipelineFlyout(true);
- setActiveFlyoutTab('output');
- }}
- />
-
+
+ {testOutputPerProcessor && (
+
+
+
+ )}
+
{openTestPipelineFlyout && (
void;
+ processors: DeserializeResult;
+}
+
+export interface TestPipelineConfig {
+ documents: Document[];
+ verbose?: boolean;
+}
+
+export const TestPipelineFlyout: React.FunctionComponent = ({
+ onClose,
+ activeTab,
+ processors,
+}) => {
+ const { services } = useKibana();
+
+ const {
+ testPipelineData,
+ setCurrentTestPipelineData,
+ updateTestOutputPerProcessor,
+ } = useTestPipelineContext();
+
+ const {
+ config: { documents: cachedDocuments, verbose: cachedVerbose },
+ } = testPipelineData;
+
+ const { form } = useForm({
+ schema: documentsSchema,
+ defaultValue: {
+ documents: cachedDocuments || '',
+ },
+ });
+
+ const [selectedTab, setSelectedTab] = useState(activeTab);
+
+ const [isRunningTest, setIsRunningTest] = useState(false);
+ const [testingError, setTestingError] = useState(null);
+ const [testOutput, setTestOutput] = useState(undefined);
+
+ const handleTestPipeline = useCallback(
+ async (
+ { documents, verbose }: TestPipelineConfig,
+ updateProcessorOutput?: boolean
+ ): Promise<{ isSuccessful: boolean }> => {
+ const serializedProcessors = serialize({ pipeline: processors });
+
+ setIsRunningTest(true);
+ setTestingError(null);
+
+ const { error, data: currentTestOutput } = await services.api.simulatePipeline({
+ documents,
+ verbose,
+ pipeline: { ...serializedProcessors },
+ });
+
+ setIsRunningTest(false);
+
+ if (error) {
+ setTestingError(error);
+
+ // reset the per-processor output
+ // this is needed in the scenario where the pipeline has already executed,
+ // but you modified the sample documents and there was an error on re-execution
+ setCurrentTestPipelineData({
+ type: 'updateOutputPerProcessor',
+ payload: {
+ isExecutingPipeline: false,
+ testOutputPerProcessor: undefined,
+ },
+ });
+
+ return { isSuccessful: false };
+ }
+
+ setCurrentTestPipelineData({
+ type: 'updateConfig',
+ payload: {
+ config: {
+ documents,
+ verbose,
+ },
+ },
+ });
+
+ // We sometimes need to manually refresh the per-processor output
+ // e.g., when clicking the "Refresh output" button and there have been no state changes
+ if (updateProcessorOutput) {
+ updateTestOutputPerProcessor(documents, processors);
+ }
+
+ setTestOutput(currentTestOutput);
+
+ services.notifications.toasts.addSuccess(
+ i18n.translate('xpack.ingestPipelines.testPipelineFlyout.successNotificationText', {
+ defaultMessage: 'Pipeline executed',
+ }),
+ {
+ toastLifeTimeMs: 1000,
+ }
+ );
+
+ return { isSuccessful: true };
+ },
+ [
+ processors,
+ services.api,
+ services.notifications.toasts,
+ setCurrentTestPipelineData,
+ updateTestOutputPerProcessor,
+ ]
+ );
+
+ const validateAndTestPipeline = async () => {
+ const { isValid, data } = await form.submit();
+
+ if (!isValid) {
+ return;
+ }
+
+ const { documents } = data as { documents: Document[] };
+
+ const { isSuccessful } = await handleTestPipeline({
+ documents: documents!,
+ verbose: cachedVerbose,
+ });
+
+ if (isSuccessful) {
+ setSelectedTab('output');
+ }
+ };
+
+ useEffect(() => {
+ if (cachedDocuments && activeTab === 'output') {
+ handleTestPipeline({ documents: cachedDocuments, verbose: cachedVerbose }, true);
+ }
+ // We only want to know on initial mount if
+ // there are cached documents and we are on the output tab
+ // eslint-disable-next-line react-hooks/exhaustive-deps
+ }, []);
+
+ return (
+
+ );
+};
diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/test_pipeline/test_pipeline_flyout.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/test_pipeline/test_pipeline_flyout.tsx
index b26c6f536366d..46271a6bce51c 100644
--- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/test_pipeline/test_pipeline_flyout.tsx
+++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/test_pipeline/test_pipeline_flyout.tsx
@@ -4,9 +4,8 @@
* you may not use this file except in compliance with the Elastic License.
*/
-import React, { useState, useCallback, useEffect } from 'react';
+import React from 'react';
import { FormattedMessage } from '@kbn/i18n/react';
-import { i18n } from '@kbn/i18n';
import {
EuiFlyout,
@@ -17,112 +16,46 @@ import {
EuiCallOut,
} from '@elastic/eui';
-import { useKibana } from '../../../../../shared_imports';
-import { useTestPipelineContext } from '../../context';
-import { serialize } from '../../serialize';
-import { DeserializeResult } from '../../deserialize';
+import { Form, FormHook } from '../../../../../shared_imports';
import { Document } from '../../types';
import { Tabs, TestPipelineFlyoutTab, OutputTab, DocumentsTab } from './test_pipeline_flyout_tabs';
export interface Props {
- activeTab: TestPipelineFlyoutTab;
onClose: () => void;
- processors: DeserializeResult;
+ handleTestPipeline: (
+ testPipelineConfig: TestPipelineConfig,
+ refreshOutputPerProcessor?: boolean
+ ) => Promise<{ isSuccessful: boolean }>;
+ isRunningTest: boolean;
+ cachedVerbose?: boolean;
+ cachedDocuments?: Document[];
+ testOutput?: any;
+ form: FormHook;
+ validateAndTestPipeline: () => Promise;
+ selectedTab: TestPipelineFlyoutTab;
+ setSelectedTab: (selectedTa: TestPipelineFlyoutTab) => void;
+ testingError: any;
}
-export interface HandleTestPipelineArgs {
+export interface TestPipelineConfig {
documents: Document[];
verbose?: boolean;
}
export const TestPipelineFlyout: React.FunctionComponent = ({
+ handleTestPipeline,
+ isRunningTest,
+ cachedVerbose,
+ cachedDocuments,
+ testOutput,
+ form,
+ validateAndTestPipeline,
+ selectedTab,
+ setSelectedTab,
+ testingError,
onClose,
- activeTab,
- processors,
}) => {
- const { services } = useKibana();
-
- const {
- testPipelineData,
- setCurrentTestPipelineData,
- updateTestOutputPerProcessor,
- } = useTestPipelineContext();
-
- const {
- config: { documents: cachedDocuments, verbose: cachedVerbose },
- } = testPipelineData;
-
- const [selectedTab, setSelectedTab] = useState(activeTab);
-
- const [shouldTestImmediately, setShouldTestImmediately] = useState(false);
- const [isRunningTest, setIsRunningTest] = useState(false);
- const [testingError, setTestingError] = useState(null);
- const [testOutput, setTestOutput] = useState(undefined);
-
- const handleTestPipeline = useCallback(
- async ({ documents, verbose }: HandleTestPipelineArgs) => {
- const serializedProcessors = serialize({ pipeline: processors });
-
- setIsRunningTest(true);
- setTestingError(null);
-
- const { error, data: currentTestOutput } = await services.api.simulatePipeline({
- documents,
- verbose,
- pipeline: { ...serializedProcessors },
- });
-
- setIsRunningTest(false);
-
- if (error) {
- setTestingError(error);
- return;
- }
-
- setCurrentTestPipelineData({
- type: 'updateConfig',
- payload: {
- config: {
- documents,
- verbose,
- },
- },
- });
-
- setTestOutput(currentTestOutput);
-
- services.notifications.toasts.addSuccess(
- i18n.translate('xpack.ingestPipelines.testPipelineFlyout.successNotificationText', {
- defaultMessage: 'Pipeline executed',
- }),
- {
- toastLifeTimeMs: 1000,
- }
- );
-
- setSelectedTab('output');
- },
- [services.api, processors, setCurrentTestPipelineData, services.notifications.toasts]
- );
-
- useEffect(() => {
- if (cachedDocuments) {
- setShouldTestImmediately(true);
- }
- // We only want to know on initial mount if there are cached documents
- // eslint-disable-next-line react-hooks/exhaustive-deps
- }, []);
-
- useEffect(() => {
- // If the user has already tested the pipeline once,
- // use the cached test config and automatically execute the pipeline
- if (shouldTestImmediately) {
- setShouldTestImmediately(false);
- handleTestPipeline({ documents: cachedDocuments!, verbose: cachedVerbose });
- }
- }, [handleTestPipeline, cachedDocuments, cachedVerbose, shouldTestImmediately]);
-
let tabContent;
if (selectedTab === 'output') {
@@ -138,13 +71,19 @@ export const TestPipelineFlyout: React.FunctionComponent = ({
} else {
// default to "Documents" tab
tabContent = (
-
+
);
}
@@ -163,9 +102,17 @@ export const TestPipelineFlyout: React.FunctionComponent = ({
{
+ if (nextTab === 'output') {
+ // When switching to the output tab,
+ // we automatically run the pipeline if documents are defined
+ validateAndTestPipeline();
+ } else {
+ form.reset({ defaultValue: { documents: cachedDocuments! } });
+ setSelectedTab(nextTab);
+ }
+ }}
selectedTab={selectedTab}
- getIsDisabled={(tabId) => !testOutput && tabId === 'output'}
/>
diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/test_pipeline/test_pipeline_flyout_tabs/tab_documents.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/test_pipeline/test_pipeline_flyout_tabs/tab_documents.tsx
index dd12cdab0c934..b2326644340a7 100644
--- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/test_pipeline/test_pipeline_flyout_tabs/tab_documents.tsx
+++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/test_pipeline/test_pipeline_flyout_tabs/tab_documents.tsx
@@ -10,67 +10,23 @@ import { i18n } from '@kbn/i18n';
import { EuiSpacer, EuiText, EuiButton, EuiLink } from '@elastic/eui';
-import {
- getUseField,
- Field,
- JsonEditorField,
- Form,
- useForm,
- useKibana,
-} from '../../../../../../shared_imports';
-
-import { TestPipelineContext } from '../../../context';
-import { Document } from '../../../types';
-import { DeserializeResult } from '../../../deserialize';
-import { HandleTestPipelineArgs } from '../test_pipeline_flyout';
-import { documentsSchema } from './documents_schema';
+import { getUseField, Field, JsonEditorField, useKibana } from '../../../../../../shared_imports';
const UseField = getUseField({ component: Field });
interface Props {
- handleTestPipeline: (data: HandleTestPipelineArgs) => void;
- setPerProcessorOutput: (documents: Document[] | undefined, processors: DeserializeResult) => void;
+ validateAndTestPipeline: () => Promise;
isRunningTest: boolean;
- processors: DeserializeResult;
- testPipelineData: TestPipelineContext['testPipelineData'];
+ isSubmitButtonDisabled: boolean;
}
export const DocumentsTab: React.FunctionComponent = ({
- handleTestPipeline,
+ validateAndTestPipeline,
+ isSubmitButtonDisabled,
isRunningTest,
- setPerProcessorOutput,
- processors,
- testPipelineData,
}) => {
const { services } = useKibana();
- const {
- config: { documents: cachedDocuments, verbose: cachedVerbose },
- } = testPipelineData;
-
- const testPipeline = async () => {
- const { isValid, data } = await form.submit();
-
- if (!isValid) {
- return;
- }
-
- const { documents } = data as { documents: Document[] };
-
- await handleTestPipeline({ documents: documents!, verbose: cachedVerbose });
-
- // This is necessary to update the status and output of each processor
- // as verbose may not be enabled
- setPerProcessorOutput(documents, processors);
- };
-
- const { form } = useForm({
- schema: documentsSchema,
- defaultValue: {
- documents: cachedDocuments || '',
- },
- });
-
return (
@@ -100,53 +56,46 @@ export const DocumentsTab: React.FunctionComponent = ({
-
+
+ {isRunningTest ? (
+
+ ) : (
+
+ )}
+
);
};
diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/test_pipeline/test_pipeline_flyout_tabs/tab_output.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/test_pipeline/test_pipeline_flyout_tabs/tab_output.tsx
index 926bab6da993c..db6a020e307a5 100644
--- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/test_pipeline/test_pipeline_flyout_tabs/tab_output.tsx
+++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/test_pipeline/test_pipeline_flyout_tabs/tab_output.tsx
@@ -18,10 +18,13 @@ import {
} from '@elastic/eui';
import { Document } from '../../../types';
-import { HandleTestPipelineArgs } from '../test_pipeline_flyout';
+import { TestPipelineConfig } from '../test_pipeline_flyout.container';
interface Props {
- handleTestPipeline: (data: HandleTestPipelineArgs) => void;
+ handleTestPipeline: (
+ testPipelineConfig: TestPipelineConfig,
+ refreshOutputPerProcessor?: boolean
+ ) => Promise<{ isSuccessful: boolean }>;
isRunningTest: boolean;
cachedVerbose?: boolean;
cachedDocuments: Document[];
@@ -37,12 +40,6 @@ export const OutputTab: React.FunctionComponent = ({
}) => {
const [isVerboseEnabled, setIsVerboseEnabled] = useState(Boolean(cachedVerbose));
- const onEnableVerbose = (isVerbose: boolean) => {
- setIsVerboseEnabled(isVerbose);
-
- handleTestPipeline({ documents: cachedDocuments!, verbose: isVerbose });
- };
-
let content: React.ReactNode | undefined;
if (isRunningTest) {
@@ -78,15 +75,23 @@ export const OutputTab: React.FunctionComponent = ({
/>
}
checked={isVerboseEnabled}
- onChange={(e) => onEnableVerbose(e.target.checked)}
data-test-subj="verboseOutputToggle"
+ onChange={async (e) => {
+ const isVerbose = e.target.checked;
+ setIsVerboseEnabled(isVerbose);
+
+ await handleTestPipeline({ documents: cachedDocuments!, verbose: isVerbose });
+ }}
/>
- handleTestPipeline({ documents: cachedDocuments!, verbose: isVerboseEnabled })
+ onClick={async () =>
+ await handleTestPipeline(
+ { documents: cachedDocuments!, verbose: isVerboseEnabled },
+ true
+ )
}
iconType="refresh"
data-test-subj="refreshOutputButton"
diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/test_pipeline/test_pipeline_flyout_tabs/test_pipeline_tabs.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/test_pipeline/test_pipeline_flyout_tabs/test_pipeline_tabs.tsx
index abfb86c2afda1..b13fb2df90984 100644
--- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/test_pipeline/test_pipeline_flyout_tabs/test_pipeline_tabs.tsx
+++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/test_pipeline/test_pipeline_flyout_tabs/test_pipeline_tabs.tsx
@@ -13,14 +13,9 @@ export type TestPipelineFlyoutTab = 'documents' | 'output';
interface Props {
onTabChange: (tab: TestPipelineFlyoutTab) => void;
selectedTab: TestPipelineFlyoutTab;
- getIsDisabled: (tab: TestPipelineFlyoutTab) => boolean;
}
-export const Tabs: React.FunctionComponent = ({
- onTabChange,
- selectedTab,
- getIsDisabled,
-}) => {
+export const Tabs: React.FunctionComponent = ({ onTabChange, selectedTab }) => {
const tabs: Array<{
id: TestPipelineFlyoutTab;
name: React.ReactNode;
@@ -29,8 +24,8 @@ export const Tabs: React.FunctionComponent = ({
id: 'documents',
name: (
),
},
@@ -49,7 +44,6 @@ export const Tabs: React.FunctionComponent = ({
onClick={() => onTabChange(tab.id)}
isSelected={tab.id === selectedTab}
key={tab.id}
- disabled={getIsDisabled(tab.id)}
data-test-subj={tab.id.toLowerCase() + 'Tab'}
>
{tab.name}
diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/context/processors_context.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/context/processors_context.tsx
index 8c59d484acd08..6595437c01810 100644
--- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/context/processors_context.tsx
+++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/context/processors_context.tsx
@@ -38,7 +38,7 @@ import { OnActionHandler } from '../components/processors_tree';
import {
ProcessorRemoveModal,
PipelineProcessorsItemTooltip,
- ManageProcessorForm,
+ ProcessorForm,
OnSubmitHandler,
} from '../components';
@@ -159,12 +159,12 @@ export const PipelineProcessorsContextProvider: FunctionComponent = ({
selector: mode.arg.selector,
},
});
+
break;
default:
}
- setMode({ id: 'idle' });
},
- [processorsDispatch, mode, setMode]
+ [processorsDispatch, mode]
);
const onCloseSettingsForm = useCallback(() => {
@@ -208,8 +208,8 @@ export const PipelineProcessorsContextProvider: FunctionComponent = ({
};
}, [mode, setMode, processorsState, processorsDispatch]);
- // Update the test output whenever the processorsState changes (e.g., on move, update, delete)
- // Note: updateTestOutputPerProcessor() will only simulate if the user has added sample documents
+ // Make a request to the simulate API and update the processor output
+ // whenever the documents or processorsState changes (e.g., on move, update, delete)
useEffect(() => {
updateTestOutputPerProcessor(documents, processorsState);
}, [documents, processorsState, updateTestOutputPerProcessor]);
@@ -233,7 +233,7 @@ export const PipelineProcessorsContextProvider: FunctionComponent = ({
)}
{mode.id === 'managingProcessor' || mode.id === 'creatingProcessor' ? (
- {
+ const previousProcessorIndex = processorIndex - count;
+
+ if (previousProcessorIndex >= 0) {
+ const processorResult = document.processor_results[previousProcessorIndex];
+
+ if (!processorResult.doc) {
+ const newCount = count + 1;
+ return getProcessorInput(processorIndex, document, newCount);
+ }
+
+ return processorResult.doc;
+ }
+
+ return undefined;
+};
+
/**
* This function takes the verbose response of the simulate API
* and maps the results to each processor in the pipeline by the "tag" field
@@ -81,11 +114,9 @@ export const deserializeVerboseTestOutput = (
const result = { ...currentResult };
const resultId = result.tag;
+ // We skip index 0, as the first processor will not have a previous result
if (index !== 0) {
- // Add the result from the previous processor so that the user
- // can easily compare current output to the previous output
- // This may be a result from an on_failure processor
- result.prevProcessorResult = doc.processor_results[index - 1];
+ result.processorInput = getProcessorInput(index, doc);
}
// The tag is added programatically as a way to map
diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/index.ts b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/index.ts
index 71b2e2fa8f7f1..c462b19c79327 100644
--- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/index.ts
+++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/index.ts
@@ -14,9 +14,4 @@ export { OnUpdateHandlerArg, OnUpdateHandler } from './types';
export { SerializeResult } from './serialize';
-export {
- LoadFromJsonButton,
- OnDoneLoadJsonHandler,
- TestPipelineActions,
- DocumentsDropdown,
-} from './components';
+export { LoadFromJsonButton, OnDoneLoadJsonHandler, TestPipelineActions } from './components';
diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/types.ts b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/types.ts
index 5229f5eb0bb21..42201b3102c28 100644
--- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/types.ts
+++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/types.ts
@@ -94,7 +94,7 @@ export interface ProcessorResult {
tag: string;
ignored_error?: any;
error?: any;
- prevProcessorResult?: ProcessorResult;
+ processorInput?: Document;
[key: string]: any;
}
diff --git a/x-pack/plugins/lens/public/editor_frame_service/editor_frame/suggestion_panel.tsx b/x-pack/plugins/lens/public/editor_frame_service/editor_frame/suggestion_panel.tsx
index f1dc3fa306d15..e6503cb793a8e 100644
--- a/x-pack/plugins/lens/public/editor_frame_service/editor_frame/suggestion_panel.tsx
+++ b/x-pack/plugins/lens/public/editor_frame_service/editor_frame/suggestion_panel.tsx
@@ -338,7 +338,6 @@ export function SuggestionPanel({
if (lastSelectedSuggestion === index) {
rollbackToCurrentVisualization();
} else {
- trackSuggestionEvent(`position_${index}_of_${suggestions.length}`);
setLastSelectedSuggestion(index);
switchToSuggestion(dispatch, suggestion);
}
diff --git a/x-pack/plugins/lens/public/indexpattern_datasource/dimension_panel/dimension_editor.tsx b/x-pack/plugins/lens/public/indexpattern_datasource/dimension_panel/dimension_editor.tsx
index 98e9389a85819..153757ac37da1 100644
--- a/x-pack/plugins/lens/public/indexpattern_datasource/dimension_panel/dimension_editor.tsx
+++ b/x-pack/plugins/lens/public/indexpattern_datasource/dimension_panel/dimension_editor.tsx
@@ -213,9 +213,6 @@ export function DimensionEditor(props: DimensionEditorProps) {
previousColumn: selectedColumn,
});
- trackUiEvent(
- `indexpattern_dimension_operation_from_${selectedColumn.operationType}_to_${operationType}`
- );
setState(
changeColumn({
state,
diff --git a/x-pack/plugins/licensing/public/services/feature_usage_service.test.ts b/x-pack/plugins/licensing/public/services/feature_usage_service.test.ts
index eba2d1e67b509..faefb1501376d 100644
--- a/x-pack/plugins/licensing/public/services/feature_usage_service.test.ts
+++ b/x-pack/plugins/licensing/public/services/feature_usage_service.test.ts
@@ -29,6 +29,13 @@ describe('FeatureUsageService', () => {
}),
});
});
+
+ it('does not call endpoint if on anonymous path', async () => {
+ http.anonymousPaths.isAnonymous.mockReturnValue(true);
+ const setup = service.setup({ http });
+ await setup.register('my-feature', 'platinum');
+ expect(http.post).not.toHaveBeenCalled();
+ });
});
});
@@ -64,6 +71,14 @@ describe('FeatureUsageService', () => {
}),
});
});
+
+ it('does not call endpoint if on anonymous path', async () => {
+ http.anonymousPaths.isAnonymous.mockReturnValue(true);
+ service.setup({ http });
+ const start = service.start({ http });
+ await start.notifyUsage('my-feature', 42);
+ expect(http.post).not.toHaveBeenCalled();
+ });
});
});
});
diff --git a/x-pack/plugins/licensing/public/services/feature_usage_service.ts b/x-pack/plugins/licensing/public/services/feature_usage_service.ts
index 588d22eeb818d..c076bff58359f 100644
--- a/x-pack/plugins/licensing/public/services/feature_usage_service.ts
+++ b/x-pack/plugins/licensing/public/services/feature_usage_service.ts
@@ -42,6 +42,11 @@ export class FeatureUsageService {
public setup({ http }: SetupDeps): FeatureUsageServiceSetup {
return {
register: async (featureName, licenseType) => {
+ // Skip registration if on logged-out page
+ // NOTE: this only works because the login page does a full-page refresh after logging in
+ // If this is ever changed, this code will need to buffer registrations and call them after the user logs in.
+ if (http.anonymousPaths.isAnonymous(window.location.pathname)) return;
+
await http.post('/internal/licensing/feature_usage/register', {
body: JSON.stringify({
featureName,
@@ -55,6 +60,9 @@ export class FeatureUsageService {
public start({ http }: StartDeps): FeatureUsageServiceStart {
return {
notifyUsage: async (featureName, usedAt = Date.now()) => {
+ // Skip notification if on logged-out page
+ if (http.anonymousPaths.isAnonymous(window.location.pathname)) return;
+
const lastUsed = isDate(usedAt) ? usedAt.getTime() : usedAt;
await http.post('/internal/licensing/feature_usage/notify', {
body: JSON.stringify({
diff --git a/x-pack/plugins/maps/common/constants.ts b/x-pack/plugins/maps/common/constants.ts
index 3589ec41e4db3..d72d04d2a1843 100644
--- a/x-pack/plugins/maps/common/constants.ts
+++ b/x-pack/plugins/maps/common/constants.ts
@@ -263,3 +263,7 @@ export enum MB_LOOKUP_FUNCTION {
GET = 'get',
FEATURE_STATE = 'feature-state',
}
+
+export type RawValue = string | number | boolean | undefined | null;
+
+export type FieldFormatter = (value: RawValue) => string | number;
diff --git a/x-pack/plugins/maps/public/classes/sources/source.ts b/x-pack/plugins/maps/public/classes/sources/source.ts
index 4a050cc3d7d19..7e7a7bd8f049d 100644
--- a/x-pack/plugins/maps/public/classes/sources/source.ts
+++ b/x-pack/plugins/maps/public/classes/sources/source.ts
@@ -12,7 +12,7 @@ import { Adapters } from 'src/plugins/inspector/public';
import { copyPersistentState } from '../../reducers/util';
import { IField } from '../fields/field';
-import { MAX_ZOOM, MIN_ZOOM } from '../../../common/constants';
+import { FieldFormatter, MAX_ZOOM, MIN_ZOOM } from '../../../common/constants';
import { AbstractSourceDescriptor } from '../../../common/descriptor_types';
import { OnSourceChangeArgs } from '../../connected_components/layer_panel/view';
@@ -37,8 +37,6 @@ export type PreIndexedShape = {
path: string;
};
-export type FieldFormatter = (value: string | number | null | undefined | boolean) => string;
-
export interface ISource {
destroy(): void;
getDisplayName(): Promise;
diff --git a/x-pack/plugins/maps/public/classes/styles/vector/properties/dynamic_color_property.test.tsx b/x-pack/plugins/maps/public/classes/styles/vector/properties/dynamic_color_property.test.tsx
index de8f3b5c09175..c9188a0a19b0d 100644
--- a/x-pack/plugins/maps/public/classes/styles/vector/properties/dynamic_color_property.test.tsx
+++ b/x-pack/plugins/maps/public/classes/styles/vector/properties/dynamic_color_property.test.tsx
@@ -15,7 +15,7 @@ import { shallow } from 'enzyme';
import { Feature, Point } from 'geojson';
import { DynamicColorProperty } from './dynamic_color_property';
-import { COLOR_MAP_TYPE, VECTOR_STYLES } from '../../../../../common/constants';
+import { COLOR_MAP_TYPE, RawValue, VECTOR_STYLES } from '../../../../../common/constants';
import { mockField, MockLayer, MockStyle } from './__tests__/test_util';
import { ColorDynamicOptions } from '../../../../../common/descriptor_types';
import { IVectorLayer } from '../../../layers/vector_layer/vector_layer';
@@ -28,7 +28,7 @@ const makeProperty = (options: ColorDynamicOptions, style?: MockStyle, field?: I
field ? field : mockField,
(new MockLayer(style ? style : new MockStyle()) as unknown) as IVectorLayer,
() => {
- return (value: string | number | undefined) => value + '_format';
+ return (value: RawValue) => value + '_format';
}
);
};
@@ -273,7 +273,7 @@ describe('supportsFieldMeta', () => {
null,
(new MockLayer(new MockStyle()) as unknown) as IVectorLayer,
() => {
- return (value: string | number | undefined) => value + '_format';
+ return (value: RawValue) => value + '_format';
}
);
diff --git a/x-pack/plugins/maps/public/classes/styles/vector/properties/dynamic_icon_property.test.tsx b/x-pack/plugins/maps/public/classes/styles/vector/properties/dynamic_icon_property.test.tsx
index 06987ab8bcc48..2f9e4709c1c0b 100644
--- a/x-pack/plugins/maps/public/classes/styles/vector/properties/dynamic_icon_property.test.tsx
+++ b/x-pack/plugins/maps/public/classes/styles/vector/properties/dynamic_icon_property.test.tsx
@@ -13,7 +13,7 @@ jest.mock('../components/vector_style_editor', () => ({
}));
import React from 'react';
-import { VECTOR_STYLES } from '../../../../../common/constants';
+import { RawValue, VECTOR_STYLES } from '../../../../../common/constants';
// @ts-ignore
import { DynamicIconProperty } from './dynamic_icon_property';
import { mockField, MockLayer } from './__tests__/test_util';
@@ -33,7 +33,7 @@ const makeProperty = (options: Partial, field: IField = mock
field,
mockVectorLayer,
() => {
- return (value: string | number | undefined) => value + '_format';
+ return (value: RawValue) => value + '_format';
}
);
};
diff --git a/x-pack/plugins/maps/public/classes/styles/vector/properties/dynamic_orientation_property.ts b/x-pack/plugins/maps/public/classes/styles/vector/properties/dynamic_orientation_property.ts
index dd976027a50f2..192fa1f4db6e0 100644
--- a/x-pack/plugins/maps/public/classes/styles/vector/properties/dynamic_orientation_property.ts
+++ b/x-pack/plugins/maps/public/classes/styles/vector/properties/dynamic_orientation_property.ts
@@ -5,25 +5,29 @@
*/
import { Map as MbMap } from 'mapbox-gl';
-import { DynamicStyleProperty } from './dynamic_style_property';
-import { getComputedFieldName } from '../style_util';
-import { VECTOR_STYLES } from '../../../../../common/constants';
+import { DynamicStyleProperty, getNumericalMbFeatureStateValue } from './dynamic_style_property';
import { OrientationDynamicOptions } from '../../../../../common/descriptor_types';
+import { RawValue } from '../../../../../common/constants';
export class DynamicOrientationProperty extends DynamicStyleProperty {
syncIconRotationWithMb(symbolLayerId: string, mbMap: MbMap) {
if (this._field && this._field.isValid()) {
- const targetName = this._field.supportsAutoDomain()
- ? getComputedFieldName(VECTOR_STYLES.ICON_ORIENTATION, this.getFieldName())
- : this._field.getName();
- // Using property state instead of feature-state because layout properties do not support feature-state
- mbMap.setLayoutProperty(symbolLayerId, 'icon-rotate', ['coalesce', ['get', targetName], 0]);
+ const targetName = this.getMbPropertyName();
+ mbMap.setLayoutProperty(symbolLayerId, 'icon-rotate', [
+ 'coalesce',
+ [this.getMbLookupFunction(), targetName],
+ 0,
+ ]);
} else {
mbMap.setLayoutProperty(symbolLayerId, 'icon-rotate', 0);
}
}
- supportsMbFeatureState() {
+ supportsMbFeatureState(): boolean {
return false;
}
+
+ getMbPropertyValue(rawValue: RawValue): RawValue {
+ return getNumericalMbFeatureStateValue(rawValue);
+ }
}
diff --git a/x-pack/plugins/maps/public/classes/styles/vector/properties/dynamic_size_property.test.tsx b/x-pack/plugins/maps/public/classes/styles/vector/properties/dynamic_size_property.test.tsx
index c5298067f6cbe..b4244cf7829c4 100644
--- a/x-pack/plugins/maps/public/classes/styles/vector/properties/dynamic_size_property.test.tsx
+++ b/x-pack/plugins/maps/public/classes/styles/vector/properties/dynamic_size_property.test.tsx
@@ -15,7 +15,7 @@ import { shallow } from 'enzyme';
// @ts-ignore
import { DynamicSizeProperty } from './dynamic_size_property';
-import { VECTOR_STYLES } from '../../../../../common/constants';
+import { RawValue, VECTOR_STYLES } from '../../../../../common/constants';
import { IField } from '../../../fields/field';
import { Map as MbMap } from 'mapbox-gl';
import { SizeDynamicOptions } from '../../../../../common/descriptor_types';
@@ -48,7 +48,7 @@ const makeProperty = (
field,
(new MockLayer(mockStyle) as unknown) as IVectorLayer,
() => {
- return (value: string | number | undefined) => value + '_format';
+ return (value: RawValue) => value + '_format';
},
false
);
diff --git a/x-pack/plugins/maps/public/classes/styles/vector/properties/dynamic_size_property.tsx b/x-pack/plugins/maps/public/classes/styles/vector/properties/dynamic_size_property.tsx
index 35c830f3cb5e3..4e75a61539ad9 100644
--- a/x-pack/plugins/maps/public/classes/styles/vector/properties/dynamic_size_property.tsx
+++ b/x-pack/plugins/maps/public/classes/styles/vector/properties/dynamic_size_property.tsx
@@ -7,7 +7,7 @@
import _ from 'lodash';
import React from 'react';
import { Map as MbMap } from 'mapbox-gl';
-import { DynamicStyleProperty, FieldFormatter } from './dynamic_style_property';
+import { DynamicStyleProperty } from './dynamic_style_property';
import { OrdinalLegend } from '../components/legend/ordinal_legend';
import { makeMbClampedNumberExpression } from '../style_util';
import {
@@ -16,7 +16,7 @@ import {
SMALL_MAKI_ICON_SIZE,
// @ts-expect-error
} from '../symbol_utils';
-import { MB_LOOKUP_FUNCTION, VECTOR_STYLES } from '../../../../../common/constants';
+import { FieldFormatter, MB_LOOKUP_FUNCTION, VECTOR_STYLES } from '../../../../../common/constants';
import { SizeDynamicOptions } from '../../../../../common/descriptor_types';
import { IField } from '../../../fields/field';
import { IVectorLayer } from '../../../layers/vector_layer/vector_layer';
diff --git a/x-pack/plugins/maps/public/classes/styles/vector/properties/dynamic_style_property.tsx b/x-pack/plugins/maps/public/classes/styles/vector/properties/dynamic_style_property.tsx
index f6ab052497723..2bc819daeea90 100644
--- a/x-pack/plugins/maps/public/classes/styles/vector/properties/dynamic_style_property.tsx
+++ b/x-pack/plugins/maps/public/classes/styles/vector/properties/dynamic_style_property.tsx
@@ -15,6 +15,8 @@ import {
SOURCE_META_DATA_REQUEST_ID,
STYLE_TYPE,
VECTOR_STYLES,
+ RawValue,
+ FieldFormatter,
} from '../../../../../common/constants';
import { OrdinalFieldMetaPopover } from '../components/field_meta/ordinal_field_meta_popover';
import { CategoricalFieldMetaPopover } from '../components/field_meta/categorical_field_meta_popover';
@@ -28,6 +30,7 @@ import { IField } from '../../../fields/field';
import { IVectorLayer } from '../../../layers/vector_layer/vector_layer';
import { IJoin } from '../../../joins/join';
import { IVectorStyle } from '../vector_style';
+import { getComputedFieldName } from '../style_util';
export interface IDynamicStyleProperty extends IStyleProperty {
getFieldMetaOptions(): FieldMetaOptions;
@@ -46,9 +49,16 @@ export interface IDynamicStyleProperty extends IStyleProperty {
pluckOrdinalStyleMetaFromFeatures(features: Feature[]): RangeFieldMeta | null;
pluckCategoricalStyleMetaFromFeatures(features: Feature[]): CategoryFieldMeta | null;
getValueSuggestions(query: string): Promise;
-}
-export type FieldFormatter = (value: string | number | undefined) => string | number;
+ // Returns the name that should be used for accessing the data from the mb-style rule
+ // Depending on
+ // - whether the field is used for labeling, icon-orientation, or other properties (color, size, ...), `feature-state` and or `get` is used
+ // - whether the field was run through a field-formatter, a new dynamic field is created with the formatted-value
+ // The combination of both will inform what field-name (e.g. the "raw" field name from the properties, the "computed field-name" for an on-the-fly created property (e.g. for feature-state or field-formatting).
+ // todo: There is an existing limitation to .mvt backed sources, where the field-formatters are not applied. Here, the raw-data needs to be accessed.
+ getMbPropertyName(): string;
+ getMbPropertyValue(value: RawValue): RawValue;
+}
export class DynamicStyleProperty
extends AbstractStyleProperty
@@ -313,7 +323,7 @@ export class DynamicStyleProperty
};
}
- formatField(value: string | number | undefined): string | number {
+ formatField(value: RawValue): string | number {
if (this.getField()) {
const fieldName = this.getFieldName();
const fieldFormatter = this._getFieldFormatter(fieldName);
@@ -345,4 +355,43 @@ export class DynamicStyleProperty
/>
);
}
+
+ getMbPropertyName() {
+ if (!this._field) {
+ return '';
+ }
+
+ let targetName;
+ if (this.supportsMbFeatureState()) {
+ // Base case for any properties that can support feature-state (e.g. color, size, ...)
+ // They just re-use the original property-name
+ targetName = this._field.getName();
+ } else {
+ if (this._field.canReadFromGeoJson() && this._field.supportsAutoDomain()) {
+ // Geojson-sources can support rewrite
+ // e.g. field-formatters will create duplicate field
+ targetName = getComputedFieldName(this.getStyleName(), this._field.getName());
+ } else {
+ // Non-geojson sources (e.g. 3rd party mvt or ES-source as mvt)
+ targetName = this._field.getName();
+ }
+ }
+ return targetName;
+ }
+
+ getMbPropertyValue(rawValue: RawValue): RawValue {
+ // Maps only uses feature-state for numerical values.
+ // `supportsMbFeatureState` will only return true when the mb-style rule does a feature-state lookup on a numerical value
+ // Calling `isOrdinal` would be equivalent.
+ return this.supportsMbFeatureState() ? getNumericalMbFeatureStateValue(rawValue) : rawValue;
+ }
+}
+
+export function getNumericalMbFeatureStateValue(value: RawValue) {
+ if (typeof value !== 'string') {
+ return value;
+ }
+
+ const valueAsFloat = parseFloat(value);
+ return isNaN(valueAsFloat) ? null : valueAsFloat;
}
diff --git a/x-pack/plugins/maps/public/classes/styles/vector/properties/dynamic_text_property.ts b/x-pack/plugins/maps/public/classes/styles/vector/properties/dynamic_text_property.ts
index d55a6e1cfb444..ec79d71eb7587 100644
--- a/x-pack/plugins/maps/public/classes/styles/vector/properties/dynamic_text_property.ts
+++ b/x-pack/plugins/maps/public/classes/styles/vector/properties/dynamic_text_property.ts
@@ -6,18 +6,18 @@
import { Map as MbMap } from 'mapbox-gl';
import { DynamicStyleProperty } from './dynamic_style_property';
-import { getComputedFieldName } from '../style_util';
import { LabelDynamicOptions } from '../../../../../common/descriptor_types';
+import { RawValue } from '../../../../../common/constants';
export class DynamicTextProperty extends DynamicStyleProperty {
syncTextFieldWithMb(mbLayerId: string, mbMap: MbMap) {
if (this._field && this._field.isValid()) {
- // Fields that support auto-domain are normalized with a field-formatter and stored into a computed-field
- // Otherwise, the raw value is just carried over and no computed field is created.
- const targetName = this._field.supportsAutoDomain()
- ? getComputedFieldName(this._styleName, this.getFieldName())
- : this._field.getName();
- mbMap.setLayoutProperty(mbLayerId, 'text-field', ['coalesce', ['get', targetName], '']);
+ const targetName = this.getMbPropertyName();
+ mbMap.setLayoutProperty(mbLayerId, 'text-field', [
+ 'coalesce',
+ [this.getMbLookupFunction(), targetName],
+ '',
+ ]);
} else {
mbMap.setLayoutProperty(mbLayerId, 'text-field', null);
}
@@ -34,4 +34,8 @@ export class DynamicTextProperty extends DynamicStyleProperty {
isDynamic(): boolean;
isComplete(): boolean;
- formatField(value: string | number | undefined): string | number;
+ formatField(value: RawValue): string | number;
getStyleName(): VECTOR_STYLES;
getOptions(): T;
renderLegendDetailRow(legendProps: LegendProps): ReactElement | null;
@@ -53,9 +53,14 @@ export class AbstractStyleProperty implements IStyleProperty {
return true;
}
- formatField(value: string | number | undefined): string | number {
- // eslint-disable-next-line eqeqeq
- return value == undefined ? '' : value;
+ formatField(value: RawValue): string | number {
+ if (typeof value === 'undefined' || value === null) {
+ return '';
+ } else if (typeof value === 'boolean') {
+ return value.toString();
+ } else {
+ return value;
+ }
}
getStyleName(): VECTOR_STYLES {
diff --git a/x-pack/plugins/maps/public/classes/styles/vector/vector_style.tsx b/x-pack/plugins/maps/public/classes/styles/vector/vector_style.tsx
index 956522524a2eb..1244c53afe9a6 100644
--- a/x-pack/plugins/maps/public/classes/styles/vector/vector_style.tsx
+++ b/x-pack/plugins/maps/public/classes/styles/vector/vector_style.tsx
@@ -29,7 +29,7 @@ import {
import { StyleMeta } from './style_meta';
import { VectorIcon } from './components/legend/vector_icon';
import { VectorStyleLegend } from './components/legend/vector_style_legend';
-import { getComputedFieldName, isOnlySingleFeatureType } from './style_util';
+import { isOnlySingleFeatureType } from './style_util';
import { StaticStyleProperty } from './properties/static_style_property';
import { DynamicStyleProperty } from './properties/dynamic_style_property';
import { DynamicSizeProperty } from './properties/dynamic_size_property';
@@ -82,11 +82,6 @@ const POINTS = [GEO_JSON_TYPE.POINT, GEO_JSON_TYPE.MULTI_POINT];
const LINES = [GEO_JSON_TYPE.LINE_STRING, GEO_JSON_TYPE.MULTI_LINE_STRING];
const POLYGONS = [GEO_JSON_TYPE.POLYGON, GEO_JSON_TYPE.MULTI_POLYGON];
-function getNumericalMbFeatureStateValue(value: string) {
- const valueAsFloat = parseFloat(value);
- return isNaN(valueAsFloat) ? null : valueAsFloat;
-}
-
export interface IVectorStyle extends IStyle {
getAllStyleProperties(): Array>;
getDynamicPropertiesArray(): Array>;
@@ -618,21 +613,17 @@ export class VectorStyle implements IVectorStyle {
for (let j = 0; j < dynamicStyleProps.length; j++) {
const dynamicStyleProp = dynamicStyleProps[j];
- const name = dynamicStyleProp.getFieldName();
- const computedName = getComputedFieldName(dynamicStyleProp.getStyleName(), name);
- const rawValue = feature.properties ? feature.properties[name] : undefined;
+ const targetMbName = dynamicStyleProp.getMbPropertyName();
+ const rawValue = feature.properties
+ ? feature.properties[dynamicStyleProp.getFieldName()]
+ : undefined;
+ const targetMbValue = dynamicStyleProp.getMbPropertyValue(rawValue);
if (dynamicStyleProp.supportsMbFeatureState()) {
- tmpFeatureState[name] = getNumericalMbFeatureStateValue(rawValue); // the same value will be potentially overridden multiple times, if the name remains identical
+ tmpFeatureState[targetMbName] = targetMbValue; // the same value will be potentially overridden multiple times, if the name remains identical
} else {
- // in practice, a new system property will only be created for:
- // - label text: this requires the value to be formatted first.
- // - icon orientation: this is a lay-out property which do not support feature-state (but we're still coercing to a number)
-
- const formattedValue = dynamicStyleProp.isOrdinal()
- ? getNumericalMbFeatureStateValue(rawValue)
- : dynamicStyleProp.formatField(rawValue);
-
- if (feature.properties) feature.properties[computedName] = formattedValue;
+ if (feature.properties) {
+ feature.properties[targetMbName] = targetMbValue;
+ }
}
}
tmpFeatureIdentifier.source = mbSourceId;
diff --git a/x-pack/plugins/ml/public/application/datavisualizer/file_based/components/fields_stats/field_stats_card.js b/x-pack/plugins/ml/public/application/datavisualizer/file_based/components/fields_stats/field_stats_card.js
index 988fb653dd1ad..e68d73fc6acfa 100644
--- a/x-pack/plugins/ml/public/application/datavisualizer/file_based/components/fields_stats/field_stats_card.js
+++ b/x-pack/plugins/ml/public/application/datavisualizer/file_based/components/fields_stats/field_stats_card.js
@@ -26,7 +26,7 @@ export function FieldStatsCard({ field }) {
return (
-
+
diff --git a/x-pack/plugins/ml/public/application/datavisualizer/file_based/components/fields_stats/fields_stats.js b/x-pack/plugins/ml/public/application/datavisualizer/file_based/components/fields_stats/fields_stats.js
index 9e83f72d7a07b..785dd7db260fc 100644
--- a/x-pack/plugins/ml/public/application/datavisualizer/file_based/components/fields_stats/fields_stats.js
+++ b/x-pack/plugins/ml/public/application/datavisualizer/file_based/components/fields_stats/fields_stats.js
@@ -50,14 +50,14 @@ function createFields(results) {
timestamp_field: timestampField,
} = results;
- if (mappings && fieldStats) {
+ if (mappings && mappings.properties && fieldStats) {
const fieldNames = getFieldNames(results);
return fieldNames.map((name) => {
if (fieldStats[name] !== undefined) {
const field = { name };
const f = fieldStats[name];
- const m = mappings[name];
+ const m = mappings.properties[name];
// sometimes the timestamp field is not in the mappings, and so our
// collection of fields will be missing a time field with a type of date
@@ -93,7 +93,7 @@ function createFields(results) {
// this could be the message field for a semi-structured log file or a
// field which the endpoint has not been able to work out any information for
const type =
- mappings[name] && mappings[name].type === ML_JOB_FIELD_TYPES.TEXT
+ mappings.properties[name] && mappings.properties[name].type === ML_JOB_FIELD_TYPES.TEXT
? ML_JOB_FIELD_TYPES.TEXT
: ML_JOB_FIELD_TYPES.UNKNOWN;
diff --git a/x-pack/plugins/ml/public/application/datavisualizer/file_based/components/fields_stats/get_field_names.js b/x-pack/plugins/ml/public/application/datavisualizer/file_based/components/fields_stats/get_field_names.js
index 28764bbbd246d..c423dc3c63e39 100644
--- a/x-pack/plugins/ml/public/application/datavisualizer/file_based/components/fields_stats/get_field_names.js
+++ b/x-pack/plugins/ml/public/application/datavisualizer/file_based/components/fields_stats/get_field_names.js
@@ -16,7 +16,7 @@ export function getFieldNames(results) {
// there may be fields in the mappings which do not exist in the field_stats
// e.g. the message field for a semi-structured log file, as they have no stats.
// add any extra fields to the list
- const differenceFields = difference(Object.keys(mappings), tempFields);
+ const differenceFields = difference(Object.keys(mappings.properties), tempFields);
// except @timestamp
const timestampIndex = differenceFields.indexOf('@timestamp');
diff --git a/x-pack/plugins/monitoring/server/config.test.ts b/x-pack/plugins/monitoring/server/config.test.ts
index 2efc325a3edec..f4ccb3f830af1 100644
--- a/x-pack/plugins/monitoring/server/config.test.ts
+++ b/x-pack/plugins/monitoring/server/config.test.ts
@@ -3,14 +3,22 @@
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/
+
+import fs from 'fs';
+import { when } from 'jest-when';
+
import { createConfig, configSchema } from './config';
-jest.mock('fs', () => {
- const original = jest.requireActual('fs');
- return {
- ...original,
- readFileSync: jest.fn().mockImplementation((path: string) => `contents-of-${path}`),
- };
+const MOCKED_PATHS = [
+ '/proc/self/cgroup',
+ 'packages/kbn-dev-utils/certs/ca.crt',
+ 'packages/kbn-dev-utils/certs/elasticsearch.crt',
+ 'packages/kbn-dev-utils/certs/elasticsearch.key',
+];
+
+beforeEach(() => {
+ const spy = jest.spyOn(fs, 'readFileSync').mockImplementation();
+ MOCKED_PATHS.forEach((file) => when(spy).calledWith(file).mockReturnValue(`contents-of-${file}`));
});
describe('config schema', () => {
diff --git a/x-pack/plugins/security/server/authentication/providers/base.ts b/x-pack/plugins/security/server/authentication/providers/base.ts
index 631721b032752..7b2ad510db968 100644
--- a/x-pack/plugins/security/server/authentication/providers/base.ts
+++ b/x-pack/plugins/security/server/authentication/providers/base.ts
@@ -4,6 +4,7 @@
* you may not use this file except in compliance with the Elastic License.
*/
+import { deepFreeze } from '@kbn/std';
import {
KibanaRequest,
Logger,
@@ -11,7 +12,6 @@ import {
ILegacyClusterClient,
Headers,
} from '../../../../../../src/core/server';
-import { deepFreeze } from '../../../../../../src/core/server';
import { AuthenticatedUser } from '../../../common/model';
import { AuthenticationResult } from '../authentication_result';
import { DeauthenticationResult } from '../deauthentication_result';
diff --git a/x-pack/plugins/security/server/plugin.ts b/x-pack/plugins/security/server/plugin.ts
index dc9139473004b..69b55fcb3d0a4 100644
--- a/x-pack/plugins/security/server/plugin.ts
+++ b/x-pack/plugins/security/server/plugin.ts
@@ -7,9 +7,9 @@
import { combineLatest } from 'rxjs';
import { first, map } from 'rxjs/operators';
import { TypeOf } from '@kbn/config-schema';
+import { deepFreeze } from '@kbn/std';
import { UsageCollectionSetup } from 'src/plugins/usage_collection/server';
import {
- deepFreeze,
CoreSetup,
CoreStart,
Logger,
diff --git a/x-pack/plugins/security_solution/common/detection_engine/schemas/common/schemas.ts b/x-pack/plugins/security_solution/common/detection_engine/schemas/common/schemas.ts
index 498b561a818f2..f002e13a07cf1 100644
--- a/x-pack/plugins/security_solution/common/detection_engine/schemas/common/schemas.ts
+++ b/x-pack/plugins/security_solution/common/detection_engine/schemas/common/schemas.ts
@@ -130,7 +130,7 @@ export type Query = t.TypeOf
;
export const queryOrUndefined = t.union([query, t.undefined]);
export type QueryOrUndefined = t.TypeOf;
-export const language = t.keyof({ kuery: null, lucene: null });
+export const language = t.keyof({ eql: null, kuery: null, lucene: null });
export type Language = t.TypeOf;
export const languageOrUndefined = t.union([language, t.undefined]);
@@ -294,6 +294,7 @@ export const toOrUndefined = t.union([to, t.undefined]);
export type ToOrUndefined = t.TypeOf;
export const type = t.keyof({
+ eql: null,
machine_learning: null,
query: null,
saved_query: null,
diff --git a/x-pack/plugins/security_solution/common/detection_engine/schemas/request/add_prepackaged_rules_type_dependents.ts b/x-pack/plugins/security_solution/common/detection_engine/schemas/request/add_prepackaged_rules_type_dependents.ts
index 6a51f724fc9e6..c244b9aca9ad0 100644
--- a/x-pack/plugins/security_solution/common/detection_engine/schemas/request/add_prepackaged_rules_type_dependents.ts
+++ b/x-pack/plugins/security_solution/common/detection_engine/schemas/request/add_prepackaged_rules_type_dependents.ts
@@ -4,10 +4,12 @@
* you may not use this file except in compliance with the Elastic License.
*/
+import { isMlRule } from '../../../machine_learning/helpers';
+import { isThresholdRule } from '../../utils';
import { AddPrepackagedRulesSchema } from './add_prepackaged_rules_schema';
export const validateAnomalyThreshold = (rule: AddPrepackagedRulesSchema): string[] => {
- if (rule.type === 'machine_learning') {
+ if (isMlRule(rule.type)) {
if (rule.anomaly_threshold == null) {
return ['when "type" is "machine_learning" anomaly_threshold is required'];
} else {
@@ -19,7 +21,7 @@ export const validateAnomalyThreshold = (rule: AddPrepackagedRulesSchema): strin
};
export const validateQuery = (rule: AddPrepackagedRulesSchema): string[] => {
- if (rule.type === 'machine_learning') {
+ if (isMlRule(rule.type)) {
if (rule.query != null) {
return ['when "type" is "machine_learning", "query" cannot be set'];
} else {
@@ -31,7 +33,7 @@ export const validateQuery = (rule: AddPrepackagedRulesSchema): string[] => {
};
export const validateLanguage = (rule: AddPrepackagedRulesSchema): string[] => {
- if (rule.type === 'machine_learning') {
+ if (isMlRule(rule.type)) {
if (rule.language != null) {
return ['when "type" is "machine_learning", "language" cannot be set'];
} else {
@@ -55,7 +57,7 @@ export const validateSavedId = (rule: AddPrepackagedRulesSchema): string[] => {
};
export const validateMachineLearningJobId = (rule: AddPrepackagedRulesSchema): string[] => {
- if (rule.type === 'machine_learning') {
+ if (isMlRule(rule.type)) {
if (rule.machine_learning_job_id == null) {
return ['when "type" is "machine_learning", "machine_learning_job_id" is required'];
} else {
@@ -93,7 +95,7 @@ export const validateTimelineTitle = (rule: AddPrepackagedRulesSchema): string[]
};
export const validateThreshold = (rule: AddPrepackagedRulesSchema): string[] => {
- if (rule.type === 'threshold') {
+ if (isThresholdRule(rule.type)) {
if (!rule.threshold) {
return ['when "type" is "threshold", "threshold" is required'];
} else if (rule.threshold.value <= 0) {
diff --git a/x-pack/plugins/security_solution/common/detection_engine/schemas/request/create_rules_type_dependents.ts b/x-pack/plugins/security_solution/common/detection_engine/schemas/request/create_rules_type_dependents.ts
index af665ff8c81d2..91b14fa9b999c 100644
--- a/x-pack/plugins/security_solution/common/detection_engine/schemas/request/create_rules_type_dependents.ts
+++ b/x-pack/plugins/security_solution/common/detection_engine/schemas/request/create_rules_type_dependents.ts
@@ -4,10 +4,12 @@
* you may not use this file except in compliance with the Elastic License.
*/
+import { isMlRule } from '../../../machine_learning/helpers';
+import { isThresholdRule } from '../../utils';
import { CreateRulesSchema } from './create_rules_schema';
export const validateAnomalyThreshold = (rule: CreateRulesSchema): string[] => {
- if (rule.type === 'machine_learning') {
+ if (isMlRule(rule.type)) {
if (rule.anomaly_threshold == null) {
return ['when "type" is "machine_learning" anomaly_threshold is required'];
} else {
@@ -19,7 +21,7 @@ export const validateAnomalyThreshold = (rule: CreateRulesSchema): string[] => {
};
export const validateQuery = (rule: CreateRulesSchema): string[] => {
- if (rule.type === 'machine_learning') {
+ if (isMlRule(rule.type)) {
if (rule.query != null) {
return ['when "type" is "machine_learning", "query" cannot be set'];
} else {
@@ -31,7 +33,7 @@ export const validateQuery = (rule: CreateRulesSchema): string[] => {
};
export const validateLanguage = (rule: CreateRulesSchema): string[] => {
- if (rule.type === 'machine_learning') {
+ if (isMlRule(rule.type)) {
if (rule.language != null) {
return ['when "type" is "machine_learning", "language" cannot be set'];
} else {
@@ -55,7 +57,7 @@ export const validateSavedId = (rule: CreateRulesSchema): string[] => {
};
export const validateMachineLearningJobId = (rule: CreateRulesSchema): string[] => {
- if (rule.type === 'machine_learning') {
+ if (isMlRule(rule.type)) {
if (rule.machine_learning_job_id == null) {
return ['when "type" is "machine_learning", "machine_learning_job_id" is required'];
} else {
@@ -93,7 +95,7 @@ export const validateTimelineTitle = (rule: CreateRulesSchema): string[] => {
};
export const validateThreshold = (rule: CreateRulesSchema): string[] => {
- if (rule.type === 'threshold') {
+ if (isThresholdRule(rule.type)) {
if (!rule.threshold) {
return ['when "type" is "threshold", "threshold" is required'];
} else if (rule.threshold.value <= 0) {
diff --git a/x-pack/plugins/security_solution/common/detection_engine/schemas/request/import_rules_type_dependents.ts b/x-pack/plugins/security_solution/common/detection_engine/schemas/request/import_rules_type_dependents.ts
index 269181449e9e9..87264d84fd73a 100644
--- a/x-pack/plugins/security_solution/common/detection_engine/schemas/request/import_rules_type_dependents.ts
+++ b/x-pack/plugins/security_solution/common/detection_engine/schemas/request/import_rules_type_dependents.ts
@@ -4,10 +4,12 @@
* you may not use this file except in compliance with the Elastic License.
*/
+import { isMlRule } from '../../../machine_learning/helpers';
+import { isThresholdRule } from '../../utils';
import { ImportRulesSchema } from './import_rules_schema';
export const validateAnomalyThreshold = (rule: ImportRulesSchema): string[] => {
- if (rule.type === 'machine_learning') {
+ if (isMlRule(rule.type)) {
if (rule.anomaly_threshold == null) {
return ['when "type" is "machine_learning" anomaly_threshold is required'];
} else {
@@ -19,7 +21,7 @@ export const validateAnomalyThreshold = (rule: ImportRulesSchema): string[] => {
};
export const validateQuery = (rule: ImportRulesSchema): string[] => {
- if (rule.type === 'machine_learning') {
+ if (isMlRule(rule.type)) {
if (rule.query != null) {
return ['when "type" is "machine_learning", "query" cannot be set'];
} else {
@@ -31,7 +33,7 @@ export const validateQuery = (rule: ImportRulesSchema): string[] => {
};
export const validateLanguage = (rule: ImportRulesSchema): string[] => {
- if (rule.type === 'machine_learning') {
+ if (isMlRule(rule.type)) {
if (rule.language != null) {
return ['when "type" is "machine_learning", "language" cannot be set'];
} else {
@@ -55,7 +57,7 @@ export const validateSavedId = (rule: ImportRulesSchema): string[] => {
};
export const validateMachineLearningJobId = (rule: ImportRulesSchema): string[] => {
- if (rule.type === 'machine_learning') {
+ if (isMlRule(rule.type)) {
if (rule.machine_learning_job_id == null) {
return ['when "type" is "machine_learning", "machine_learning_job_id" is required'];
} else {
@@ -93,7 +95,7 @@ export const validateTimelineTitle = (rule: ImportRulesSchema): string[] => {
};
export const validateThreshold = (rule: ImportRulesSchema): string[] => {
- if (rule.type === 'threshold') {
+ if (isThresholdRule(rule.type)) {
if (!rule.threshold) {
return ['when "type" is "threshold", "threshold" is required'];
} else if (rule.threshold.value <= 0) {
diff --git a/x-pack/plugins/security_solution/common/detection_engine/schemas/request/patch_rules_type_dependents.ts b/x-pack/plugins/security_solution/common/detection_engine/schemas/request/patch_rules_type_dependents.ts
index a229771a7c05c..c974f73926c21 100644
--- a/x-pack/plugins/security_solution/common/detection_engine/schemas/request/patch_rules_type_dependents.ts
+++ b/x-pack/plugins/security_solution/common/detection_engine/schemas/request/patch_rules_type_dependents.ts
@@ -4,10 +4,12 @@
* you may not use this file except in compliance with the Elastic License.
*/
+import { isMlRule } from '../../../machine_learning/helpers';
+import { isThresholdRule } from '../../utils';
import { PatchRulesSchema } from './patch_rules_schema';
export const validateQuery = (rule: PatchRulesSchema): string[] => {
- if (rule.type === 'machine_learning') {
+ if (isMlRule(rule.type)) {
if (rule.query != null) {
return ['when "type" is "machine_learning", "query" cannot be set'];
} else {
@@ -19,7 +21,7 @@ export const validateQuery = (rule: PatchRulesSchema): string[] => {
};
export const validateLanguage = (rule: PatchRulesSchema): string[] => {
- if (rule.type === 'machine_learning') {
+ if (isMlRule(rule.type)) {
if (rule.language != null) {
return ['when "type" is "machine_learning", "language" cannot be set'];
} else {
@@ -67,7 +69,7 @@ export const validateId = (rule: PatchRulesSchema): string[] => {
};
export const validateThreshold = (rule: PatchRulesSchema): string[] => {
- if (rule.type === 'threshold') {
+ if (isThresholdRule(rule.type)) {
if (!rule.threshold) {
return ['when "type" is "threshold", "threshold" is required'];
} else if (rule.threshold.value <= 0) {
diff --git a/x-pack/plugins/security_solution/common/detection_engine/schemas/request/update_rules_type_dependents.ts b/x-pack/plugins/security_solution/common/detection_engine/schemas/request/update_rules_type_dependents.ts
index 44182d250c801..5f297fb9688fc 100644
--- a/x-pack/plugins/security_solution/common/detection_engine/schemas/request/update_rules_type_dependents.ts
+++ b/x-pack/plugins/security_solution/common/detection_engine/schemas/request/update_rules_type_dependents.ts
@@ -4,10 +4,12 @@
* you may not use this file except in compliance with the Elastic License.
*/
+import { isMlRule } from '../../../machine_learning/helpers';
+import { isThresholdRule } from '../../utils';
import { UpdateRulesSchema } from './update_rules_schema';
export const validateAnomalyThreshold = (rule: UpdateRulesSchema): string[] => {
- if (rule.type === 'machine_learning') {
+ if (isMlRule(rule.type)) {
if (rule.anomaly_threshold == null) {
return ['when "type" is "machine_learning" anomaly_threshold is required'];
} else {
@@ -19,7 +21,7 @@ export const validateAnomalyThreshold = (rule: UpdateRulesSchema): string[] => {
};
export const validateQuery = (rule: UpdateRulesSchema): string[] => {
- if (rule.type === 'machine_learning') {
+ if (isMlRule(rule.type)) {
if (rule.query != null) {
return ['when "type" is "machine_learning", "query" cannot be set'];
} else {
@@ -31,7 +33,7 @@ export const validateQuery = (rule: UpdateRulesSchema): string[] => {
};
export const validateLanguage = (rule: UpdateRulesSchema): string[] => {
- if (rule.type === 'machine_learning') {
+ if (isMlRule(rule.type)) {
if (rule.language != null) {
return ['when "type" is "machine_learning", "language" cannot be set'];
} else {
@@ -55,7 +57,7 @@ export const validateSavedId = (rule: UpdateRulesSchema): string[] => {
};
export const validateMachineLearningJobId = (rule: UpdateRulesSchema): string[] => {
- if (rule.type === 'machine_learning') {
+ if (isMlRule(rule.type)) {
if (rule.machine_learning_job_id == null) {
return ['when "type" is "machine_learning", "machine_learning_job_id" is required'];
} else {
@@ -103,7 +105,7 @@ export const validateId = (rule: UpdateRulesSchema): string[] => {
};
export const validateThreshold = (rule: UpdateRulesSchema): string[] => {
- if (rule.type === 'threshold') {
+ if (isThresholdRule(rule.type)) {
if (!rule.threshold) {
return ['when "type" is "threshold", "threshold" is required'];
} else if (rule.threshold.value <= 0) {
diff --git a/x-pack/plugins/security_solution/common/detection_engine/schemas/response/rules_schema.test.ts b/x-pack/plugins/security_solution/common/detection_engine/schemas/response/rules_schema.test.ts
index b3f9096b51483..36fc063761840 100644
--- a/x-pack/plugins/security_solution/common/detection_engine/schemas/response/rules_schema.test.ts
+++ b/x-pack/plugins/security_solution/common/detection_engine/schemas/response/rules_schema.test.ts
@@ -633,6 +633,16 @@ describe('rules_schema', () => {
expect(fields.length).toEqual(2);
});
+ test('should return two fields for a rule of type "eql"', () => {
+ const fields = addQueryFields({ type: 'eql' });
+ expect(fields.length).toEqual(2);
+ });
+
+ test('should return two fields for a rule of type "threshold"', () => {
+ const fields = addQueryFields({ type: 'threshold' });
+ expect(fields.length).toEqual(2);
+ });
+
test('should return two fields for a rule of type "saved_query"', () => {
const fields = addQueryFields({ type: 'saved_query' });
expect(fields.length).toEqual(2);
diff --git a/x-pack/plugins/security_solution/common/detection_engine/schemas/response/rules_schema.ts b/x-pack/plugins/security_solution/common/detection_engine/schemas/response/rules_schema.ts
index 04df25d805f9e..c26a7efb0c288 100644
--- a/x-pack/plugins/security_solution/common/detection_engine/schemas/response/rules_schema.ts
+++ b/x-pack/plugins/security_solution/common/detection_engine/schemas/response/rules_schema.ts
@@ -8,9 +8,9 @@ import * as t from 'io-ts';
import { isObject } from 'lodash/fp';
import { Either, left, fold } from 'fp-ts/lib/Either';
import { pipe } from 'fp-ts/lib/pipeable';
-import { typeAndTimelineOnlySchema, TypeAndTimelineOnly } from './type_timeline_only_schema';
-import { isMlRule } from '../../../machine_learning/helpers';
+import { isMlRule } from '../../../machine_learning/helpers';
+import { isThresholdRule } from '../../utils';
import {
actions,
anomaly_threshold,
@@ -66,6 +66,7 @@ import {
DefaultRiskScoreMappingArray,
DefaultSeverityMappingArray,
} from '../types';
+import { typeAndTimelineOnlySchema, TypeAndTimelineOnly } from './type_timeline_only_schema';
/**
* This is the required fields for the rules schema response. Put all required properties on
@@ -205,7 +206,7 @@ export const addTimelineTitle = (typeAndTimelineOnly: TypeAndTimelineOnly): t.Mi
};
export const addQueryFields = (typeAndTimelineOnly: TypeAndTimelineOnly): t.Mixed[] => {
- if (['query', 'saved_query', 'threshold'].includes(typeAndTimelineOnly.type)) {
+ if (['eql', 'query', 'saved_query', 'threshold'].includes(typeAndTimelineOnly.type)) {
return [
t.exact(t.type({ query: dependentRulesSchema.props.query })),
t.exact(t.type({ language: dependentRulesSchema.props.language })),
@@ -229,7 +230,7 @@ export const addMlFields = (typeAndTimelineOnly: TypeAndTimelineOnly): t.Mixed[]
};
export const addThresholdFields = (typeAndTimelineOnly: TypeAndTimelineOnly): t.Mixed[] => {
- if (typeAndTimelineOnly.type === 'threshold') {
+ if (isThresholdRule(typeAndTimelineOnly.type)) {
return [
t.exact(t.type({ threshold: dependentRulesSchema.props.threshold })),
t.exact(t.partial({ saved_id: dependentRulesSchema.props.saved_id })),
diff --git a/x-pack/plugins/security_solution/common/detection_engine/utils.ts b/x-pack/plugins/security_solution/common/detection_engine/utils.ts
index a72d641fbaf78..170d28cb5a725 100644
--- a/x-pack/plugins/security_solution/common/detection_engine/utils.ts
+++ b/x-pack/plugins/security_solution/common/detection_engine/utils.ts
@@ -17,4 +17,6 @@ export const hasNestedEntry = (entries: EntriesArray): boolean => {
return found.length > 0;
};
-export const isThresholdRule = (ruleType: Type) => ruleType === 'threshold';
+export const isEqlRule = (ruleType: Type | undefined) => ruleType === 'eql';
+export const isThresholdRule = (ruleType: Type | undefined) => ruleType === 'threshold';
+export const isQueryRule = (ruleType: Type | undefined) => ruleType === 'query';
diff --git a/x-pack/plugins/security_solution/common/machine_learning/helpers.ts b/x-pack/plugins/security_solution/common/machine_learning/helpers.ts
index 73dc30f238c7e..73b14afb5d0c9 100644
--- a/x-pack/plugins/security_solution/common/machine_learning/helpers.ts
+++ b/x-pack/plugins/security_solution/common/machine_learning/helpers.ts
@@ -23,4 +23,4 @@ export const isJobFailed = (jobState: string, datafeedState: string): boolean =>
return failureStates.includes(jobState) || failureStates.includes(datafeedState);
};
-export const isMlRule = (ruleType: Type) => ruleType === 'machine_learning';
+export const isMlRule = (ruleType: Type | undefined) => ruleType === 'machine_learning';
diff --git a/x-pack/plugins/security_solution/common/search_strategy/security_solution/index.ts b/x-pack/plugins/security_solution/common/search_strategy/security_solution/index.ts
index 35fcc3b07fd05..95f3cd4fd7da7 100644
--- a/x-pack/plugins/security_solution/common/search_strategy/security_solution/index.ts
+++ b/x-pack/plugins/security_solution/common/search_strategy/security_solution/index.ts
@@ -39,6 +39,17 @@ import {
NetworkTopNFlowRequestOptions,
NetworkUsersStrategyResponse,
NetworkUsersRequestOptions,
+ NetworkKpiQueries,
+ NetworkKpiDnsStrategyResponse,
+ NetworkKpiDnsRequestOptions,
+ NetworkKpiNetworkEventsStrategyResponse,
+ NetworkKpiNetworkEventsRequestOptions,
+ NetworkKpiTlsHandshakesStrategyResponse,
+ NetworkKpiTlsHandshakesRequestOptions,
+ NetworkKpiUniqueFlowsStrategyResponse,
+ NetworkKpiUniqueFlowsRequestOptions,
+ NetworkKpiUniquePrivateIpsStrategyResponse,
+ NetworkKpiUniquePrivateIpsRequestOptions,
} from './network';
import {
MatrixHistogramQuery,
@@ -57,7 +68,11 @@ export * from './hosts';
export * from './matrix_histogram';
export * from './network';
-export type FactoryQueryTypes = HostsQueries | NetworkQueries | typeof MatrixHistogramQuery;
+export type FactoryQueryTypes =
+ | HostsQueries
+ | NetworkQueries
+ | NetworkKpiQueries
+ | typeof MatrixHistogramQuery;
export interface RequestBasicOptions extends IEsSearchRequest {
timerange: TimerangeInput;
@@ -107,6 +122,16 @@ export type StrategyResponseType = T extends HostsQ
? NetworkTopNFlowStrategyResponse
: T extends NetworkQueries.users
? NetworkUsersStrategyResponse
+ : T extends NetworkKpiQueries.dns
+ ? NetworkKpiDnsStrategyResponse
+ : T extends NetworkKpiQueries.networkEvents
+ ? NetworkKpiNetworkEventsStrategyResponse
+ : T extends NetworkKpiQueries.tlsHandshakes
+ ? NetworkKpiTlsHandshakesStrategyResponse
+ : T extends NetworkKpiQueries.uniqueFlows
+ ? NetworkKpiUniqueFlowsStrategyResponse
+ : T extends NetworkKpiQueries.uniquePrivateIps
+ ? NetworkKpiUniquePrivateIpsStrategyResponse
: T extends typeof MatrixHistogramQuery
? MatrixHistogramStrategyResponse
: never;
@@ -139,6 +164,16 @@ export type StrategyRequestType = T extends HostsQu
? NetworkTopNFlowRequestOptions
: T extends NetworkQueries.users
? NetworkUsersRequestOptions
+ : T extends NetworkKpiQueries.dns
+ ? NetworkKpiDnsRequestOptions
+ : T extends NetworkKpiQueries.networkEvents
+ ? NetworkKpiNetworkEventsRequestOptions
+ : T extends NetworkKpiQueries.tlsHandshakes
+ ? NetworkKpiTlsHandshakesRequestOptions
+ : T extends NetworkKpiQueries.uniqueFlows
+ ? NetworkKpiUniqueFlowsRequestOptions
+ : T extends NetworkKpiQueries.uniquePrivateIps
+ ? NetworkKpiUniquePrivateIpsRequestOptions
: T extends typeof MatrixHistogramQuery
? MatrixHistogramRequestOptions
: never;
diff --git a/x-pack/plugins/security_solution/common/search_strategy/security_solution/network/index.ts b/x-pack/plugins/security_solution/common/search_strategy/security_solution/network/index.ts
index 4e73fe11ef430..19f90b2f57e7d 100644
--- a/x-pack/plugins/security_solution/common/search_strategy/security_solution/network/index.ts
+++ b/x-pack/plugins/security_solution/common/search_strategy/security_solution/network/index.ts
@@ -8,6 +8,7 @@ export * from './common';
export * from './details';
export * from './dns';
export * from './http';
+export * from './kpi';
export * from './overview';
export * from './tls';
export * from './top_countries';
diff --git a/x-pack/plugins/security_solution/common/search_strategy/security_solution/network/kpi/dns/index.ts b/x-pack/plugins/security_solution/common/search_strategy/security_solution/network/kpi/dns/index.ts
new file mode 100644
index 0000000000000..7c192de080e60
--- /dev/null
+++ b/x-pack/plugins/security_solution/common/search_strategy/security_solution/network/kpi/dns/index.ts
@@ -0,0 +1,16 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License;
+ * you may not use this file except in compliance with the Elastic License.
+ */
+
+import { IEsSearchResponse } from '../../../../../../../../../src/plugins/data/common';
+import { Inspect, Maybe } from '../../../../common';
+import { RequestBasicOptions } from '../../..';
+
+export type NetworkKpiDnsRequestOptions = RequestBasicOptions;
+
+export interface NetworkKpiDnsStrategyResponse extends IEsSearchResponse {
+ dnsQueries: number;
+ inspect?: Maybe;
+}
diff --git a/x-pack/plugins/security_solution/common/search_strategy/security_solution/network/kpi/index.ts b/x-pack/plugins/security_solution/common/search_strategy/security_solution/network/kpi/index.ts
new file mode 100644
index 0000000000000..e94ab030fbdb9
--- /dev/null
+++ b/x-pack/plugins/security_solution/common/search_strategy/security_solution/network/kpi/index.ts
@@ -0,0 +1,32 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License;
+ * you may not use this file except in compliance with the Elastic License.
+ */
+
+export * from './dns';
+export * from './network_events';
+export * from './tls_handshakes';
+export * from './unique_flows';
+export * from './unique_private_ips';
+
+import { NetworkKpiDnsStrategyResponse } from './dns';
+import { NetworkKpiNetworkEventsStrategyResponse } from './network_events';
+import { NetworkKpiTlsHandshakesStrategyResponse } from './tls_handshakes';
+import { NetworkKpiUniqueFlowsStrategyResponse } from './unique_flows';
+import { NetworkKpiUniquePrivateIpsStrategyResponse } from './unique_private_ips';
+
+export enum NetworkKpiQueries {
+ dns = 'networkKpiDns',
+ networkEvents = 'networkKpiNetworkEvents',
+ tlsHandshakes = 'networkKpiTlsHandshakes',
+ uniqueFlows = 'networkKpiUniqueFlows',
+ uniquePrivateIps = 'networkKpiUniquePrivateIps',
+}
+
+export type NetworkKpiStrategyResponse =
+ | Omit
+ | Omit
+ | Omit
+ | Omit
+ | Omit;
diff --git a/x-pack/plugins/security_solution/common/search_strategy/security_solution/network/kpi/network_events/index.ts b/x-pack/plugins/security_solution/common/search_strategy/security_solution/network/kpi/network_events/index.ts
new file mode 100644
index 0000000000000..dcccf8e7f3ac9
--- /dev/null
+++ b/x-pack/plugins/security_solution/common/search_strategy/security_solution/network/kpi/network_events/index.ts
@@ -0,0 +1,16 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License;
+ * you may not use this file except in compliance with the Elastic License.
+ */
+
+import { IEsSearchResponse } from '../../../../../../../../../src/plugins/data/common';
+import { Inspect, Maybe } from '../../../../common';
+import { RequestBasicOptions } from '../../..';
+
+export type NetworkKpiNetworkEventsRequestOptions = RequestBasicOptions;
+
+export interface NetworkKpiNetworkEventsStrategyResponse extends IEsSearchResponse {
+ networkEvents: number;
+ inspect?: Maybe;
+}
diff --git a/x-pack/plugins/security_solution/common/search_strategy/security_solution/network/kpi/tls_handshakes/index.ts b/x-pack/plugins/security_solution/common/search_strategy/security_solution/network/kpi/tls_handshakes/index.ts
new file mode 100644
index 0000000000000..216c57fdb6c3c
--- /dev/null
+++ b/x-pack/plugins/security_solution/common/search_strategy/security_solution/network/kpi/tls_handshakes/index.ts
@@ -0,0 +1,16 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License;
+ * you may not use this file except in compliance with the Elastic License.
+ */
+
+import { IEsSearchResponse } from '../../../../../../../../../src/plugins/data/common';
+import { Inspect, Maybe } from '../../../../common';
+import { RequestBasicOptions } from '../../..';
+
+export type NetworkKpiTlsHandshakesRequestOptions = RequestBasicOptions;
+
+export interface NetworkKpiTlsHandshakesStrategyResponse extends IEsSearchResponse {
+ tlsHandshakes: number;
+ inspect?: Maybe;
+}
diff --git a/x-pack/plugins/security_solution/common/search_strategy/security_solution/network/kpi/unique_flows/index.ts b/x-pack/plugins/security_solution/common/search_strategy/security_solution/network/kpi/unique_flows/index.ts
new file mode 100644
index 0000000000000..dc7d36b7cd4af
--- /dev/null
+++ b/x-pack/plugins/security_solution/common/search_strategy/security_solution/network/kpi/unique_flows/index.ts
@@ -0,0 +1,16 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License;
+ * you may not use this file except in compliance with the Elastic License.
+ */
+
+import { IEsSearchResponse } from '../../../../../../../../../src/plugins/data/common';
+import { Inspect, Maybe } from '../../../../common';
+import { RequestBasicOptions } from '../../..';
+
+export type NetworkKpiUniqueFlowsRequestOptions = RequestBasicOptions;
+
+export interface NetworkKpiUniqueFlowsStrategyResponse extends IEsSearchResponse {
+ uniqueFlowId: number;
+ inspect?: Maybe;
+}
diff --git a/x-pack/plugins/security_solution/common/search_strategy/security_solution/network/kpi/unique_private_ips/index.ts b/x-pack/plugins/security_solution/common/search_strategy/security_solution/network/kpi/unique_private_ips/index.ts
new file mode 100644
index 0000000000000..ccf4d397ffd8f
--- /dev/null
+++ b/x-pack/plugins/security_solution/common/search_strategy/security_solution/network/kpi/unique_private_ips/index.ts
@@ -0,0 +1,26 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License;
+ * you may not use this file except in compliance with the Elastic License.
+ */
+
+import { IEsSearchResponse } from '../../../../../../../../../src/plugins/data/common';
+import { Inspect, Maybe } from '../../../../common';
+import { RequestBasicOptions } from '../../..';
+
+export interface NetworkKpiHistogramData {
+ x?: Maybe;
+ y?: Maybe;
+}
+
+export type NetworkKpiUniquePrivateIpsRequestOptions = RequestBasicOptions;
+
+export interface NetworkKpiUniquePrivateIpsStrategyResponse extends IEsSearchResponse {
+ uniqueSourcePrivateIps: number;
+ uniqueSourcePrivateIpsHistogram: NetworkKpiHistogramData[] | null;
+ uniqueDestinationPrivateIps: number;
+ uniqueDestinationPrivateIpsHistogram: NetworkKpiHistogramData[] | null;
+ inspect?: Maybe;
+}
+
+export type UniquePrivateAttributeQuery = 'source' | 'destination';
diff --git a/x-pack/plugins/security_solution/cypress/integration/alerts_detection_rules_custom.spec.ts b/x-pack/plugins/security_solution/cypress/integration/alerts_detection_rules_custom.spec.ts
index d9d9fde8fc8cc..17ff1dad79960 100644
--- a/x-pack/plugins/security_solution/cypress/integration/alerts_detection_rules_custom.spec.ts
+++ b/x-pack/plugins/security_solution/cypress/integration/alerts_detection_rules_custom.spec.ts
@@ -4,7 +4,7 @@
* you may not use this file except in compliance with the Elastic License.
*/
-import { newRule } from '../objects/rule';
+import { newRule, existingRule } from '../objects/rule';
import {
CUSTOM_RULES_BTN,
@@ -16,26 +16,16 @@ import {
SHOWING_RULES_TEXT,
} from '../screens/alerts_detection_rules';
import {
- ABOUT_FALSE_POSITIVES,
ABOUT_INVESTIGATION_NOTES,
- ABOUT_MITRE,
- ABOUT_RISK,
ABOUT_RULE_DESCRIPTION,
- ABOUT_SEVERITY,
- ABOUT_STEP,
- ABOUT_TAGS,
- ABOUT_URLS,
- DEFINITION_CUSTOM_QUERY,
- DEFINITION_INDEX_PATTERNS,
- DEFINITION_TIMELINE,
- DEFINITION_STEP,
INVESTIGATION_NOTES_MARKDOWN,
INVESTIGATION_NOTES_TOGGLE,
RULE_ABOUT_DETAILS_HEADER_TOGGLE,
RULE_NAME_HEADER,
- SCHEDULE_LOOPBACK,
- SCHEDULE_RUNS,
- SCHEDULE_STEP,
+ getDescriptionForTitle,
+ ABOUT_DETAILS,
+ DEFINITION_DETAILS,
+ SCHEDULE_DETAILS,
} from '../screens/rule_details';
import {
@@ -53,18 +43,38 @@ import {
selectNumberOfRules,
waitForLoadElasticPrebuiltDetectionRulesTableToBeLoaded,
waitForRulesToBeLoaded,
+ editFirstRule,
} from '../tasks/alerts_detection_rules';
import {
createAndActivateRule,
fillAboutRuleAndContinue,
fillDefineCustomRuleWithImportedQueryAndContinue,
- expectDefineFormToRepopulateAndContinue,
- expectAboutFormToRepopulateAndContinue,
+ goToAboutStepTab,
+ goToScheduleStepTab,
+ goToActionsStepTab,
+ fillAboutRule,
} from '../tasks/create_new_rule';
import { esArchiverLoad, esArchiverUnload } from '../tasks/es_archiver';
import { loginAndWaitForPageWithoutDateRange } from '../tasks/login';
import { DETECTIONS_URL } from '../urls/navigation';
+import {
+ ACTIONS_THROTTLE_INPUT,
+ CUSTOM_QUERY_INPUT,
+ DEFINE_INDEX_INPUT,
+ RULE_NAME_INPUT,
+ RULE_DESCRIPTION_INPUT,
+ TAGS_FIELD,
+ SEVERITY_DROPDOWN,
+ RISK_INPUT,
+ SCHEDULE_INTERVAL_AMOUNT_INPUT,
+ SCHEDULE_INTERVAL_UNITS_INPUT,
+ DEFINE_EDIT_BUTTON,
+ DEFINE_CONTINUE_BUTTON,
+ ABOUT_EDIT_BUTTON,
+ ABOUT_CONTINUE_BTN,
+} from '../screens/create_new_rule';
+import { saveEditedRule } from '../tasks/edit_rule';
describe('Detection rules, custom', () => {
before(() => {
@@ -84,8 +94,19 @@ describe('Detection rules, custom', () => {
goToCreateNewRule();
fillDefineCustomRuleWithImportedQueryAndContinue(newRule);
fillAboutRuleAndContinue(newRule);
- expectDefineFormToRepopulateAndContinue(newRule);
- expectAboutFormToRepopulateAndContinue(newRule);
+
+ // expect define step to repopulate
+ cy.get(DEFINE_EDIT_BUTTON).click();
+ cy.get(CUSTOM_QUERY_INPUT).invoke('text').should('eq', newRule.customQuery);
+ cy.get(DEFINE_CONTINUE_BUTTON).should('exist').click({ force: true });
+ cy.get(DEFINE_CONTINUE_BUTTON).should('not.exist');
+
+ // expect about step to populate
+ cy.get(ABOUT_EDIT_BUTTON).click();
+ cy.get(RULE_NAME_INPUT).invoke('val').should('eq', newRule.name);
+ cy.get(ABOUT_CONTINUE_BTN).should('exist').click({ force: true });
+ cy.get(ABOUT_CONTINUE_BTN).should('not.exist');
+
createAndActivateRule();
cy.get(CUSTOM_RULES_BTN).invoke('text').should('eql', 'Custom rules (1)');
@@ -142,32 +163,35 @@ describe('Detection rules, custom', () => {
cy.get(RULE_NAME_HEADER).invoke('text').should('eql', `${newRule.name} Beta`);
cy.get(ABOUT_RULE_DESCRIPTION).invoke('text').should('eql', newRule.description);
- cy.get(ABOUT_STEP).eq(ABOUT_SEVERITY).invoke('text').should('eql', newRule.severity);
- cy.get(ABOUT_STEP).eq(ABOUT_RISK).invoke('text').should('eql', newRule.riskScore);
- cy.get(ABOUT_STEP).eq(ABOUT_URLS).invoke('text').should('eql', expectedUrls);
- cy.get(ABOUT_STEP)
- .eq(ABOUT_FALSE_POSITIVES)
- .invoke('text')
- .should('eql', expectedFalsePositives);
- cy.get(ABOUT_STEP).eq(ABOUT_MITRE).invoke('text').should('eql', expectedMitre);
- cy.get(ABOUT_STEP).eq(ABOUT_TAGS).invoke('text').should('eql', expectedTags);
+ cy.get(ABOUT_DETAILS).within(() => {
+ getDescriptionForTitle('Severity').invoke('text').should('eql', newRule.severity);
+ getDescriptionForTitle('Risk score').invoke('text').should('eql', newRule.riskScore);
+ getDescriptionForTitle('Reference URLs').invoke('text').should('eql', expectedUrls);
+ getDescriptionForTitle('False positive examples')
+ .invoke('text')
+ .should('eql', expectedFalsePositives);
+ getDescriptionForTitle('MITRE ATT&CK').invoke('text').should('eql', expectedMitre);
+ getDescriptionForTitle('Tags').invoke('text').should('eql', expectedTags);
+ });
cy.get(RULE_ABOUT_DETAILS_HEADER_TOGGLE).eq(INVESTIGATION_NOTES_TOGGLE).click({ force: true });
cy.get(ABOUT_INVESTIGATION_NOTES).invoke('text').should('eql', INVESTIGATION_NOTES_MARKDOWN);
- cy.get(DEFINITION_INDEX_PATTERNS).then((patterns) => {
- cy.wrap(patterns).each((pattern, index) => {
- cy.wrap(pattern).invoke('text').should('eql', expectedIndexPatterns[index]);
- });
+ cy.get(DEFINITION_DETAILS).within(() => {
+ getDescriptionForTitle('Index patterns')
+ .invoke('text')
+ .should('eql', expectedIndexPatterns.join(''));
+ getDescriptionForTitle('Custom query')
+ .invoke('text')
+ .should('eql', `${newRule.customQuery} `);
+ getDescriptionForTitle('Rule type').invoke('text').should('eql', 'Query');
+ getDescriptionForTitle('Timeline template').invoke('text').should('eql', 'None');
+ });
+
+ cy.get(SCHEDULE_DETAILS).within(() => {
+ getDescriptionForTitle('Runs every').invoke('text').should('eql', '5m');
+ getDescriptionForTitle('Additional look-back time').invoke('text').should('eql', '1m');
});
- cy.get(DEFINITION_STEP)
- .eq(DEFINITION_CUSTOM_QUERY)
- .invoke('text')
- .should('eql', `${newRule.customQuery} `);
- cy.get(DEFINITION_STEP).eq(DEFINITION_TIMELINE).invoke('text').should('eql', 'None');
-
- cy.get(SCHEDULE_STEP).eq(SCHEDULE_RUNS).invoke('text').should('eql', '5m');
- cy.get(SCHEDULE_STEP).eq(SCHEDULE_LOOPBACK).invoke('text').should('eql', '1m');
});
});
@@ -233,4 +257,94 @@ describe('Deletes custom rules', () => {
.should('eql', `Custom rules (${expectedNumberOfRulesAfterDeletion})`);
});
});
+
+ it('Allows a rule to be edited', () => {
+ editFirstRule();
+
+ // expect define step to populate
+ cy.get(CUSTOM_QUERY_INPUT).invoke('text').should('eq', existingRule.customQuery);
+ if (existingRule.index && existingRule.index.length > 0) {
+ cy.get(DEFINE_INDEX_INPUT).invoke('text').should('eq', existingRule.index.join(''));
+ }
+
+ goToAboutStepTab();
+
+ // expect about step to populate
+ cy.get(RULE_NAME_INPUT).invoke('val').should('eql', existingRule.name);
+ cy.get(RULE_DESCRIPTION_INPUT).invoke('text').should('eql', existingRule.description);
+ cy.get(TAGS_FIELD).invoke('text').should('eql', existingRule.tags.join(''));
+
+ cy.get(SEVERITY_DROPDOWN).invoke('text').should('eql', existingRule.severity);
+ cy.get(RISK_INPUT).invoke('val').should('eql', existingRule.riskScore);
+
+ goToScheduleStepTab();
+
+ // expect schedule step to populate
+ const intervalParts = existingRule.interval && existingRule.interval.match(/[0-9]+|[a-zA-Z]+/g);
+ if (intervalParts) {
+ const [amount, unit] = intervalParts;
+ cy.get(SCHEDULE_INTERVAL_AMOUNT_INPUT).invoke('val').should('eql', amount);
+ cy.get(SCHEDULE_INTERVAL_UNITS_INPUT).invoke('val').should('eql', unit);
+ } else {
+ throw new Error('Cannot assert scheduling info on a rule without an interval');
+ }
+
+ goToActionsStepTab();
+
+ cy.get(ACTIONS_THROTTLE_INPUT).invoke('val').should('eql', 'no_actions');
+
+ goToAboutStepTab();
+
+ const editedRule = {
+ ...existingRule,
+ severity: 'Medium',
+ description: 'Edited Rule description',
+ };
+
+ fillAboutRule(editedRule);
+ saveEditedRule();
+
+ const expectedTags = editedRule.tags.join('');
+ const expectedIndexPatterns =
+ editedRule.index && editedRule.index.length
+ ? editedRule.index
+ : [
+ 'apm-*-transaction*',
+ 'auditbeat-*',
+ 'endgame-*',
+ 'filebeat-*',
+ 'logs-*',
+ 'packetbeat-*',
+ 'winlogbeat-*',
+ ];
+
+ cy.get(RULE_NAME_HEADER).invoke('text').should('eql', `${editedRule.name} Beta`);
+
+ cy.get(ABOUT_RULE_DESCRIPTION).invoke('text').should('eql', editedRule.description);
+ cy.get(ABOUT_DETAILS).within(() => {
+ getDescriptionForTitle('Severity').invoke('text').should('eql', editedRule.severity);
+ getDescriptionForTitle('Risk score').invoke('text').should('eql', editedRule.riskScore);
+ getDescriptionForTitle('Tags').invoke('text').should('eql', expectedTags);
+ });
+
+ cy.get(RULE_ABOUT_DETAILS_HEADER_TOGGLE).eq(INVESTIGATION_NOTES_TOGGLE).click({ force: true });
+ cy.get(ABOUT_INVESTIGATION_NOTES).invoke('text').should('eql', editedRule.note);
+
+ cy.get(DEFINITION_DETAILS).within(() => {
+ getDescriptionForTitle('Index patterns')
+ .invoke('text')
+ .should('eql', expectedIndexPatterns.join(''));
+ getDescriptionForTitle('Custom query')
+ .invoke('text')
+ .should('eql', `${editedRule.customQuery} `);
+ getDescriptionForTitle('Rule type').invoke('text').should('eql', 'Query');
+ getDescriptionForTitle('Timeline template').invoke('text').should('eql', 'None');
+ });
+
+ if (editedRule.interval) {
+ cy.get(SCHEDULE_DETAILS).within(() => {
+ getDescriptionForTitle('Runs every').invoke('text').should('eql', editedRule.interval);
+ });
+ }
+ });
});
diff --git a/x-pack/plugins/security_solution/cypress/integration/alerts_detection_rules_eql.spec.ts b/x-pack/plugins/security_solution/cypress/integration/alerts_detection_rules_eql.spec.ts
new file mode 100644
index 0000000000000..76871929fe050
--- /dev/null
+++ b/x-pack/plugins/security_solution/cypress/integration/alerts_detection_rules_eql.spec.ts
@@ -0,0 +1,159 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License;
+ * you may not use this file except in compliance with the Elastic License.
+ */
+
+import { eqlRule } from '../objects/rule';
+
+import {
+ CUSTOM_RULES_BTN,
+ RISK_SCORE,
+ RULE_NAME,
+ RULES_ROW,
+ RULES_TABLE,
+ SEVERITY,
+} from '../screens/alerts_detection_rules';
+import {
+ ABOUT_DETAILS,
+ ABOUT_INVESTIGATION_NOTES,
+ ABOUT_RULE_DESCRIPTION,
+ DEFINITION_DETAILS,
+ getDescriptionForTitle,
+ INVESTIGATION_NOTES_MARKDOWN,
+ INVESTIGATION_NOTES_TOGGLE,
+ RULE_ABOUT_DETAILS_HEADER_TOGGLE,
+ RULE_NAME_HEADER,
+ SCHEDULE_DETAILS,
+} from '../screens/rule_details';
+
+import {
+ goToManageAlertsDetectionRules,
+ waitForAlertsIndexToBeCreated,
+ waitForAlertsPanelToBeLoaded,
+} from '../tasks/alerts';
+import {
+ changeToThreeHundredRowsPerPage,
+ filterByCustomRules,
+ goToCreateNewRule,
+ goToRuleDetails,
+ waitForLoadElasticPrebuiltDetectionRulesTableToBeLoaded,
+ waitForRulesToBeLoaded,
+} from '../tasks/alerts_detection_rules';
+import {
+ createAndActivateRule,
+ fillAboutRuleAndContinue,
+ selectEqlRuleType,
+ fillDefineEqlRuleAndContinue,
+} from '../tasks/create_new_rule';
+import { esArchiverLoad, esArchiverUnload } from '../tasks/es_archiver';
+import { loginAndWaitForPageWithoutDateRange } from '../tasks/login';
+
+import { DETECTIONS_URL } from '../urls/navigation';
+
+describe('Detection rules, EQL', () => {
+ before(() => {
+ esArchiverLoad('timeline');
+ });
+
+ after(() => {
+ esArchiverUnload('timeline');
+ });
+
+ it('Creates and activates a new EQL rule', () => {
+ loginAndWaitForPageWithoutDateRange(DETECTIONS_URL);
+ waitForAlertsPanelToBeLoaded();
+ waitForAlertsIndexToBeCreated();
+ goToManageAlertsDetectionRules();
+ waitForLoadElasticPrebuiltDetectionRulesTableToBeLoaded();
+ goToCreateNewRule();
+ selectEqlRuleType();
+ fillDefineEqlRuleAndContinue(eqlRule);
+ fillAboutRuleAndContinue(eqlRule);
+ createAndActivateRule();
+
+ cy.get(CUSTOM_RULES_BTN).invoke('text').should('eql', 'Custom rules (1)');
+
+ changeToThreeHundredRowsPerPage();
+ waitForRulesToBeLoaded();
+
+ const expectedNumberOfRules = 1;
+ cy.get(RULES_TABLE).then(($table) => {
+ cy.wrap($table.find(RULES_ROW).length).should('eql', expectedNumberOfRules);
+ });
+
+ filterByCustomRules();
+
+ cy.get(RULES_TABLE).then(($table) => {
+ cy.wrap($table.find(RULES_ROW).length).should('eql', 1);
+ });
+ cy.get(RULE_NAME).invoke('text').should('eql', eqlRule.name);
+ cy.get(RISK_SCORE).invoke('text').should('eql', eqlRule.riskScore);
+ cy.get(SEVERITY).invoke('text').should('eql', eqlRule.severity);
+ cy.get('[data-test-subj="rule-switch"]').should('have.attr', 'aria-checked', 'true');
+
+ goToRuleDetails();
+
+ let expectedUrls = '';
+ eqlRule.referenceUrls.forEach((url) => {
+ expectedUrls = expectedUrls + url;
+ });
+ let expectedFalsePositives = '';
+ eqlRule.falsePositivesExamples.forEach((falsePositive) => {
+ expectedFalsePositives = expectedFalsePositives + falsePositive;
+ });
+ let expectedTags = '';
+ eqlRule.tags.forEach((tag) => {
+ expectedTags = expectedTags + tag;
+ });
+ let expectedMitre = '';
+ eqlRule.mitre.forEach((mitre) => {
+ expectedMitre = expectedMitre + mitre.tactic;
+ mitre.techniques.forEach((technique) => {
+ expectedMitre = expectedMitre + technique;
+ });
+ });
+ const expectedIndexPatterns = [
+ 'apm-*-transaction*',
+ 'auditbeat-*',
+ 'endgame-*',
+ 'filebeat-*',
+ 'logs-*',
+ 'packetbeat-*',
+ 'winlogbeat-*',
+ ];
+
+ cy.get(RULE_NAME_HEADER).invoke('text').should('eql', `${eqlRule.name} Beta`);
+
+ cy.get(ABOUT_RULE_DESCRIPTION).invoke('text').should('eql', eqlRule.description);
+ cy.get(ABOUT_DETAILS).within(() => {
+ getDescriptionForTitle('Severity').invoke('text').should('eql', eqlRule.severity);
+ getDescriptionForTitle('Risk score').invoke('text').should('eql', eqlRule.riskScore);
+ getDescriptionForTitle('Reference URLs').invoke('text').should('eql', expectedUrls);
+ getDescriptionForTitle('False positive examples')
+ .invoke('text')
+ .should('eql', expectedFalsePositives);
+ getDescriptionForTitle('MITRE ATT&CK').invoke('text').should('eql', expectedMitre);
+ getDescriptionForTitle('Tags').invoke('text').should('eql', expectedTags);
+ });
+
+ cy.get(RULE_ABOUT_DETAILS_HEADER_TOGGLE).eq(INVESTIGATION_NOTES_TOGGLE).click({ force: true });
+ cy.get(ABOUT_INVESTIGATION_NOTES).invoke('text').should('eql', INVESTIGATION_NOTES_MARKDOWN);
+
+ cy.get(DEFINITION_DETAILS).within(() => {
+ getDescriptionForTitle('Index patterns')
+ .invoke('text')
+ .should('eql', expectedIndexPatterns.join(''));
+ getDescriptionForTitle('Custom query')
+ .invoke('text')
+ .should('eql', `${eqlRule.customQuery} `);
+ getDescriptionForTitle('Rule type').invoke('text').should('eql', 'Event Correlation');
+ getDescriptionForTitle('Timeline template').invoke('text').should('eql', 'None');
+ });
+
+ cy.get(SCHEDULE_DETAILS).within(() => {
+ getDescriptionForTitle('Runs every').invoke('text').should('eql', '5m');
+ getDescriptionForTitle('Additional look-back time').invoke('text').should('eql', '1m');
+ });
+ });
+});
diff --git a/x-pack/plugins/security_solution/cypress/integration/alerts_detection_rules_ml.spec.ts b/x-pack/plugins/security_solution/cypress/integration/alerts_detection_rules_ml.spec.ts
index b6b30ef550eb1..47e49d48e2aec 100644
--- a/x-pack/plugins/security_solution/cypress/integration/alerts_detection_rules_ml.spec.ts
+++ b/x-pack/plugins/security_solution/cypress/integration/alerts_detection_rules_ml.spec.ts
@@ -16,24 +16,14 @@ import {
SEVERITY,
} from '../screens/alerts_detection_rules';
import {
- ABOUT_FALSE_POSITIVES,
- ABOUT_MITRE,
- ABOUT_RISK,
ABOUT_RULE_DESCRIPTION,
- ABOUT_SEVERITY,
- ABOUT_STEP,
- ABOUT_TAGS,
- ABOUT_URLS,
- ANOMALY_SCORE,
- DEFINITION_TIMELINE,
- DEFINITION_STEP,
MACHINE_LEARNING_JOB_ID,
MACHINE_LEARNING_JOB_STATUS,
RULE_NAME_HEADER,
- SCHEDULE_LOOPBACK,
- SCHEDULE_RUNS,
- SCHEDULE_STEP,
- RULE_TYPE,
+ getDescriptionForTitle,
+ ABOUT_DETAILS,
+ DEFINITION_DETAILS,
+ SCHEDULE_DETAILS,
} from '../screens/rule_details';
import {
@@ -126,36 +116,37 @@ describe('Detection rules, machine learning', () => {
cy.get(RULE_NAME_HEADER).invoke('text').should('eql', `${machineLearningRule.name} Beta`);
cy.get(ABOUT_RULE_DESCRIPTION).invoke('text').should('eql', machineLearningRule.description);
- cy.get(ABOUT_STEP)
- .eq(ABOUT_SEVERITY)
- .invoke('text')
- .should('eql', machineLearningRule.severity);
- cy.get(ABOUT_STEP).eq(ABOUT_RISK).invoke('text').should('eql', machineLearningRule.riskScore);
- cy.get(ABOUT_STEP).eq(ABOUT_URLS).invoke('text').should('eql', expectedUrls);
- cy.get(ABOUT_STEP)
- .eq(ABOUT_FALSE_POSITIVES)
- .invoke('text')
- .should('eql', expectedFalsePositives);
- cy.get(ABOUT_STEP).eq(ABOUT_MITRE).invoke('text').should('eql', expectedMitre);
- cy.get(ABOUT_STEP).eq(ABOUT_TAGS).invoke('text').should('eql', expectedTags);
-
- cy.get(DEFINITION_STEP).eq(RULE_TYPE).invoke('text').should('eql', 'Machine Learning');
- cy.get(DEFINITION_STEP)
- .eq(ANOMALY_SCORE)
- .invoke('text')
- .should('eql', machineLearningRule.anomalyScoreThreshold);
- cy.get(DEFINITION_STEP)
- .get(MACHINE_LEARNING_JOB_STATUS)
- .invoke('text')
- .should('eql', 'Stopped');
- cy.get(DEFINITION_STEP)
- .get(MACHINE_LEARNING_JOB_ID)
- .invoke('text')
- .should('eql', machineLearningRule.machineLearningJob);
-
- cy.get(DEFINITION_STEP).eq(DEFINITION_TIMELINE).invoke('text').should('eql', 'None');
-
- cy.get(SCHEDULE_STEP).eq(SCHEDULE_RUNS).invoke('text').should('eql', '5m');
- cy.get(SCHEDULE_STEP).eq(SCHEDULE_LOOPBACK).invoke('text').should('eql', '1m');
+ cy.get(ABOUT_DETAILS).within(() => {
+ getDescriptionForTitle('Severity').invoke('text').should('eql', machineLearningRule.severity);
+ getDescriptionForTitle('Risk score')
+ .invoke('text')
+ .should('eql', machineLearningRule.riskScore);
+ getDescriptionForTitle('Reference URLs').invoke('text').should('eql', expectedUrls);
+ getDescriptionForTitle('False positive examples')
+ .invoke('text')
+ .should('eql', expectedFalsePositives);
+ getDescriptionForTitle('MITRE ATT&CK').invoke('text').should('eql', expectedMitre);
+ getDescriptionForTitle('Tags').invoke('text').should('eql', expectedTags);
+ });
+
+ cy.get(DEFINITION_DETAILS).within(() => {
+ getDescriptionForTitle('Anomaly score')
+ .invoke('text')
+ .should('eql', machineLearningRule.anomalyScoreThreshold);
+ getDescriptionForTitle('Anomaly score')
+ .invoke('text')
+ .should('eql', machineLearningRule.anomalyScoreThreshold);
+ getDescriptionForTitle('Rule type').invoke('text').should('eql', 'Machine Learning');
+ getDescriptionForTitle('Timeline template').invoke('text').should('eql', 'None');
+ cy.get(MACHINE_LEARNING_JOB_STATUS).invoke('text').should('eql', 'Stopped');
+ cy.get(MACHINE_LEARNING_JOB_ID)
+ .invoke('text')
+ .should('eql', machineLearningRule.machineLearningJob);
+ });
+
+ cy.get(SCHEDULE_DETAILS).within(() => {
+ getDescriptionForTitle('Runs every').invoke('text').should('eql', '5m');
+ getDescriptionForTitle('Additional look-back time').invoke('text').should('eql', '1m');
+ });
});
});
diff --git a/x-pack/plugins/security_solution/cypress/integration/alerts_detection_rules_override.spec.ts b/x-pack/plugins/security_solution/cypress/integration/alerts_detection_rules_override.spec.ts
index e3526c63e2310..4edf5e1866087 100644
--- a/x-pack/plugins/security_solution/cypress/integration/alerts_detection_rules_override.spec.ts
+++ b/x-pack/plugins/security_solution/cypress/integration/alerts_detection_rules_override.spec.ts
@@ -16,29 +16,17 @@ import {
} from '../screens/alerts_detection_rules';
import {
ABOUT_INVESTIGATION_NOTES,
- ABOUT_OVERRIDE_FALSE_POSITIVES,
- ABOUT_OVERRIDE_MITRE,
- ABOUT_OVERRIDE_NAME_OVERRIDE,
- ABOUT_OVERRIDE_RISK,
- ABOUT_OVERRIDE_RISK_OVERRIDE,
- ABOUT_OVERRIDE_SEVERITY_OVERRIDE,
- ABOUT_OVERRIDE_TAGS,
- ABOUT_OVERRIDE_TIMESTAMP_OVERRIDE,
- ABOUT_OVERRIDE_URLS,
ABOUT_RULE_DESCRIPTION,
- ABOUT_SEVERITY,
- ABOUT_STEP,
- DEFINITION_CUSTOM_QUERY,
- DEFINITION_INDEX_PATTERNS,
- DEFINITION_TIMELINE,
- DEFINITION_STEP,
INVESTIGATION_NOTES_MARKDOWN,
INVESTIGATION_NOTES_TOGGLE,
RULE_ABOUT_DETAILS_HEADER_TOGGLE,
RULE_NAME_HEADER,
- SCHEDULE_LOOPBACK,
- SCHEDULE_RUNS,
- SCHEDULE_STEP,
+ ABOUT_DETAILS,
+ getDescriptionForTitle,
+ DEFINITION_DETAILS,
+ SCHEDULE_DETAILS,
+ DETAILS_TITLE,
+ DETAILS_DESCRIPTION,
} from '../screens/rule_details';
import {
@@ -141,56 +129,56 @@ describe('Detection rules, override', () => {
const expectedOverrideSeverities = ['Low', 'Medium', 'High', 'Critical'];
- cy.get(ABOUT_STEP).eq(ABOUT_SEVERITY).invoke('text').should('eql', newOverrideRule.severity);
- newOverrideRule.severityOverride.forEach((severity, i) => {
- cy.get(ABOUT_STEP)
- .eq(ABOUT_OVERRIDE_SEVERITY_OVERRIDE + i)
+ cy.get(ABOUT_DETAILS).within(() => {
+ getDescriptionForTitle('Severity').invoke('text').should('eql', newOverrideRule.severity);
+ getDescriptionForTitle('Risk score').invoke('text').should('eql', newOverrideRule.riskScore);
+ getDescriptionForTitle('Risk score override')
.invoke('text')
- .should(
- 'eql',
- `${severity.sourceField}:${severity.sourceValue}${expectedOverrideSeverities[i]}`
- );
+ .should('eql', `${newOverrideRule.riskOverride}signal.rule.risk_score`);
+ getDescriptionForTitle('Rule name override')
+ .invoke('text')
+ .should('eql', newOverrideRule.nameOverride);
+ getDescriptionForTitle('Reference URLs').invoke('text').should('eql', expectedUrls);
+ getDescriptionForTitle('False positive examples')
+ .invoke('text')
+ .should('eql', expectedFalsePositives);
+ getDescriptionForTitle('MITRE ATT&CK').invoke('text').should('eql', expectedMitre);
+ getDescriptionForTitle('Tags').invoke('text').should('eql', expectedTags);
+ getDescriptionForTitle('Timestamp override')
+ .invoke('text')
+ .should('eql', newOverrideRule.timestampOverride);
+ cy.contains(DETAILS_TITLE, 'Severity override')
+ .invoke('index', DETAILS_TITLE) // get index relative to other titles, not all siblings
+ .then((severityOverrideIndex) => {
+ newOverrideRule.severityOverride.forEach((severity, i) => {
+ cy.get(DETAILS_DESCRIPTION)
+ .eq(severityOverrideIndex + i)
+ .invoke('text')
+ .should(
+ 'eql',
+ `${severity.sourceField}:${severity.sourceValue}${expectedOverrideSeverities[i]}`
+ );
+ });
+ });
});
- cy.get(ABOUT_STEP)
- .eq(ABOUT_OVERRIDE_RISK)
- .invoke('text')
- .should('eql', newOverrideRule.riskScore);
- cy.get(ABOUT_STEP)
- .eq(ABOUT_OVERRIDE_RISK_OVERRIDE)
- .invoke('text')
- .should('eql', `${newOverrideRule.riskOverride}signal.rule.risk_score`);
- cy.get(ABOUT_STEP).eq(ABOUT_OVERRIDE_URLS).invoke('text').should('eql', expectedUrls);
- cy.get(ABOUT_STEP)
- .eq(ABOUT_OVERRIDE_FALSE_POSITIVES)
- .invoke('text')
- .should('eql', expectedFalsePositives);
- cy.get(ABOUT_STEP)
- .eq(ABOUT_OVERRIDE_NAME_OVERRIDE)
- .invoke('text')
- .should('eql', newOverrideRule.nameOverride);
- cy.get(ABOUT_STEP).eq(ABOUT_OVERRIDE_MITRE).invoke('text').should('eql', expectedMitre);
- cy.get(ABOUT_STEP)
- .eq(ABOUT_OVERRIDE_TIMESTAMP_OVERRIDE)
- .invoke('text')
- .should('eql', newOverrideRule.timestampOverride);
- cy.get(ABOUT_STEP).eq(ABOUT_OVERRIDE_TAGS).invoke('text').should('eql', expectedTags);
-
cy.get(RULE_ABOUT_DETAILS_HEADER_TOGGLE).eq(INVESTIGATION_NOTES_TOGGLE).click({ force: true });
cy.get(ABOUT_INVESTIGATION_NOTES).invoke('text').should('eql', INVESTIGATION_NOTES_MARKDOWN);
- cy.get(DEFINITION_INDEX_PATTERNS).then((patterns) => {
- cy.wrap(patterns).each((pattern, index) => {
- cy.wrap(pattern).invoke('text').should('eql', expectedIndexPatterns[index]);
- });
+ cy.get(DEFINITION_DETAILS).within(() => {
+ getDescriptionForTitle('Index patterns')
+ .invoke('text')
+ .should('eql', expectedIndexPatterns.join(''));
+ getDescriptionForTitle('Custom query')
+ .invoke('text')
+ .should('eql', `${newOverrideRule.customQuery} `);
+ getDescriptionForTitle('Rule type').invoke('text').should('eql', 'Query');
+ getDescriptionForTitle('Timeline template').invoke('text').should('eql', 'None');
+ });
+
+ cy.get(SCHEDULE_DETAILS).within(() => {
+ getDescriptionForTitle('Runs every').invoke('text').should('eql', '5m');
+ getDescriptionForTitle('Additional look-back time').invoke('text').should('eql', '1m');
});
- cy.get(DEFINITION_STEP)
- .eq(DEFINITION_CUSTOM_QUERY)
- .invoke('text')
- .should('eql', `${newOverrideRule.customQuery} `);
- cy.get(DEFINITION_STEP).eq(DEFINITION_TIMELINE).invoke('text').should('eql', 'None');
-
- cy.get(SCHEDULE_STEP).eq(SCHEDULE_RUNS).invoke('text').should('eql', '5m');
- cy.get(SCHEDULE_STEP).eq(SCHEDULE_LOOPBACK).invoke('text').should('eql', '1m');
});
});
diff --git a/x-pack/plugins/security_solution/cypress/integration/alerts_detection_rules_threshold.spec.ts b/x-pack/plugins/security_solution/cypress/integration/alerts_detection_rules_threshold.spec.ts
index 10f9ebb5623df..00175ed3baeb8 100644
--- a/x-pack/plugins/security_solution/cypress/integration/alerts_detection_rules_threshold.spec.ts
+++ b/x-pack/plugins/security_solution/cypress/integration/alerts_detection_rules_threshold.spec.ts
@@ -15,27 +15,16 @@ import {
SEVERITY,
} from '../screens/alerts_detection_rules';
import {
- ABOUT_FALSE_POSITIVES,
ABOUT_INVESTIGATION_NOTES,
- ABOUT_MITRE,
- ABOUT_RISK,
ABOUT_RULE_DESCRIPTION,
- ABOUT_SEVERITY,
- ABOUT_STEP,
- ABOUT_TAGS,
- ABOUT_URLS,
- DEFINITION_CUSTOM_QUERY,
- DEFINITION_INDEX_PATTERNS,
- DEFINITION_THRESHOLD,
- DEFINITION_TIMELINE,
- DEFINITION_STEP,
INVESTIGATION_NOTES_MARKDOWN,
INVESTIGATION_NOTES_TOGGLE,
RULE_ABOUT_DETAILS_HEADER_TOGGLE,
RULE_NAME_HEADER,
- SCHEDULE_LOOPBACK,
- SCHEDULE_RUNS,
- SCHEDULE_STEP,
+ getDescriptionForTitle,
+ ABOUT_DETAILS,
+ DEFINITION_DETAILS,
+ SCHEDULE_DETAILS,
} from '../screens/rule_details';
import {
@@ -137,38 +126,40 @@ describe('Detection rules, threshold', () => {
cy.get(RULE_NAME_HEADER).invoke('text').should('eql', `${newThresholdRule.name} Beta`);
cy.get(ABOUT_RULE_DESCRIPTION).invoke('text').should('eql', newThresholdRule.description);
- cy.get(ABOUT_STEP).eq(ABOUT_SEVERITY).invoke('text').should('eql', newThresholdRule.severity);
- cy.get(ABOUT_STEP).eq(ABOUT_RISK).invoke('text').should('eql', newThresholdRule.riskScore);
- cy.get(ABOUT_STEP).eq(ABOUT_URLS).invoke('text').should('eql', expectedUrls);
- cy.get(ABOUT_STEP)
- .eq(ABOUT_FALSE_POSITIVES)
- .invoke('text')
- .should('eql', expectedFalsePositives);
- cy.get(ABOUT_STEP).eq(ABOUT_MITRE).invoke('text').should('eql', expectedMitre);
- cy.get(ABOUT_STEP).eq(ABOUT_TAGS).invoke('text').should('eql', expectedTags);
+ cy.get(ABOUT_DETAILS).within(() => {
+ getDescriptionForTitle('Severity').invoke('text').should('eql', newThresholdRule.severity);
+ getDescriptionForTitle('Risk score').invoke('text').should('eql', newThresholdRule.riskScore);
+ getDescriptionForTitle('Reference URLs').invoke('text').should('eql', expectedUrls);
+ getDescriptionForTitle('False positive examples')
+ .invoke('text')
+ .should('eql', expectedFalsePositives);
+ getDescriptionForTitle('MITRE ATT&CK').invoke('text').should('eql', expectedMitre);
+ getDescriptionForTitle('Tags').invoke('text').should('eql', expectedTags);
+ });
cy.get(RULE_ABOUT_DETAILS_HEADER_TOGGLE).eq(INVESTIGATION_NOTES_TOGGLE).click({ force: true });
cy.get(ABOUT_INVESTIGATION_NOTES).invoke('text').should('eql', INVESTIGATION_NOTES_MARKDOWN);
- cy.get(DEFINITION_INDEX_PATTERNS).then((patterns) => {
- cy.wrap(patterns).each((pattern, index) => {
- cy.wrap(pattern).invoke('text').should('eql', expectedIndexPatterns[index]);
- });
+ cy.get(DEFINITION_DETAILS).within(() => {
+ getDescriptionForTitle('Index patterns')
+ .invoke('text')
+ .should('eql', expectedIndexPatterns.join(''));
+ getDescriptionForTitle('Custom query')
+ .invoke('text')
+ .should('eql', `${newThresholdRule.customQuery} `);
+ getDescriptionForTitle('Rule type').invoke('text').should('eql', 'Threshold');
+ getDescriptionForTitle('Timeline template').invoke('text').should('eql', 'None');
+ getDescriptionForTitle('Threshold')
+ .invoke('text')
+ .should(
+ 'eql',
+ `Results aggregated by ${newThresholdRule.thresholdField} >= ${newThresholdRule.threshold}`
+ );
+ });
+
+ cy.get(SCHEDULE_DETAILS).within(() => {
+ getDescriptionForTitle('Runs every').invoke('text').should('eql', '5m');
+ getDescriptionForTitle('Additional look-back time').invoke('text').should('eql', '1m');
});
- cy.get(DEFINITION_STEP)
- .eq(DEFINITION_CUSTOM_QUERY)
- .invoke('text')
- .should('eql', `${newThresholdRule.customQuery} `);
- cy.get(DEFINITION_STEP).eq(DEFINITION_TIMELINE).invoke('text').should('eql', 'None');
- cy.get(DEFINITION_STEP)
- .eq(DEFINITION_THRESHOLD)
- .invoke('text')
- .should(
- 'eql',
- `Results aggregated by ${newThresholdRule.thresholdField} >= ${newThresholdRule.threshold}`
- );
-
- cy.get(SCHEDULE_STEP).eq(SCHEDULE_RUNS).invoke('text').should('eql', '5m');
- cy.get(SCHEDULE_STEP).eq(SCHEDULE_LOOPBACK).invoke('text').should('eql', '1m');
});
});
diff --git a/x-pack/plugins/security_solution/cypress/integration/cases.spec.ts b/x-pack/plugins/security_solution/cypress/integration/cases.spec.ts
index 9438c28f05fef..6194d6892d799 100644
--- a/x-pack/plugins/security_solution/cypress/integration/cases.spec.ts
+++ b/x-pack/plugins/security_solution/cypress/integration/cases.spec.ts
@@ -40,7 +40,7 @@ import { TIMELINE_DESCRIPTION, TIMELINE_QUERY, TIMELINE_TITLE } from '../screens
import { goToCaseDetails, goToCreateNewCase } from '../tasks/all_cases';
import { openCaseTimeline } from '../tasks/case_details';
-import { backToCases, createNewCase } from '../tasks/create_new_case';
+import { backToCases, createNewCaseWithTimeline } from '../tasks/create_new_case';
import { loginAndWaitForPageWithoutDateRange } from '../tasks/login';
import { esArchiverLoad, esArchiverUnload } from '../tasks/es_archiver';
@@ -58,7 +58,7 @@ describe('Cases', () => {
it('Creates a new case with timeline and opens the timeline', () => {
loginAndWaitForPageWithoutDateRange(CASES_URL);
goToCreateNewCase();
- createNewCase(case1);
+ createNewCaseWithTimeline(case1);
backToCases();
cy.get(ALL_CASES_PAGE_TITLE).should('have.text', 'Cases Beta');
diff --git a/x-pack/plugins/security_solution/cypress/integration/events_viewer.spec.ts b/x-pack/plugins/security_solution/cypress/integration/events_viewer.spec.ts
index 5f2de69689865..d193330dc54ff 100644
--- a/x-pack/plugins/security_solution/cypress/integration/events_viewer.spec.ts
+++ b/x-pack/plugins/security_solution/cypress/integration/events_viewer.spec.ts
@@ -47,7 +47,8 @@ const defaultHeadersInDefaultEcsCategory = [
{ id: 'destination.ip' },
];
-describe('Events Viewer', () => {
+// https://github.com/elastic/kibana/issues/70757
+describe.skip('Events Viewer', () => {
context('Fields rendering', () => {
before(() => {
loginAndWaitForPage(HOSTS_URL);
diff --git a/x-pack/plugins/security_solution/cypress/integration/timeline_attach_to_case.spec.ts b/x-pack/plugins/security_solution/cypress/integration/timeline_attach_to_case.spec.ts
new file mode 100644
index 0000000000000..6af4d174b9583
--- /dev/null
+++ b/x-pack/plugins/security_solution/cypress/integration/timeline_attach_to_case.spec.ts
@@ -0,0 +1,76 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License;
+ * you may not use this file except in compliance with the Elastic License.
+ */
+
+import { loginAndWaitForTimeline } from '../tasks/login';
+import {
+ attachTimelineToNewCase,
+ attachTimelineToExistingCase,
+ addNewCase,
+ selectCase,
+} from '../tasks/timeline';
+import { DESCRIPTION_INPUT } from '../screens/create_new_case';
+import { esArchiverLoad, esArchiverUnload } from '../tasks/es_archiver';
+import { caseTimeline, TIMELINE_CASE_ID } from '../objects/case';
+
+describe('attach timeline to case', () => {
+ beforeEach(() => {
+ loginAndWaitForTimeline(caseTimeline.id);
+ });
+ context('without cases created', () => {
+ before(() => {
+ esArchiverLoad('timeline');
+ });
+
+ after(() => {
+ esArchiverUnload('timeline');
+ });
+
+ it('attach timeline to a new case', () => {
+ attachTimelineToNewCase();
+
+ cy.location('origin').then((origin) => {
+ cy.get(DESCRIPTION_INPUT).should(
+ 'have.text',
+ `[${caseTimeline.title}](${origin}/app/security/timelines?timeline=(id:'${caseTimeline.id}',isOpen:!t))`
+ );
+ });
+ });
+
+ it('attach timeline to an existing case with no case', () => {
+ attachTimelineToExistingCase();
+ addNewCase();
+
+ cy.location('origin').then((origin) => {
+ cy.get(DESCRIPTION_INPUT).should(
+ 'have.text',
+ `[${caseTimeline.title}](${origin}/app/security/timelines?timeline=(id:'${caseTimeline.id}',isOpen:!t))`
+ );
+ });
+ });
+ });
+
+ context('with cases created', () => {
+ before(() => {
+ esArchiverLoad('case_and_timeline');
+ });
+
+ after(() => {
+ esArchiverUnload('case_and_timeline');
+ });
+
+ it('attach timeline to an existing case', () => {
+ attachTimelineToExistingCase();
+ selectCase(TIMELINE_CASE_ID);
+
+ cy.location('origin').then((origin) => {
+ cy.get(DESCRIPTION_INPUT).should(
+ 'have.text',
+ `[${caseTimeline.title}](${origin}/app/security/timelines?timeline=(id:'${caseTimeline.id}',isOpen:!t))`
+ );
+ });
+ });
+ });
+});
diff --git a/x-pack/plugins/security_solution/cypress/objects/case.ts b/x-pack/plugins/security_solution/cypress/objects/case.ts
index 12d3f925169af..084df31a604a3 100644
--- a/x-pack/plugins/security_solution/cypress/objects/case.ts
+++ b/x-pack/plugins/security_solution/cypress/objects/case.ts
@@ -4,7 +4,7 @@
* you may not use this file except in compliance with the Elastic License.
*/
-import { Timeline } from './timeline';
+import { Timeline, TimelineWithId } from './timeline';
export interface TestCase {
name: string;
@@ -21,10 +21,11 @@ export interface Connector {
password: string;
}
-const caseTimeline: Timeline = {
+export const caseTimeline: TimelineWithId = {
title: 'SIEM test',
description: 'description',
query: 'host.name:*',
+ id: '0162c130-78be-11ea-9718-118a926974a4',
};
export const case1: TestCase = {
@@ -41,3 +42,5 @@ export const serviceNowConnector: Connector = {
username: 'Username Name',
password: 'password',
};
+
+export const TIMELINE_CASE_ID = '68248e00-f689-11ea-9ab2-59238b522856';
diff --git a/x-pack/plugins/security_solution/cypress/objects/rule.ts b/x-pack/plugins/security_solution/cypress/objects/rule.ts
index df6b792296f9d..2a5c60815f450 100644
--- a/x-pack/plugins/security_solution/cypress/objects/rule.ts
+++ b/x-pack/plugins/security_solution/cypress/objects/rule.ts
@@ -27,6 +27,8 @@ export interface CustomRule {
customQuery: string;
name: string;
description: string;
+ index?: string[];
+ interval?: string;
severity: string;
riskScore: string;
tags: string[];
@@ -109,6 +111,29 @@ export const newRule: CustomRule = {
timelineId: '0162c130-78be-11ea-9718-118a926974a4',
};
+export const existingRule: CustomRule = {
+ customQuery: 'host.name:*',
+ name: 'Rule 1',
+ description: 'Description for Rule 1',
+ index: [
+ 'apm-*-transaction*',
+ 'auditbeat-*',
+ 'endgame-*',
+ 'filebeat-*',
+ 'packetbeat-*',
+ 'winlogbeat-*',
+ ],
+ interval: '4m',
+ severity: 'High',
+ riskScore: '19',
+ tags: ['rule1'],
+ referenceUrls: [],
+ falsePositivesExamples: [],
+ mitre: [],
+ note: 'This is my note',
+ timelineId: '',
+};
+
export const newOverrideRule: OverrideRule = {
customQuery: 'host.name:*',
name: 'New Rule Test',
@@ -156,3 +181,17 @@ export const machineLearningRule: MachineLearningRule = {
mitre: [mitre1],
note: '# test markdown',
};
+
+export const eqlRule: CustomRule = {
+ customQuery: 'process where process_name == "explorer.exe"',
+ name: 'New EQL Rule',
+ description: 'New EQL rule description.',
+ severity: 'High',
+ riskScore: '17',
+ tags: ['test', 'newRule'],
+ referenceUrls: ['https://www.google.com/', 'https://elastic.co/'],
+ falsePositivesExamples: ['False1', 'False2'],
+ mitre: [mitre1, mitre2],
+ note: '# test markdown',
+ timelineId: '0162c130-78be-11ea-9718-118a926974a4',
+};
diff --git a/x-pack/plugins/security_solution/cypress/objects/timeline.ts b/x-pack/plugins/security_solution/cypress/objects/timeline.ts
index 060a1376b46ce..ff7e80e5661ad 100644
--- a/x-pack/plugins/security_solution/cypress/objects/timeline.ts
+++ b/x-pack/plugins/security_solution/cypress/objects/timeline.ts
@@ -9,3 +9,7 @@ export interface Timeline {
description: string;
query: string;
}
+
+export interface TimelineWithId extends Timeline {
+ id: string;
+}
diff --git a/x-pack/plugins/security_solution/cypress/screens/alerts_detection_rules.ts b/x-pack/plugins/security_solution/cypress/screens/alerts_detection_rules.ts
index a41b8296f83e4..14f5383939a94 100644
--- a/x-pack/plugins/security_solution/cypress/screens/alerts_detection_rules.ts
+++ b/x-pack/plugins/security_solution/cypress/screens/alerts_detection_rules.ts
@@ -14,6 +14,8 @@ export const CUSTOM_RULES_BTN = '[data-test-subj="show-custom-rules-filter-butto
export const DELETE_RULE_ACTION_BTN = '[data-test-subj="deleteRuleAction"]';
+export const EDIT_RULE_ACTION_BTN = '[data-test-subj="editRuleAction"]';
+
export const DELETE_RULE_BULK_BTN = '[data-test-subj="deleteRuleBulk"]';
export const ELASTIC_RULES_BTN = '[data-test-subj="show-elastic-rules-filter-button"]';
diff --git a/x-pack/plugins/security_solution/cypress/screens/all_cases.ts b/x-pack/plugins/security_solution/cypress/screens/all_cases.ts
index 4fa6b69eea7c3..dc0e764744f84 100644
--- a/x-pack/plugins/security_solution/cypress/screens/all_cases.ts
+++ b/x-pack/plugins/security_solution/cypress/screens/all_cases.ts
@@ -4,6 +4,10 @@
* you may not use this file except in compliance with the Elastic License.
*/
+export const ALL_CASES_CASE = (id: string) => {
+ return `[data-test-subj="cases-table-row-${id}"]`;
+};
+
export const ALL_CASES_CLOSE_ACTION = '[data-test-subj="action-close"]';
export const ALL_CASES_CLOSED_CASES_COUNT = '[data-test-subj="closed-case-count"]';
@@ -14,6 +18,8 @@ export const ALL_CASES_COMMENTS_COUNT = '[data-test-subj="case-table-column-comm
export const ALL_CASES_CREATE_NEW_CASE_BTN = '[data-test-subj="createNewCaseBtn"]';
+export const ALL_CASES_CREATE_NEW_CASE_TABLE_BTN = '[data-test-subj="cases-table-add-case"]';
+
export const ALL_CASES_DELETE_ACTION = '[data-test-subj="action-delete"]';
export const ALL_CASES_NAME = '[data-test-subj="case-details-link"]';
diff --git a/x-pack/plugins/security_solution/cypress/screens/create_new_case.ts b/x-pack/plugins/security_solution/cypress/screens/create_new_case.ts
index 6e2beb78fff19..9431c054d96a4 100644
--- a/x-pack/plugins/security_solution/cypress/screens/create_new_case.ts
+++ b/x-pack/plugins/security_solution/cypress/screens/create_new_case.ts
@@ -6,8 +6,7 @@
export const BACK_TO_CASES_BTN = '[data-test-subj="backToCases"]';
-export const DESCRIPTION_INPUT =
- '[data-test-subj="caseDescription"] [data-test-subj="textAreaInput"]';
+export const DESCRIPTION_INPUT = '[data-test-subj="textAreaInput"]';
export const INSERT_TIMELINE_BTN = '[data-test-subj="insert-timeline-button"]';
diff --git a/x-pack/plugins/security_solution/cypress/screens/create_new_rule.ts b/x-pack/plugins/security_solution/cypress/screens/create_new_rule.ts
index 397d0c0142179..dda371126d5aa 100644
--- a/x-pack/plugins/security_solution/cypress/screens/create_new_rule.ts
+++ b/x-pack/plugins/security_solution/cypress/screens/create_new_rule.ts
@@ -8,6 +8,13 @@ export const ABOUT_CONTINUE_BTN = '[data-test-subj="about-continue"]';
export const ABOUT_EDIT_BUTTON = '[data-test-subj="edit-about-rule"]';
+export const ABOUT_EDIT_TAB = '[data-test-subj="edit-rule-about-tab"]';
+
+export const ACTIONS_EDIT_TAB = '[data-test-subj="edit-rule-actions-tab"]';
+
+export const ACTIONS_THROTTLE_INPUT =
+ '[data-test-subj="stepRuleActions"] [data-test-subj="select"]';
+
export const ADD_FALSE_POSITIVE_BTN =
'[data-test-subj="detectionEngineStepAboutRuleFalsePositives"] .euiButtonEmpty__text';
@@ -30,6 +37,15 @@ export const DEFINE_CONTINUE_BUTTON = '[data-test-subj="define-continue"]';
export const DEFINE_EDIT_BUTTON = '[data-test-subj="edit-define-rule"]';
+export const DEFINE_EDIT_TAB = '[data-test-subj="edit-rule-define-tab"]';
+
+export const DEFINE_INDEX_INPUT =
+ '[data-test-subj="detectionEngineStepDefineRuleIndices"] [data-test-subj="input"]';
+
+export const EQL_TYPE = '[data-test-subj="eqlRuleType"]';
+
+export const EQL_QUERY_INPUT = '[data-test-subj="eqlQueryBarTextInput"]';
+
export const IMPORT_QUERY_FROM_SAVED_TIMELINE_LINK =
'[data-test-subj="importQueryFromSavedTimeline"]';
@@ -77,6 +93,20 @@ export const RULE_TIMESTAMP_OVERRIDE =
export const SCHEDULE_CONTINUE_BUTTON = '[data-test-subj="schedule-continue"]';
+export const SCHEDULE_EDIT_TAB = '[data-test-subj="edit-rule-schedule-tab"]';
+
+export const SCHEDULE_INTERVAL_AMOUNT_INPUT =
+ '[data-test-subj="detectionEngineStepScheduleRuleInterval"] [data-test-subj="schedule-amount-input"]';
+
+export const SCHEDULE_INTERVAL_UNITS_INPUT =
+ '[data-test-subj="detectionEngineStepScheduleRuleInterval"] [data-test-subj="schedule-units-input"]';
+
+export const SCHEDULE_LOOKBACK_AMOUNT_INPUT =
+ '[data-test-subj="detectionEngineStepScheduleRuleFrom"] [data-test-subj="schedule-amount-input"]';
+
+export const SCHEDULE_LOOKBACK_UNITS_INPUT =
+ '[data-test-subj="detectionEngineStepScheduleRuleFrom"] [data-test-subj="schedule-units-input"]';
+
export const SEVERITY_DROPDOWN =
'[data-test-subj="detectionEngineStepAboutRuleSeverity"] [data-test-subj="select"]';
@@ -84,6 +114,9 @@ export const SEVERITY_MAPPING_OVERRIDE_OPTION = '#severity-mapping-override';
export const SEVERITY_OVERRIDE_ROW = '[data-test-subj="severityOverrideRow"]';
+export const TAGS_FIELD =
+ '[data-test-subj="detectionEngineStepAboutRuleTags"] [data-test-subj="comboBoxInput"]';
+
export const TAGS_INPUT =
'[data-test-subj="detectionEngineStepAboutRuleTags"] [data-test-subj="comboBoxSearchInput"]';
diff --git a/x-pack/plugins/security_solution/cypress/screens/edit_rule.ts b/x-pack/plugins/security_solution/cypress/screens/edit_rule.ts
new file mode 100644
index 0000000000000..1bf0ff34ebd94
--- /dev/null
+++ b/x-pack/plugins/security_solution/cypress/screens/edit_rule.ts
@@ -0,0 +1,7 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License;
+ * you may not use this file except in compliance with the Elastic License.
+ */
+
+export const EDIT_SUBMIT_BUTTON = '[data-test-subj="ruleEditSubmitButton"]';
diff --git a/x-pack/plugins/security_solution/cypress/screens/rule_details.ts b/x-pack/plugins/security_solution/cypress/screens/rule_details.ts
index b221709966943..98fc7b06a9908 100644
--- a/x-pack/plugins/security_solution/cypress/screens/rule_details.ts
+++ b/x-pack/plugins/security_solution/cypress/screens/rule_details.ts
@@ -4,55 +4,21 @@
* you may not use this file except in compliance with the Elastic License.
*/
-export const ABOUT_FALSE_POSITIVES = 3;
+export const getDescriptionForTitle = (title: string) =>
+ cy.get(DETAILS_TITLE).contains(title).next(DETAILS_DESCRIPTION);
-export const ABOUT_INVESTIGATION_NOTES = '[data-test-subj="stepAboutDetailsNoteContent"]';
-
-export const ABOUT_MITRE = 4;
-
-export const ABOUT_OVERRIDE_FALSE_POSITIVES = 8;
-
-export const ABOUT_OVERRIDE_MITRE = 10;
-
-export const ABOUT_OVERRIDE_NAME_OVERRIDE = 9;
-
-export const ABOUT_OVERRIDE_RISK = 5;
+export const DETAILS_DESCRIPTION = '.euiDescriptionList__description';
+export const DETAILS_TITLE = '.euiDescriptionList__title';
-export const ABOUT_OVERRIDE_RISK_OVERRIDE = 6;
-
-export const ABOUT_OVERRIDE_SEVERITY_OVERRIDE = 1;
-
-export const ABOUT_OVERRIDE_TAGS = 12;
-
-export const ABOUT_OVERRIDE_TIMESTAMP_OVERRIDE = 11;
-
-export const ABOUT_OVERRIDE_URLS = 7;
+export const ABOUT_INVESTIGATION_NOTES = '[data-test-subj="stepAboutDetailsNoteContent"]';
export const ABOUT_RULE_DESCRIPTION = '[data-test-subj=stepAboutRuleDetailsToggleDescriptionText]';
-export const ABOUT_RISK = 1;
+export const ABOUT_DETAILS =
+ '[data-test-subj="aboutRule"] [data-test-subj="listItemColumnStepRuleDescription"]';
-export const ABOUT_SEVERITY = 0;
-
-export const ABOUT_STEP = '[data-test-subj="aboutRule"] .euiDescriptionList__description';
-
-export const ABOUT_TAGS = 5;
-
-export const ABOUT_URLS = 2;
-
-export const ANOMALY_SCORE = 1;
-
-export const DEFINITION_CUSTOM_QUERY = 1;
-
-export const DEFINITION_THRESHOLD = 4;
-
-export const DEFINITION_TIMELINE = 3;
-
-export const DEFINITION_INDEX_PATTERNS =
- '[data-test-subj=definitionRule] [data-test-subj="listItemColumnStepRuleDescription"] .euiDescriptionList__description .euiBadge__text';
-
-export const DEFINITION_STEP =
- '[data-test-subj=definitionRule] [data-test-subj="listItemColumnStepRuleDescription"] .euiDescriptionList__description';
+export const DEFINITION_DETAILS =
+ '[data-test-subj=definitionRule] [data-test-subj="listItemColumnStepRuleDescription"]';
export const INVESTIGATION_NOTES_MARKDOWN = 'test markdown';
@@ -60,16 +26,13 @@ export const INVESTIGATION_NOTES_TOGGLE = 1;
export const MACHINE_LEARNING_JOB_ID = '[data-test-subj="machineLearningJobId"]';
-export const MACHINE_LEARNING_JOB_STATUS = '[data-test-subj="machineLearningJobStatus" ]';
+export const MACHINE_LEARNING_JOB_STATUS = '[data-test-subj="machineLearningJobStatus"]';
export const RULE_ABOUT_DETAILS_HEADER_TOGGLE = '[data-test-subj="stepAboutDetailsToggle"]';
export const RULE_NAME_HEADER = '[data-test-subj="header-page-title"]';
-export const RULE_TYPE = 0;
+export const SCHEDULE_DETAILS =
+ '[data-test-subj=schedule] [data-test-subj="listItemColumnStepRuleDescription"]';
export const SCHEDULE_STEP = '[data-test-subj="schedule"] .euiDescriptionList__description';
-
-export const SCHEDULE_RUNS = 0;
-
-export const SCHEDULE_LOOPBACK = 1;
diff --git a/x-pack/plugins/security_solution/cypress/screens/timeline.ts b/x-pack/plugins/security_solution/cypress/screens/timeline.ts
index fd41cd63fc090..bcb64fc947feb 100644
--- a/x-pack/plugins/security_solution/cypress/screens/timeline.ts
+++ b/x-pack/plugins/security_solution/cypress/screens/timeline.ts
@@ -4,8 +4,17 @@
* you may not use this file except in compliance with the Elastic License.
*/
+export const ATTACH_TIMELINE_TO_NEW_CASE_ICON = '[data-test-subj="attach-timeline-case"]';
+
+export const ATTACH_TIMELINE_TO_EXISTING_CASE_ICON =
+ '[data-test-subj="attach-timeline-existing-case"]';
+
export const BULK_ACTIONS = '[data-test-subj="utility-bar-action-button"]';
+export const CASE = (id: string) => {
+ return `[data-test-subj="cases-table-row-${id}"]`;
+};
+
export const CLOSE_TIMELINE_BTN = '[data-test-subj="close-timeline"]';
export const CREATE_NEW_TIMELINE = '[data-test-subj="timeline-new"]';
@@ -25,6 +34,8 @@ export const ID_FIELD = '[data-test-subj="timeline"] [data-test-subj="field-name
export const ID_TOGGLE_FIELD = '[data-test-subj="toggle-field-_id"]';
+export const OPEN_TIMELINE_ICON = '[data-test-subj="open-timeline-button"]';
+
export const PIN_EVENT = '[data-test-subj="pin"]';
export const PROVIDER_BADGE = '[data-test-subj="providerBadge"]';
diff --git a/x-pack/plugins/security_solution/cypress/tasks/alerts_detection_rules.ts b/x-pack/plugins/security_solution/cypress/tasks/alerts_detection_rules.ts
index 5ec5bb97250db..c530594508f95 100644
--- a/x-pack/plugins/security_solution/cypress/tasks/alerts_detection_rules.ts
+++ b/x-pack/plugins/security_solution/cypress/tasks/alerts_detection_rules.ts
@@ -24,6 +24,7 @@ import {
SORT_RULES_BTN,
THREE_HUNDRED_ROWS,
EXPORT_ACTION_BTN,
+ EDIT_RULE_ACTION_BTN,
} from '../screens/alerts_detection_rules';
export const activateRule = (rulePosition: number) => {
@@ -35,6 +36,11 @@ export const changeToThreeHundredRowsPerPage = () => {
cy.get(THREE_HUNDRED_ROWS).click();
};
+export const editFirstRule = () => {
+ cy.get(COLLAPSED_ACTION_BTN).first().click({ force: true });
+ cy.get(EDIT_RULE_ACTION_BTN).click();
+};
+
export const deleteFirstRule = () => {
cy.get(COLLAPSED_ACTION_BTN).first().click({ force: true });
cy.get(DELETE_RULE_ACTION_BTN).click();
diff --git a/x-pack/plugins/security_solution/cypress/tasks/create_new_case.ts b/x-pack/plugins/security_solution/cypress/tasks/create_new_case.ts
index b2cde23a8dce2..1d5d240c5c53d 100644
--- a/x-pack/plugins/security_solution/cypress/tasks/create_new_case.ts
+++ b/x-pack/plugins/security_solution/cypress/tasks/create_new_case.ts
@@ -29,6 +29,18 @@ export const createNewCase = (newCase: TestCase) => {
});
cy.get(DESCRIPTION_INPUT).type(`${newCase.description} `, { force: true });
+ cy.get(SUBMIT_BTN).click({ force: true });
+ cy.get(LOADING_SPINNER).should('exist');
+ cy.get(LOADING_SPINNER).should('not.exist');
+};
+
+export const createNewCaseWithTimeline = (newCase: TestCase) => {
+ cy.get(TITLE_INPUT).type(newCase.name, { force: true });
+ newCase.tags.forEach((tag) => {
+ cy.get(TAGS_INPUT).type(`${tag}{enter}`, { force: true });
+ });
+ cy.get(DESCRIPTION_INPUT).type(`${newCase.description} `, { force: true });
+
cy.get(INSERT_TIMELINE_BTN).click({ force: true });
cy.get(TIMELINE_SEARCHBOX).type(`${newCase.timeline.title}{enter}`);
cy.get(TIMELINE).should('be.visible');
diff --git a/x-pack/plugins/security_solution/cypress/tasks/create_new_rule.ts b/x-pack/plugins/security_solution/cypress/tasks/create_new_rule.ts
index 3fa300ce9d8d0..0daff52de7063 100644
--- a/x-pack/plugins/security_solution/cypress/tasks/create_new_rule.ts
+++ b/x-pack/plugins/security_solution/cypress/tasks/create_new_rule.ts
@@ -13,14 +13,17 @@ import {
} from '../objects/rule';
import {
ABOUT_CONTINUE_BTN,
- ANOMALY_THRESHOLD_INPUT,
+ ABOUT_EDIT_TAB,
+ ACTIONS_EDIT_TAB,
ADD_FALSE_POSITIVE_BTN,
ADD_REFERENCE_URL_BTN,
ADVANCED_SETTINGS_BTN,
+ ANOMALY_THRESHOLD_INPUT,
COMBO_BOX_INPUT,
CREATE_AND_ACTIVATE_BTN,
CUSTOM_QUERY_INPUT,
DEFINE_CONTINUE_BUTTON,
+ DEFINE_EDIT_TAB,
FALSE_POSITIVES_INPUT,
IMPORT_QUERY_FROM_SAVED_TIMELINE_LINK,
INPUT,
@@ -32,8 +35,8 @@ import {
MITRE_TACTIC,
MITRE_TACTIC_DROPDOWN,
MITRE_TECHNIQUES_INPUT,
- RISK_INPUT,
REFERENCE_URLS_INPUT,
+ RISK_INPUT,
RISK_MAPPING_OVERRIDE_OPTION,
RISK_OVERRIDE,
RULE_DESCRIPTION_INPUT,
@@ -41,6 +44,7 @@ import {
RULE_NAME_OVERRIDE,
RULE_TIMESTAMP_OVERRIDE,
SCHEDULE_CONTINUE_BUTTON,
+ SCHEDULE_EDIT_TAB,
SEVERITY_DROPDOWN,
SEVERITY_MAPPING_OVERRIDE_OPTION,
SEVERITY_OVERRIDE_ROW,
@@ -48,8 +52,8 @@ import {
THRESHOLD_FIELD_SELECTION,
THRESHOLD_INPUT_AREA,
THRESHOLD_TYPE,
- DEFINE_EDIT_BUTTON,
- ABOUT_EDIT_BUTTON,
+ EQL_TYPE,
+ EQL_QUERY_INPUT,
} from '../screens/create_new_rule';
import { TIMELINE } from '../screens/timeline';
@@ -59,11 +63,9 @@ export const createAndActivateRule = () => {
cy.get(CREATE_AND_ACTIVATE_BTN).should('not.exist');
};
-export const fillAboutRuleAndContinue = (
- rule: CustomRule | MachineLearningRule | ThresholdRule
-) => {
- cy.get(RULE_NAME_INPUT).type(rule.name, { force: true });
- cy.get(RULE_DESCRIPTION_INPUT).type(rule.description, { force: true });
+export const fillAboutRule = (rule: CustomRule | MachineLearningRule | ThresholdRule) => {
+ cy.get(RULE_NAME_INPUT).clear({ force: true }).type(rule.name, { force: true });
+ cy.get(RULE_DESCRIPTION_INPUT).clear({ force: true }).type(rule.description, { force: true });
cy.get(SEVERITY_DROPDOWN).click({ force: true });
cy.get(`#${rule.severity.toLowerCase()}`).click();
@@ -77,12 +79,15 @@ export const fillAboutRuleAndContinue = (
cy.get(ADVANCED_SETTINGS_BTN).click({ force: true });
rule.referenceUrls.forEach((url, index) => {
- cy.get(REFERENCE_URLS_INPUT).eq(index).type(url, { force: true });
+ cy.get(REFERENCE_URLS_INPUT).eq(index).clear({ force: true }).type(url, { force: true });
cy.get(ADD_REFERENCE_URL_BTN).click({ force: true });
});
rule.falsePositivesExamples.forEach((falsePositive, index) => {
- cy.get(FALSE_POSITIVES_INPUT).eq(index).type(falsePositive, { force: true });
+ cy.get(FALSE_POSITIVES_INPUT)
+ .eq(index)
+ .clear({ force: true })
+ .type(falsePositive, { force: true });
cy.get(ADD_FALSE_POSITIVE_BTN).click({ force: true });
});
@@ -91,14 +96,22 @@ export const fillAboutRuleAndContinue = (
cy.contains(MITRE_TACTIC, mitre.tactic).click();
mitre.techniques.forEach((technique) => {
- cy.get(MITRE_TECHNIQUES_INPUT).eq(index).type(`${technique}{enter}`, { force: true });
+ cy.get(MITRE_TECHNIQUES_INPUT)
+ .eq(index)
+ .clear({ force: true })
+ .type(`${technique}{enter}`, { force: true });
});
cy.get(MITRE_BTN).click({ force: true });
});
- cy.get(INVESTIGATION_NOTES_TEXTAREA).type(rule.note, { force: true });
+ cy.get(INVESTIGATION_NOTES_TEXTAREA).clear({ force: true }).type(rule.note, { force: true });
+};
+export const fillAboutRuleAndContinue = (
+ rule: CustomRule | MachineLearningRule | ThresholdRule
+) => {
+ fillAboutRule(rule);
cy.get(ABOUT_CONTINUE_BTN).should('exist').click({ force: true });
};
@@ -177,20 +190,6 @@ export const fillDefineCustomRuleWithImportedQueryAndContinue = (
cy.get(CUSTOM_QUERY_INPUT).should('not.exist');
};
-export const expectDefineFormToRepopulateAndContinue = (rule: CustomRule) => {
- cy.get(DEFINE_EDIT_BUTTON).click();
- cy.get(CUSTOM_QUERY_INPUT).invoke('text').should('eq', rule.customQuery);
- cy.get(DEFINE_CONTINUE_BUTTON).should('exist').click({ force: true });
- cy.get(DEFINE_CONTINUE_BUTTON).should('not.exist');
-};
-
-export const expectAboutFormToRepopulateAndContinue = (rule: CustomRule) => {
- cy.get(ABOUT_EDIT_BUTTON).click();
- cy.get(RULE_NAME_INPUT).invoke('val').should('eq', rule.name);
- cy.get(ABOUT_CONTINUE_BTN).should('exist').click({ force: true });
- cy.get(ABOUT_CONTINUE_BTN).should('not.exist');
-};
-
export const fillDefineThresholdRuleAndContinue = (rule: ThresholdRule) => {
const thresholdField = 0;
const threshold = 1;
@@ -209,6 +208,14 @@ export const fillDefineThresholdRuleAndContinue = (rule: ThresholdRule) => {
cy.get(CUSTOM_QUERY_INPUT).should('not.exist');
};
+export const fillDefineEqlRuleAndContinue = (rule: CustomRule) => {
+ cy.get(EQL_QUERY_INPUT).type(rule.customQuery);
+ cy.get(EQL_QUERY_INPUT).invoke('text').should('eq', rule.customQuery);
+ cy.get(DEFINE_CONTINUE_BUTTON).should('exist').click({ force: true });
+
+ cy.get(EQL_QUERY_INPUT).should('not.exist');
+};
+
export const fillDefineMachineLearningRuleAndContinue = (rule: MachineLearningRule) => {
cy.get(MACHINE_LEARNING_DROPDOWN).click({ force: true });
cy.contains(MACHINE_LEARNING_LIST, rule.machineLearningJob).click();
@@ -220,6 +227,22 @@ export const fillDefineMachineLearningRuleAndContinue = (rule: MachineLearningRu
cy.get(MACHINE_LEARNING_DROPDOWN).should('not.exist');
};
+export const goToDefineStepTab = () => {
+ cy.get(DEFINE_EDIT_TAB).click({ force: true });
+};
+
+export const goToAboutStepTab = () => {
+ cy.get(ABOUT_EDIT_TAB).click({ force: true });
+};
+
+export const goToScheduleStepTab = () => {
+ cy.get(SCHEDULE_EDIT_TAB).click({ force: true });
+};
+
+export const goToActionsStepTab = () => {
+ cy.get(ACTIONS_EDIT_TAB).click({ force: true });
+};
+
export const selectMachineLearningRuleType = () => {
cy.get(MACHINE_LEARNING_TYPE).click({ force: true });
};
@@ -227,3 +250,7 @@ export const selectMachineLearningRuleType = () => {
export const selectThresholdRuleType = () => {
cy.get(THRESHOLD_TYPE).click({ force: true });
};
+
+export const selectEqlRuleType = () => {
+ cy.get(EQL_TYPE).click({ force: true });
+};
diff --git a/x-pack/plugins/security_solution/cypress/tasks/edit_rule.ts b/x-pack/plugins/security_solution/cypress/tasks/edit_rule.ts
new file mode 100644
index 0000000000000..690a36058ec33
--- /dev/null
+++ b/x-pack/plugins/security_solution/cypress/tasks/edit_rule.ts
@@ -0,0 +1,12 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License;
+ * you may not use this file except in compliance with the Elastic License.
+ */
+
+import { EDIT_SUBMIT_BUTTON } from '../screens/edit_rule';
+
+export const saveEditedRule = () => {
+ cy.get(EDIT_SUBMIT_BUTTON).should('exist').click({ force: true });
+ cy.get(EDIT_SUBMIT_BUTTON).should('not.exist');
+};
diff --git a/x-pack/plugins/security_solution/cypress/tasks/login.ts b/x-pack/plugins/security_solution/cypress/tasks/login.ts
index ca23a1defd4f5..65f821ec5bfb7 100644
--- a/x-pack/plugins/security_solution/cypress/tasks/login.ts
+++ b/x-pack/plugins/security_solution/cypress/tasks/login.ts
@@ -5,6 +5,7 @@
*/
import * as yaml from 'js-yaml';
+import { TIMELINE_FLYOUT_BODY } from '../screens/timeline';
/**
* Credentials in the `kibana.dev.yml` config file will be used to authenticate
@@ -143,3 +144,11 @@ export const loginAndWaitForPageWithoutDateRange = (url: string) => {
cy.visit(url);
cy.get('[data-test-subj="headerGlobalNav"]', { timeout: 120000 });
};
+
+export const loginAndWaitForTimeline = (timelineId: string) => {
+ login();
+ cy.viewport('macbook-15');
+ cy.visit(`/app/security/timelines?timeline=(id:'${timelineId}',isOpen:!t)`);
+ cy.get('[data-test-subj="headerGlobalNav"]');
+ cy.get(TIMELINE_FLYOUT_BODY).should('be.visible');
+};
diff --git a/x-pack/plugins/security_solution/cypress/tasks/timeline.ts b/x-pack/plugins/security_solution/cypress/tasks/timeline.ts
index 6fb8bb5e29ae5..cd8b197fc4dec 100644
--- a/x-pack/plugins/security_solution/cypress/tasks/timeline.ts
+++ b/x-pack/plugins/security_solution/cypress/tasks/timeline.ts
@@ -4,6 +4,7 @@
* you may not use this file except in compliance with the Elastic License.
*/
+import { ALL_CASES_CREATE_NEW_CASE_TABLE_BTN } from '../screens/all_cases';
import {
BULK_ACTIONS,
CLOSE_TIMELINE_BTN,
@@ -28,6 +29,10 @@ import {
TOGGLE_TIMELINE_EXPAND_EVENT,
REMOVE_COLUMN,
RESET_FIELDS,
+ ATTACH_TIMELINE_TO_NEW_CASE_ICON,
+ OPEN_TIMELINE_ICON,
+ ATTACH_TIMELINE_TO_EXISTING_CASE_ICON,
+ CASE,
} from '../screens/timeline';
import { drag, drop } from '../tasks/common';
@@ -44,6 +49,20 @@ export const addNameToTimeline = (name: string) => {
cy.get(TIMELINE_TITLE).should('have.attr', 'value', name);
};
+export const addNewCase = () => {
+ cy.get(ALL_CASES_CREATE_NEW_CASE_TABLE_BTN).click();
+};
+
+export const attachTimelineToNewCase = () => {
+ cy.get(TIMELINE_SETTINGS_ICON).click({ force: true });
+ cy.get(ATTACH_TIMELINE_TO_NEW_CASE_ICON).click({ force: true });
+};
+
+export const attachTimelineToExistingCase = () => {
+ cy.get(TIMELINE_SETTINGS_ICON).click({ force: true });
+ cy.get(ATTACH_TIMELINE_TO_EXISTING_CASE_ICON).click({ force: true });
+};
+
export const checkIdToggleField = () => {
cy.get(ID_HEADER_FIELD).should('not.exist');
@@ -85,6 +104,11 @@ export const openTimelineInspectButton = () => {
cy.get(TIMELINE_INSPECT_BUTTON).trigger('click', { force: true });
};
+export const openTimelineFromSettings = () => {
+ cy.get(TIMELINE_SETTINGS_ICON).click({ force: true });
+ cy.get(OPEN_TIMELINE_ICON).click({ force: true });
+};
+
export const openTimelineSettings = () => {
cy.get(TIMELINE_SETTINGS_ICON).trigger('click', { force: true });
};
@@ -132,6 +156,10 @@ export const resetFields = () => {
cy.get(RESET_FIELDS).click({ force: true });
};
+export const selectCase = (caseId: string) => {
+ cy.get(CASE(caseId)).click();
+};
+
export const waitForTimelinesPanelToBeLoaded = () => {
cy.get(TIMELINES_TABLE).should('exist');
};
diff --git a/x-pack/plugins/security_solution/public/cases/components/__mock__/form.ts b/x-pack/plugins/security_solution/public/cases/components/__mock__/form.ts
index 96c1217577ff2..87f8f46affb52 100644
--- a/x-pack/plugins/security_solution/public/cases/components/__mock__/form.ts
+++ b/x-pack/plugins/security_solution/public/cases/components/__mock__/form.ts
@@ -4,9 +4,15 @@
* you may not use this file except in compliance with the Elastic License.
*/
import { useForm } from '../../../../../../../src/plugins/es_ui_shared/static/forms/hook_form_lib/hooks/use_form';
+import { useFormData } from '../../../../../../../src/plugins/es_ui_shared/static/forms/hook_form_lib/hooks/use_form_data';
+
jest.mock(
'../../../../../../../src/plugins/es_ui_shared/static/forms/hook_form_lib/hooks/use_form'
);
+jest.mock(
+ '../../../../../../../src/plugins/es_ui_shared/static/forms/hook_form_lib/hooks/use_form_data'
+);
+
export const mockFormHook = {
isSubmitted: false,
isSubmitting: false,
@@ -41,3 +47,4 @@ export const getFormMock = (sampleData: any) => ({
});
export const useFormMock = useForm as jest.Mock;
+export const useFormDataMock = useFormData as jest.Mock;
diff --git a/x-pack/plugins/security_solution/public/cases/components/add_comment/index.test.tsx b/x-pack/plugins/security_solution/public/cases/components/add_comment/index.test.tsx
index f697ce443f2c5..a800bd690f710 100644
--- a/x-pack/plugins/security_solution/public/cases/components/add_comment/index.test.tsx
+++ b/x-pack/plugins/security_solution/public/cases/components/add_comment/index.test.tsx
@@ -15,6 +15,7 @@ import { Router, routeData, mockHistory, mockLocation } from '../__mock__/router
import { useInsertTimeline } from '../../../timelines/components/timeline/insert_timeline_popover/use_insert_timeline';
import { usePostComment } from '../../containers/use_post_comment';
import { useForm } from '../../../../../../../src/plugins/es_ui_shared/static/forms/hook_form_lib/hooks/use_form';
+import { useFormData } from '../../../../../../../src/plugins/es_ui_shared/static/forms/hook_form_lib/hooks/use_form_data';
// we don't have the types for waitFor just yet, so using "as waitFor" until when we do
import { wait as waitFor } from '@testing-library/react';
@@ -23,10 +24,15 @@ jest.mock(
'../../../../../../../src/plugins/es_ui_shared/static/forms/hook_form_lib/hooks/use_form'
);
+jest.mock(
+ '../../../../../../../src/plugins/es_ui_shared/static/forms/hook_form_lib/hooks/use_form_data'
+);
+
jest.mock('../../../timelines/components/timeline/insert_timeline_popover/use_insert_timeline');
jest.mock('../../containers/use_post_comment');
-export const useFormMock = useForm as jest.Mock;
+const useFormMock = useForm as jest.Mock;
+const useFormDataMock = useFormData as jest.Mock;
const useInsertTimelineMock = useInsertTimeline as jest.Mock;
const usePostCommentMock = usePostComment as jest.Mock;
@@ -73,6 +79,7 @@ describe('AddComment ', () => {
useInsertTimelineMock.mockImplementation(() => defaultInsertTimeline);
usePostCommentMock.mockImplementation(() => defaultPostCommment);
useFormMock.mockImplementation(() => ({ form: formHookMock }));
+ useFormDataMock.mockImplementation(() => [{ comment: sampleData.comment }]);
jest.spyOn(routeData, 'useLocation').mockReturnValue(mockLocation);
});
diff --git a/x-pack/plugins/security_solution/public/cases/components/add_comment/index.tsx b/x-pack/plugins/security_solution/public/cases/components/add_comment/index.tsx
index 87bd7bb247056..ef13c87a92dbb 100644
--- a/x-pack/plugins/security_solution/public/cases/components/add_comment/index.tsx
+++ b/x-pack/plugins/security_solution/public/cases/components/add_comment/index.tsx
@@ -14,7 +14,7 @@ import { Case } from '../../containers/types';
import { MarkdownEditorForm } from '../../../common/components/markdown_editor/form';
import { InsertTimelinePopover } from '../../../timelines/components/timeline/insert_timeline_popover';
import { useInsertTimeline } from '../../../timelines/components/timeline/insert_timeline_popover/use_insert_timeline';
-import { Form, useForm, UseField } from '../../../shared_imports';
+import { Form, useForm, UseField, useFormData } from '../../../shared_imports';
import * as i18n from './translations';
import { schema } from './schema';
@@ -46,23 +46,31 @@ export const AddComment = React.memo(
forwardRef(
({ caseId, disabled, showLoading = true, onCommentPosted, onCommentSaving }, ref) => {
const { isLoading, postComment } = usePostComment(caseId);
+
const { form } = useForm({
defaultValue: initialCommentValue,
options: { stripEmptyFields: false },
schema,
});
- const { getFormData, setFieldValue, reset, submit } = form;
- const { handleCursorChange, handleOnTimelineChange } = useInsertTimeline(
- form,
- 'comment'
+
+ const fieldName = 'comment';
+ const { setFieldValue, reset, submit } = form;
+ const [{ comment }] = useFormData({ form, watch: [fieldName] });
+
+ const onCommentChange = useCallback((newValue) => setFieldValue(fieldName, newValue), [
+ setFieldValue,
+ ]);
+
+ const { handleCursorChange, handleOnTimelineChange } = useInsertTimeline(
+ comment,
+ onCommentChange
);
const addQuote = useCallback(
(quote) => {
- const { comment } = getFormData();
- setFieldValue('comment', `${comment}${comment.length > 0 ? '\n\n' : ''}${quote}`);
+ setFieldValue(fieldName, `${comment}${comment.length > 0 ? '\n\n' : ''}${quote}`);
},
- [getFormData, setFieldValue]
+ [comment, setFieldValue]
);
useImperativeHandle(ref, () => ({
@@ -87,7 +95,7 @@ export const AddComment = React.memo(
{isLoading && showLoading && }