Skip to content

Commit

Permalink
Merge branch 'master' into test/mappings-editor
Browse files Browse the repository at this point in the history
  • Loading branch information
elasticmachine committed May 4, 2020
2 parents fe92ac4 + 9cfe4cf commit 70bf068
Show file tree
Hide file tree
Showing 198 changed files with 1,514 additions and 534 deletions.
29 changes: 27 additions & 2 deletions .backportrc.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,30 @@
{
"upstream": "elastic/kibana",
"branches": [{ "name": "7.x", "checked": true }, "7.7", "7.6", "7.5", "7.4", "7.3", "7.2", "7.1", "7.0", "6.8", "6.7", "6.6", "6.5", "6.4", "6.3", "6.2", "6.1", "6.0", "5.6"],
"labels": ["backport"]
"targetBranchChoices": [
{ "name": "master", "checked": true },
{ "name": "7.x", "checked": true },
"7.7",
"7.6",
"7.5",
"7.4",
"7.3",
"7.2",
"7.1",
"7.0",
"6.8",
"6.7",
"6.6",
"6.5",
"6.4",
"6.3",
"6.2",
"6.1",
"6.0",
"5.6"
],
"targetPRLabels": ["backport"],
"branchLabelMapping": {
"^v7.8.0$": "7.x",
"^v(\\d+).(\\d+).\\d+$": "$1.$2"
}
}
19 changes: 11 additions & 8 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,21 @@
/src/legacy/core_plugins/kibana/public/discover/ @elastic/kibana-app
/src/legacy/core_plugins/kibana/public/local_application_service/ @elastic/kibana-app
/src/legacy/core_plugins/kibana/public/dev_tools/ @elastic/kibana-app
/src/plugins/vis_type_vislib/ @elastic/kibana-app
/src/plugins/vis_type_xy/ @elastic/kibana-app
/src/plugins/vis_type_table/ @elastic/kibana-app
/src/plugins/kibana_legacy/ @elastic/kibana-app
/src/plugins/vis_type_timelion/ @elastic/kibana-app
/src/plugins/dashboard/ @elastic/kibana-app
/src/plugins/discover/ @elastic/kibana-app
/src/plugins/input_control_vis/ @elastic/kibana-app
/src/plugins/visualize/ @elastic/kibana-app
/src/plugins/vis_type_timeseries/ @elastic/kibana-app
/src/plugins/vis_type_metric/ @elastic/kibana-app
/src/plugins/kibana_legacy/ @elastic/kibana-app
/src/plugins/vis_default_editor/ @elastic/kibana-app
/src/plugins/vis_type_markdown/ @elastic/kibana-app
/src/plugins/vis_type_metric/ @elastic/kibana-app
/src/plugins/vis_type_table/ @elastic/kibana-app
/src/plugins/vis_type_tagcloud/ @elastic/kibana-app
/src/plugins/vis_type_timelion/ @elastic/kibana-app
/src/plugins/vis_type_timeseries/ @elastic/kibana-app
/src/plugins/vis_type_vega/ @elastic/kibana-app
/src/plugins/vis_type_vislib/ @elastic/kibana-app
/src/plugins/vis_type_xy/ @elastic/kibana-app
/src/plugins/visualize/ @elastic/kibana-app

# Core UI
# Exclude tutorials folder for now because they are not owned by Kibana app and most will move out soon
Expand Down
Binary file added docs/logs/images/alert-actions-menu.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/alert-flyout.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions docs/logs/index.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ In this case, you will only see the logs for the selected component.
* <<xpack-logs-using>>
* <<xpack-logs-configuring>>
* <<xpack-logs-analysis>>
* <<xpack-logs-alerting>>

[role="screenshot"]
image::logs/images/logs-console.png[Log Console in Kibana]
Expand All @@ -30,3 +31,5 @@ include::using.asciidoc[]
include::configuring.asciidoc[]

include::log-rate.asciidoc[]

include::logs-alerting.asciidoc[]
27 changes: 27 additions & 0 deletions docs/logs/logs-alerting.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
[role="xpack"]
[[xpack-logs-alerting]]
== Logs alerting

[float]
=== Overview

To use the alerting functionality you need to {kibana-ref}/alerting-getting-started.html#alerting-setup-prerequisites[set up alerting].

You can then select the *Create alert* option, from the *Alerts* actions dropdown.

[role="screenshot"]
image::logs/images/alert-actions-menu.png[Screenshot showing alerts menu]

Within the alert flyout you can configure your logs alert:

[role="screenshot"]
image::logs/images/alert-flyout.png[Screenshot showing alerts flyout]

