Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into np-migrate-file-u…
Browse files Browse the repository at this point in the history
…pload-client
  • Loading branch information
Aaron Caldwell committed Nov 21, 2019
2 parents 9bfc86d + bf2d6e7 commit c202aa8
Show file tree
Hide file tree
Showing 494 changed files with 12,114 additions and 7,939 deletions.
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@
/x-pack/test/api_integration/apis/security/ @elastic/kibana-security

# Kibana Stack Services
/src/dev/i18n @elastic/kibana-stack-services
/packages/kbn-analytics/ @elastic/kibana-stack-services
/src/legacy/core_plugins/ui_metric/ @elastic/kibana-stack-services
/x-pack/legacy/plugins/telemetry @elastic/kibana-stack-services
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-public](./kibana-plugin-public.md) &gt; [PluginInitializerContext](./kibana-plugin-public.plugininitializercontext.md) &gt; [config](./kibana-plugin-public.plugininitializercontext.config.md)

## PluginInitializerContext.config property

<b>Signature:</b>

```typescript
readonly config: {
get: <T extends object = ConfigSchema>() => T;
};
```
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,14 @@ The available core services passed to a `PluginInitializer`
<b>Signature:</b>

```typescript
export interface PluginInitializerContext
export interface PluginInitializerContext<ConfigSchema extends object = object>
```

## Properties

| Property | Type | Description |
| --- | --- | --- |
| [config](./kibana-plugin-public.plugininitializercontext.config.md) | <code>{</code><br/><code> get: &lt;T extends object = ConfigSchema&gt;() =&gt; T;</code><br/><code> }</code> | |
| [env](./kibana-plugin-public.plugininitializercontext.env.md) | <code>{</code><br/><code> mode: Readonly&lt;EnvironmentMode&gt;;</code><br/><code> packageInfo: Readonly&lt;PackageInfo&gt;;</code><br/><code> }</code> | |
| [opaqueId](./kibana-plugin-public.plugininitializercontext.opaqueid.md) | <code>PluginOpaqueId</code> | A symbol used to identify this plugin in the system. Needed when registering handlers or context providers. |

2 changes: 2 additions & 0 deletions docs/development/core/server/kibana-plugin-server.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ The plugin integrates with the core system via lifecycle events: `setup`<!-- -->
| [OnPreAuthToolkit](./kibana-plugin-server.onpreauthtoolkit.md) | A tool set defining an outcome of OnPreAuth interceptor for incoming request. |
| [PackageInfo](./kibana-plugin-server.packageinfo.md) | |
| [Plugin](./kibana-plugin-server.plugin.md) | The interface that should be returned by a <code>PluginInitializer</code>. |
| [PluginConfigDescriptor](./kibana-plugin-server.pluginconfigdescriptor.md) | Describes a plugin configuration schema and capabilities. |
| [PluginInitializerContext](./kibana-plugin-server.plugininitializercontext.md) | Context that's available to plugins during initialization stage. |
| [PluginManifest](./kibana-plugin-server.pluginmanifest.md) | Describes the set of required and optional properties plugin can define in its mandatory JSON manifest file. |
| [PluginsServiceSetup](./kibana-plugin-server.pluginsservicesetup.md) | |
Expand Down Expand Up @@ -156,6 +157,7 @@ The plugin integrates with the core system via lifecycle events: `setup`<!-- -->
| [MutatingOperationRefreshSetting](./kibana-plugin-server.mutatingoperationrefreshsetting.md) | Elasticsearch Refresh setting for mutating operation |
| [OnPostAuthHandler](./kibana-plugin-server.onpostauthhandler.md) | See [OnPostAuthToolkit](./kibana-plugin-server.onpostauthtoolkit.md)<!-- -->. |
| [OnPreAuthHandler](./kibana-plugin-server.onpreauthhandler.md) | See [OnPreAuthToolkit](./kibana-plugin-server.onpreauthtoolkit.md)<!-- -->. |
| [PluginConfigSchema](./kibana-plugin-server.pluginconfigschema.md) | Dedicated type for plugin configuration schema. |
| [PluginInitializer](./kibana-plugin-server.plugininitializer.md) | The <code>plugin</code> export at the root of a plugin's <code>server</code> directory should conform to this interface. |
| [PluginName](./kibana-plugin-server.pluginname.md) | Dedicated type for plugin name/id that is supposed to make Map/Set/Arrays that use it as a key or value more obvious. |
| [PluginOpaqueId](./kibana-plugin-server.pluginopaqueid.md) | |
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-server](./kibana-plugin-server.md) &gt; [PluginConfigDescriptor](./kibana-plugin-server.pluginconfigdescriptor.md) &gt; [exposeToBrowser](./kibana-plugin-server.pluginconfigdescriptor.exposetobrowser.md)

