-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
User Page - KPIs and visualisations (#127617)
* Create total users visualization * Organize visualizations
- Loading branch information
Showing
44 changed files
with
748 additions
and
256 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
...gins/security_solution/common/search_strategy/security_solution/users/kpi/common/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import { Maybe } from '../../../..'; | ||
|
||
export interface KpiHistogramData { | ||
x?: Maybe<number>; | ||
y?: Maybe<number>; | ||
} |
19 changes: 19 additions & 0 deletions
19
...security_solution/common/search_strategy/security_solution/users/kpi/total_users/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import type { IEsSearchResponse } from '../../../../../../../../../src/plugins/data/common'; | ||
import { Inspect, Maybe } from '../../../../common'; | ||
import { RequestBasicOptions } from '../../..'; | ||
import { KpiHistogramData } from '../common'; | ||
|
||
export type TotalUsersKpiRequestOptions = RequestBasicOptions; | ||
|
||
export interface TotalUsersKpiStrategyResponse extends IEsSearchResponse { | ||
users: Maybe<number>; | ||
usersHistogram: Maybe<KpiHistogramData[]>; | ||
inspect?: Maybe<Inspect>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
84 changes: 84 additions & 0 deletions
84
...lic/common/components/visualization_actions/lens_attributes/users/kpi_total_users_area.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import { LensAttributes } from '../../types'; | ||
|
||
export const kpiTotalUsersAreaLensAttributes: LensAttributes = { | ||
description: '', | ||
state: { | ||
datasourceStates: { | ||
indexpattern: { | ||
layers: { | ||
'416b6fad-1923-4f6a-a2df-b223bb287e30': { | ||
columnOrder: [ | ||
'5eea817b-67b7-4268-8ecb-7688d1094721', | ||
'b00c65ea-32be-4163-bfc8-f795b1ef9d06', | ||
], | ||
columns: { | ||
'5eea817b-67b7-4268-8ecb-7688d1094721': { | ||
dataType: 'date', | ||
isBucketed: true, | ||
label: '@timestamp', | ||
operationType: 'date_histogram', | ||
params: { interval: 'auto' }, | ||
scale: 'interval', | ||
sourceField: '@timestamp', | ||
}, | ||
'b00c65ea-32be-4163-bfc8-f795b1ef9d06': { | ||
customLabel: true, | ||
dataType: 'number', | ||
isBucketed: false, | ||
label: ' ', | ||
operationType: 'unique_count', | ||
scale: 'ratio', | ||
sourceField: 'user.name', | ||
}, | ||
}, | ||
incompleteColumns: {}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
filters: [], | ||
query: { language: 'kuery', query: '' }, | ||
visualization: { | ||
axisTitlesVisibilitySettings: { x: false, yLeft: false, yRight: false }, | ||
fittingFunction: 'None', | ||
gridlinesVisibilitySettings: { x: true, yLeft: true, yRight: true }, | ||
labelsOrientation: { x: 0, yLeft: 0, yRight: 0 }, | ||
layers: [ | ||
{ | ||
accessors: ['b00c65ea-32be-4163-bfc8-f795b1ef9d06'], | ||
layerId: '416b6fad-1923-4f6a-a2df-b223bb287e30', | ||
layerType: 'data', | ||
seriesType: 'area', | ||
xAccessor: '5eea817b-67b7-4268-8ecb-7688d1094721', | ||
}, | ||
], | ||
legend: { isVisible: true, position: 'right' }, | ||
preferredSeriesType: 'area', | ||
tickLabelsVisibilitySettings: { x: true, yLeft: true, yRight: true }, | ||
valueLabels: 'hide', | ||
yLeftExtent: { mode: 'full' }, | ||
yRightExtent: { mode: 'full' }, | ||
}, | ||
}, | ||
title: '[User] Users - area', | ||
visualizationType: 'lnsXY', | ||
references: [ | ||
{ | ||
id: '{dataViewId}', | ||
name: 'indexpattern-datasource-current-indexpattern', | ||
type: 'index-pattern', | ||
}, | ||
{ | ||
id: '{dataViewId}', | ||
name: 'indexpattern-datasource-layer-416b6fad-1923-4f6a-a2df-b223bb287e30', | ||
type: 'index-pattern', | ||
}, | ||
], | ||
} as LensAttributes; |
55 changes: 55 additions & 0 deletions
55
...c/common/components/visualization_actions/lens_attributes/users/kpi_total_users_metric.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import { LensAttributes } from '../../types'; | ||
|
||
export const kpiTotalUsersMetricLensAttributes: LensAttributes = { | ||
description: '', | ||
state: { | ||
datasourceStates: { | ||
indexpattern: { | ||
layers: { | ||
'416b6fad-1923-4f6a-a2df-b223bb287e30': { | ||
columnOrder: ['3e51b035-872c-4b44-824b-fe069c222e91'], | ||
columns: { | ||
'3e51b035-872c-4b44-824b-fe069c222e91': { | ||
dataType: 'number', | ||
isBucketed: false, | ||
label: 'Unique count of user.name', | ||
operationType: 'unique_count', | ||
scale: 'ratio', | ||
sourceField: 'user.name', | ||
}, | ||
}, | ||
incompleteColumns: {}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
filters: [], | ||
query: { language: 'kuery', query: '' }, | ||
visualization: { | ||
accessor: '3e51b035-872c-4b44-824b-fe069c222e91', | ||
layerId: '416b6fad-1923-4f6a-a2df-b223bb287e30', | ||
layerType: 'data', | ||
}, | ||
}, | ||
title: '[User] Users - metric', | ||
visualizationType: 'lnsMetric', | ||
references: [ | ||
{ | ||
id: '{dataViewId}', | ||
name: 'indexpattern-datasource-current-indexpattern', | ||
type: 'index-pattern', | ||
}, | ||
{ | ||
id: '{dataViewId}', | ||
name: 'indexpattern-datasource-layer-416b6fad-1923-4f6a-a2df-b223bb287e30', | ||
type: 'index-pattern', | ||
}, | ||
], | ||
} as LensAttributes; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.