[float]
=== Fields and comparators

The comparators available for conditions depend on the chosen field. The combinations available are:

- Numeric fields: *more than*, *more than or equals*, *less than*, *less than or equals*, *equals*, and *does not equal*.
- Aggregatable fields: *is* and *is not*.
- Non-aggregatable fields: *matches*, *does not match*, *matches phrase*, *does not match phrase*.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@
"babel-eslint": "^10.0.3",
"babel-jest": "^24.9.0",
"babel-plugin-istanbul": "^6.0.0",
"backport": "5.1.3",
"backport": "5.4.1",
"chai": "3.5.0",
"chance": "1.0.18",
"cheerio": "0.22.0",
Expand Down
Binary file not shown.

This file was deleted.

This file was deleted.

2 changes: 1 addition & 1 deletion src/plugins/expressions/public/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export {
ReactExpressionRendererProps,
ReactExpressionRendererType,
} from './react_expression_renderer';
export { ExpressionRenderHandler } from './render';
export { ExpressionRenderHandler, ExpressionRendererEvent } from './render';
export {
AnyExpressionFunctionDefinition,
AnyExpressionTypeDefinition,
Expand Down
41 changes: 41 additions & 0 deletions src/plugins/expressions/public/react_expression_renderer.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import { ExpressionLoader } from './loader';
import { mount } from 'enzyme';
import { EuiProgress } from '@elastic/eui';
import { RenderErrorHandlerFnType } from './types';
import { ExpressionRendererEvent } from './render';

jest.mock('./loader', () => {
return {
Expand Down Expand Up @@ -135,4 +136,44 @@ describe('ExpressionRenderer', () => {
expect(instance.find(EuiProgress)).toHaveLength(0);
expect(instance.find('[data-test-subj="custom-error"]')).toHaveLength(0);
});

it('should fire onEvent prop on every events$ observable emission in loader', () => {
const dataSubject = new Subject();
const data$ = dataSubject.asObservable().pipe(share());
const renderSubject = new Subject();
const render$ = renderSubject.asObservable().pipe(share());
const loadingSubject = new Subject();
const loading$ = loadingSubject.asObservable().pipe(share());
const eventsSubject = new Subject<ExpressionRendererEvent>();
const events$ = eventsSubject.asObservable().pipe(share());

const onEvent = jest.fn();
const event: ExpressionRendererEvent = {
name: 'foo',
data: {
bar: 'baz',
},
};

(ExpressionLoader as jest.Mock).mockImplementation(() => {
return {
render$,
data$,
loading$,
events$,
update: jest.fn(),
};
});

mount(<ReactExpressionRenderer expression="" onEvent={onEvent} />);

expect(onEvent).toHaveBeenCalledTimes(0);

act(() => {
eventsSubject.next(event);
});

expect(onEvent).toHaveBeenCalledTimes(1);
expect(onEvent.mock.calls[0][0]).toBe(event);
});
});
12 changes: 11 additions & 1 deletion src/plugins/expressions/public/react_expression_renderer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import theme from '@elastic/eui/dist/eui_theme_light.json';
import { IExpressionLoaderParams, RenderError } from './types';
import { ExpressionAstExpression, IInterpreterRenderHandlers } from '../common';
import { ExpressionLoader } from './loader';
import { ExpressionRendererEvent } from './render';

// Accept all options of the runner as props except for the
// dom element which is provided by the component itself
Expand All @@ -36,6 +37,7 @@ export interface ReactExpressionRendererProps extends IExpressionLoaderParams {
expression: string | ExpressionAstExpression;
renderError?: (error?: string | null) => React.ReactElement | React.ReactElement[];
padding?: 'xs' | 's' | 'm' | 'l' | 'xl';
onEvent?: (event: ExpressionRendererEvent) => void;
}

export type ReactExpressionRendererType = React.ComponentType<ReactExpressionRendererProps>;
Expand All @@ -60,6 +62,7 @@ export const ReactExpressionRenderer = ({
padding,
renderError,
expression,
onEvent,
...expressionLoaderOptions
}: ReactExpressionRendererProps) => {
const mountpoint: React.MutableRefObject<null | HTMLDivElement> = useRef(null);
Expand Down Expand Up @@ -99,6 +102,13 @@ export const ReactExpressionRenderer = ({
}
: expressionLoaderOptions.onRenderError,
});
if (onEvent) {
subs.push(
expressionLoaderRef.current.events$.subscribe(event => {
onEvent(event);
})
);
}
subs.push(
expressionLoaderRef.current.loading$.subscribe(() => {
hasHandledErrorRef.current = false;
Expand All @@ -123,7 +133,7 @@ export const ReactExpressionRenderer = ({

errorRenderHandlerRef.current = null;
};
}, [hasCustomRenderErrorHandler]);
}, [hasCustomRenderErrorHandler, onEvent]);

// Re-fetch data automatically when the inputs change
useShallowCompareEffect(
Expand Down
6 changes: 3 additions & 3 deletions src/plugins/expressions/public/render.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export interface ExpressionRenderHandlerParams {
onRenderError: RenderErrorHandlerFnType;
}

interface Event {
export interface ExpressionRendererEvent {
name: string;
data: any;
}
Expand All @@ -45,7 +45,7 @@ interface UpdateValue {
export class ExpressionRenderHandler {
render$: Observable<number>;
update$: Observable<UpdateValue | null>;
events$: Observable<Event>;
events$: Observable<ExpressionRendererEvent>;

private element: HTMLElement;
private destroyFn?: any;
Expand All @@ -63,7 +63,7 @@ export class ExpressionRenderHandler {
this.element = element;

this.eventsSubject = new Rx.Subject();
this.events$ = this.eventsSubject.asObservable() as Observable<Event>;
this.events$ = this.eventsSubject.asObservable() as Observable<ExpressionRendererEvent>;

this.onRenderError = onRenderError || defaultRenderErrorHandler;

Expand Down
4 changes: 2 additions & 2 deletions src/plugins/home/server/tutorials/activemq_logs/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export function activemqLogsSpecProvider(context: TutorialContext): TutorialSche
learnMoreLink: '{config.docs.beats.filebeat}/filebeat-module-activemq.html',
},
}),
euiIconType: '/plugins/kibana/home/tutorial_resources/logos/activemq.svg',
euiIconType: '/plugins/home/assets/logos/activemq.svg',
artifacts: {
dashboards: [
{
Expand All @@ -64,7 +64,7 @@ export function activemqLogsSpecProvider(context: TutorialContext): TutorialSche
},
},
completionTimeMinutes: 10,
previewImagePath: '/plugins/kibana/home/tutorial_resources/activemq_logs/screenshot.png',
previewImagePath: '/plugins/home/assets/activemq_logs/screenshot.png',
onPrem: onPremInstructions(moduleName, platforms, context),
elasticCloud: cloudInstructions(moduleName, platforms),
onPremElasticCloud: onPremCloudInstructions(moduleName, platforms),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export function activemqMetricsSpecProvider(context: TutorialContext): TutorialS
learnMoreLink: '{config.docs.beats.metricbeat}/metricbeat-module-activemq.html',
},
}),
euiIconType: '/plugins/kibana/home/tutorial_resources/logos/activemq.svg',
euiIconType: '/plugins/home/assets/logos/activemq.svg',
isBeta: true,
artifacts: {
application: {
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/home/server/tutorials/apache_logs/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export function apacheLogsSpecProvider(context: TutorialContext): TutorialSchema
},
},
completionTimeMinutes: 10,
previewImagePath: '/plugins/kibana/home/tutorial_resources/apache_logs/screenshot.png',
previewImagePath: '/plugins/home/assets/apache_logs/screenshot.png',
onPrem: onPremInstructions(moduleName, platforms, context),
elasticCloud: cloudInstructions(moduleName, platforms),
onPremElasticCloud: onPremCloudInstructions(moduleName, platforms),
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/home/server/tutorials/apache_metrics/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export function apacheMetricsSpecProvider(context: TutorialContext): TutorialSch
},
},
completionTimeMinutes: 10,
previewImagePath: '/plugins/kibana/home/tutorial_resources/apache_metrics/screenshot.png',
previewImagePath: '/plugins/home/assets/apache_metrics/screenshot.png',
onPrem: onPremInstructions(moduleName, context),
elasticCloud: cloudInstructions(moduleName),
onPremElasticCloud: onPremCloudInstructions(moduleName),
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/home/server/tutorials/auditbeat/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ processes, users, logins, sockets information, file accesses, and more. \
},
},
completionTimeMinutes: 10,
previewImagePath: '/plugins/kibana/home/tutorial_resources/auditbeat/screenshot.png',
previewImagePath: '/plugins/home/assets/auditbeat/screenshot.png',
onPrem: onPremInstructions(platforms, context),
elasticCloud: cloudInstructions(platforms),
onPremElasticCloud: onPremCloudInstructions(platforms),
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/home/server/tutorials/aws_logs/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export function awsLogsSpecProvider(context: TutorialContext): TutorialSchema {
},
},
completionTimeMinutes: 10,
previewImagePath: '/plugins/kibana/home/tutorial_resources/aws_logs/screenshot.png',
previewImagePath: '/plugins/home/assets/aws_logs/screenshot.png',
onPrem: onPremInstructions(moduleName, platforms, context),
elasticCloud: cloudInstructions(moduleName, platforms),
onPremElasticCloud: onPremCloudInstructions(moduleName, platforms),
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/home/server/tutorials/aws_metrics/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export function awsMetricsSpecProvider(context: TutorialContext): TutorialSchema
},
},
completionTimeMinutes: 10,
previewImagePath: '/plugins/kibana/home/tutorial_resources/aws_metrics/screenshot.png',
previewImagePath: '/plugins/home/assets/aws_metrics/screenshot.png',
onPrem: onPremInstructions(moduleName, context),
elasticCloud: cloudInstructions(moduleName),
onPremElasticCloud: onPremCloudInstructions(moduleName),
Expand Down
4 changes: 2 additions & 2 deletions src/plugins/home/server/tutorials/cisco_logs/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ supports the "asa" fileset for Cisco ASA firewall logs received over syslog or r
learnMoreLink: '{config.docs.beats.filebeat}/filebeat-module-cisco.html',
},
}),
euiIconType: '/plugins/kibana/home/tutorial_resources/logos/cisco.svg',
euiIconType: '/plugins/home/assets/logos/cisco.svg',
artifacts: {
dashboards: [],
application: {
Expand All @@ -64,7 +64,7 @@ supports the "asa" fileset for Cisco ASA firewall logs received over syslog or r
},
},
completionTimeMinutes: 10,
previewImagePath: '/plugins/kibana/home/tutorial_resources/cisco_logs/screenshot.png',
previewImagePath: '/plugins/home/assets/cisco_logs/screenshot.png',
onPrem: onPremInstructions(moduleName, platforms, context),
elasticCloud: cloudInstructions(moduleName, platforms),
onPremElasticCloud: onPremCloudInstructions(moduleName, platforms),
Expand Down
1 change: 0 additions & 1 deletion src/plugins/home/server/tutorials/cloudwatch_logs/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ export function cloudwatchLogsSpecProvider(context: TutorialContext): TutorialSc
},
},
completionTimeMinutes: 10,
// previewImagePath: '/plugins/kibana/home/tutorial_resources/uptime_monitors/screenshot.png',
onPrem: onPremInstructions([], context),
elasticCloud: cloudInstructions(),
onPremElasticCloud: onPremCloudInstructions(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export function cockroachdbMetricsSpecProvider(context: TutorialContext): Tutori
learnMoreLink: '{config.docs.beats.metricbeat}/metricbeat-module-cockroachdb.html',
},
}),
euiIconType: '/plugins/kibana/home/tutorial_resources/logos/cockroachdb.svg',
euiIconType: '/plugins/home/assets/logos/cockroachdb.svg',
artifacts: {
dashboards: [
{
Expand All @@ -67,7 +67,7 @@ export function cockroachdbMetricsSpecProvider(context: TutorialContext): Tutori
},
},
completionTimeMinutes: 10,
previewImagePath: '/plugins/kibana/home/tutorial_resources/cockroachdb_metrics/screenshot.png',
previewImagePath: '/plugins/home/assets/cockroachdb_metrics/screenshot.png',
onPrem: onPremInstructions(moduleName, context),
elasticCloud: cloudInstructions(moduleName),
onPremElasticCloud: onPremCloudInstructions(moduleName),
Expand Down
4 changes: 2 additions & 2 deletions src/plugins/home/server/tutorials/consul_metrics/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export function consulMetricsSpecProvider(context: TutorialContext): TutorialSch
learnMoreLink: '{config.docs.beats.metricbeat}/metricbeat-module-consul.html',
},
}),
euiIconType: '/plugins/kibana/home/tutorial_resources/logos/consul.svg',
euiIconType: '/plugins/home/assets/logos/consul.svg',
artifacts: {
dashboards: [
{
Expand All @@ -64,7 +64,7 @@ export function consulMetricsSpecProvider(context: TutorialContext): TutorialSch
},
},
completionTimeMinutes: 10,
previewImagePath: '/plugins/kibana/home/tutorial_resources/consul_metrics/screenshot.png',
previewImagePath: '/plugins/home/assets/consul_metrics/screenshot.png',
onPrem: onPremInstructions(moduleName, context),
elasticCloud: cloudInstructions(moduleName),
onPremElasticCloud: onPremCloudInstructions(moduleName),
Expand Down
Loading

0 comments on commit 70bf068

Please sign in to comment.