## PluginConfigDescriptor.exposeToBrowser property

List of configuration properties that will be available on the client-side plugin.

<b>Signature:</b>

```typescript
exposeToBrowser?: {
[P in keyof T]?: boolean;
};
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-server](./kibana-plugin-server.md) &gt; [PluginConfigDescriptor](./kibana-plugin-server.pluginconfigdescriptor.md)

## PluginConfigDescriptor interface

Describes a plugin configuration schema and capabilities.

<b>Signature:</b>

```typescript
export interface PluginConfigDescriptor<T = any>
```

## Properties

| Property | Type | Description |
| --- | --- | --- |
| [exposeToBrowser](./kibana-plugin-server.pluginconfigdescriptor.exposetobrowser.md) | <code>{</code><br/><code> [P in keyof T]?: boolean;</code><br/><code> }</code> | List of configuration properties that will be available on the client-side plugin. |
| [schema](./kibana-plugin-server.pluginconfigdescriptor.schema.md) | <code>PluginConfigSchema&lt;T&gt;</code> | Schema to use to validate the plugin configuration.[PluginConfigSchema](./kibana-plugin-server.pluginconfigschema.md) |

## Example


```typescript
// my_plugin/server/index.ts
import { schema, TypeOf } from '@kbn/config-schema';
import { PluginConfigDescriptor } from 'kibana/server';
const configSchema = schema.object({
secret: schema.string({ defaultValue: 'Only on server' }),
uiProp: schema.string({ defaultValue: 'Accessible from client' }),
});
type ConfigType = TypeOf<typeof configSchema>;
export const config: PluginConfigDescriptor<ConfigType> = {
exposeToBrowser: {
uiProp: true,
},
schema: configSchema,
};
```

Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-server](./kibana-plugin-server.md) &gt; [PluginConfigDescriptor](./kibana-plugin-server.pluginconfigdescriptor.md) &gt; [schema](./kibana-plugin-server.pluginconfigdescriptor.schema.md)

## PluginConfigDescriptor.schema property

Schema to use to validate the plugin configuration.

[PluginConfigSchema](./kibana-plugin-server.pluginconfigschema.md)

<b>Signature:</b>

```typescript
schema: PluginConfigSchema<T>;
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-server](./kibana-plugin-server.md) &gt; [PluginConfigSchema](./kibana-plugin-server.pluginconfigschema.md)

## PluginConfigSchema type

Dedicated type for plugin configuration schema.

<b>Signature:</b>

```typescript
export declare type PluginConfigSchema<T> = Type<T>;
```
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,6 @@ export interface PluginsServiceSetup
| Property | Type | Description |
| --- | --- | --- |
| [contracts](./kibana-plugin-server.pluginsservicesetup.contracts.md) | <code>Map&lt;PluginName, unknown&gt;</code> | |
| [uiPluginConfigs](./kibana-plugin-server.pluginsservicesetup.uipluginconfigs.md) | <code>Map&lt;PluginName, Observable&lt;unknown&gt;&gt;</code> | |
| [uiPlugins](./kibana-plugin-server.pluginsservicesetup.uiplugins.md) | <code>{</code><br/><code> public: Map&lt;PluginName, DiscoveredPlugin&gt;;</code><br/><code> internal: Map&lt;PluginName, DiscoveredPluginInternal&gt;;</code><br/><code> }</code> | |

Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-server](./kibana-plugin-server.md) &gt; [PluginsServiceSetup](./kibana-plugin-server.pluginsservicesetup.md) &gt; [uiPluginConfigs](./kibana-plugin-server.pluginsservicesetup.uipluginconfigs.md)

## PluginsServiceSetup.uiPluginConfigs property

<b>Signature:</b>

```typescript
uiPluginConfigs: Map<PluginName, Observable<unknown>>;
```
Binary file added docs/logs/images/analysis-tab-create-ml-job.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/logs/images/log-rate-anomalies.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/logs/images/log-rate-entries.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/logs/images/log-time-filter.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions docs/logs/index.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,5 @@ include::getting-started.asciidoc[]
include::using.asciidoc[]

include::configuring.asciidoc[]

include::log-rate.asciidoc[]
94 changes: 94 additions & 0 deletions docs/logs/log-rate.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
[role="xpack"]
[[xpack-logs-analysis]]
== Detecting and inspecting log anomalies

beta::[]

When the {ml} {anomaly-detect} features are enabled,
you can use the **Log rate** page in the Logs app.
**Log rate** helps you to detect and inspect log anomalies and the log partitions where the log anomalies occur.
This means you can easily spot anomalous behavior without significant human intervention --
no more manually sampling log data, calculating rates, and determining if rates are normal.

*Log rate* automatically highlights periods of time where the log rate is outside expected bounds,
and therefore may be anomalous.
You can use this information as a basis for further investigations.
For example:

* A significant drop in the log rate might suggest that a piece of infrastructure stopped responding,
and thus we're serving less requests.
* A spike in the log rate could denote a DDoS attack.
This may lead to an investigation of IP addresses from incoming requests.

You can also view log anomalies directly in the <<xpack-ml-anomalies,Machine Learning app>>.

[float]
[[logs-analysis-create-ml-job]]
=== Enable log rate analysis and anomaly detection

Create a machine learning job to enable log rate analysis and anomaly detection.

[role="screenshot"]
image::logs/images/analysis-tab-create-ml-job.png[Create machine learning job]

1. To enable log rate analysis and anomaly detection,
you must first create your own {kibana-ref}/xpack-spaces.html[space].
2. Within a space, navigate to the Logs app and select *Log rate*.
Here, you'll be prompted to create a machine learning job which will carry out the log rate analysis.
3. Choose a time range for the machine learning analysis.
4. Add the Indices that contain the logs you want to analyze.
5. Click *Create ML job*.
6. You're now ready to analyze your log partitions.

Even though the machine learning job's time range is fixed,
you can still use the time filter to adjust the results that are shown in your analysis.

[role="screenshot"]
image::logs/images/log-time-filter.png[Log rate time filter]

[float]
[[logs-analysis-entries-chart]]
=== Log entries chart

The log entries chart shows an overall, color-coded visualization of the log entry rate,
partitioned according to the value of the Elastic Common Schema (ECS)
{ecs-ref}/ecs-event.html[`event.dataset`] field.
This chart helps you quickly spot increases or decreases in each partition's log rate.

[role="screenshot"]
image::logs/images/log-rate-entries.png[Log rate entries chart]

If you have a lot of log partitions, use the following to filter your data:

* Hover over a time range to see the log rate for each partition.
* Click or hover on a partition name to show, hide, or highlight the partition values.

[float]
[[logs-analysis-anomalies-chart]]
=== Anomalies charts

The Anomalies chart shows the time range where anomalies were detected.
The typical rate values are shown in grey, while the anomalous regions are color-coded and superimposed on top.

[role="screenshot"]
image::logs/images/log-rate-anomalies.png[Log rate entries chart]

When a time range is flagged as anomalous,
the machine learning algorithms have detected unusual log rate activity.
This might be because:

* The log rate is significantly higher than usual.
* The log rate is significantly lower than usual.
* Other anomalous behavior has been detected.
For example, the log rate is within bounds, but not fluctuating when it is expected to.

The level of anomaly detected in a time period is color-coded, from red, orange, yellow, to blue.
Red indicates a critical anomaly level, while blue is a warning level.

To help you further drill down into a potential anomaly,
you can view an anomaly chart for each individual partition:

Anomaly scores range from 0 (no anomalies) to 100 (critical).

To analyze the anomalies in more detail, click *Analyze in ML*, which opens the
{kibana-ref}/xpack-ml.html[Anomaly Explorer in Machine Learning].
15 changes: 13 additions & 2 deletions docs/logs/using.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,19 @@ This opens the *Log event document details* fly-out that shows the fields associ
To quickly filter the logs stream by one of the field values, in the log event details, click the *View event with filter* icon image:logs/images/logs-view-event-with-filter.png[View event icon] beside the field.
This automatically adds a search filter to the logs stream to filter the entries by this field and value.

To see other actions related to the event, in the log event details, click *Actions*.
Depending on the event and the features you have installed and configured, you may also be able to:
[float]
[[view-log-anomalies]]
=== View log anomalies

When the machine learning anomaly detection features are enabled, click *Log rate*, which allows you to
<<xpack-logs-analysis,use machine learning to detect and inspect anomalies>> in your log data.

[float]
[[logs-integrations]]
=== Logs app integrations

To see other actions related to the event, click *Actions* in the log event details.
Depending on the event and the features you have configured, you may also be able to:

* Select *View status in Uptime* to <<uptime-overview, view related uptime information>> in the *Uptime* app.
* Select *View in APM* to <<traces, view related APM traces>> in the *APM* app.
2 changes: 2 additions & 0 deletions docs/settings/security-settings.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ An arbitrary string of 32 characters or more that is used to encrypt credentials
in a cookie. It is crucial that this key is not exposed to users of {kib}. By
default, a value is automatically generated in memory. If you use that default
behavior, all sessions are invalidated when {kib} restarts.
In addition, high-availability deployments of {kib} will behave unexpectedly
if this setting isn't the same for all instances of {kib}.

`xpack.security.secureCookies`::
Sets the `secure` flag of the session cookie. The default value is `false`. It
Expand Down
6 changes: 3 additions & 3 deletions docs/setup/install/brew.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@ and data directory are stored in the following locations.
| Type | Description | Default Location | Setting
| home
| Kibana home directory or `$KIBANA_HOME`
| /usr/local/var/homebrew/linked/kibana
| /usr/local/var/homebrew/linked/kibana-full
d|

| bin
| Binary scripts including `kibana` to start a node
and `kibana-plugin` to install plugins
| /usr/local/var/homebrew/linked/kibana/bin
| /usr/local/var/homebrew/linked/kibana-full/bin
d|

| conf
Expand All @@ -59,7 +59,7 @@ and data directory are stored in the following locations.

| plugins
| Plugin files location. Each plugin will be contained in a subdirectory.
| /usr/local/var/homebrew/linked/kibana/plugins
| /usr/local/var/homebrew/linked/kibana-full/plugins
d|

|=======================================================================
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@
"@elastic/charts": "^14.0.0",
"@elastic/datemath": "5.0.2",
"@elastic/ems-client": "1.0.5",
"@elastic/eui": "14.9.0",
"@elastic/eui": "16.0.0",
"@elastic/filesaver": "1.1.2",
"@elastic/good": "8.1.1-kibana2",
"@elastic/numeral": "2.3.3",
Expand Down Expand Up @@ -340,7 +340,7 @@
"@types/semver": "^5.5.0",
"@types/sinon": "^7.0.13",
"@types/strip-ansi": "^3.0.0",
"@types/styled-components": "^3.0.2",
"@types/styled-components": "^4.4.0",
"@types/supertest": "^2.0.5",
"@types/supertest-as-promised": "^2.0.38",
"@types/type-detect": "^4.0.1",
Expand All @@ -366,9 +366,9 @@
"dedent": "^0.7.0",
"delete-empty": "^2.0.0",
"enzyme": "^3.10.0",
"enzyme-adapter-react-16": "^1.14.0",
"enzyme-adapter-utils": "^1.12.0",
"enzyme-to-json": "^3.3.4",
"enzyme-adapter-react-16": "^1.15.1",
"enzyme-adapter-utils": "^1.12.1",
"enzyme-to-json": "^3.4.3",
"eslint": "^6.5.1",
"eslint-config-prettier": "^6.4.0",
"eslint-plugin-babel": "^5.3.0",
Expand Down Expand Up @@ -421,7 +421,7 @@
"license-checker": "^16.0.0",
"listr": "^0.14.1",
"load-grunt-config": "^3.0.1",
"mocha": "6.2.1",
"mocha": "^6.2.2",
"multistream": "^2.1.1",
"murmurhash3js": "3.0.1",
"mutation-observer": "^1.0.3",
Expand Down
Loading

0 comments on commit c202aa8

Please sign in to comment.