Skip to content

Commit

Permalink
[ML] [AIOps] Pattern analysis tab in Discover (#178916)
Browse files Browse the repository at this point in the history
Closes #178534

Replaces the pattern analysis flyout in Discover with a tab which sits
alongside the Documents and Field statistics tabs.


![image](https://github.com/elastic/kibana/assets/22172091/027f7751-c61e-4b7e-9625-dd876730ff2e)



**Field selection**
Lists all of the text fields in the index. Auto selects `message`, then
`error.message`, then `event.original` and if none of these fields are
available, it just selects the first field in the list.


![image](https://github.com/elastic/kibana/assets/22172091/6ee0eb75-ed13-4c16-beb6-3de357dc182c)



The Options menu provides some configuration options:

**Minimum time range**
Sets the minimum time range used for the pattern analysis search. The
pattern matching results results will be more accurate the more data it
sees, so if the user has selected e.g. last 15mins in the time picker,
this settings will ensure a wider time range is used to improve the
accuracy of the patterns. If the time picker has a larger time range
than this setting, the larger time range will be used.

**Random sampling**
Improves the search performance by using a random sampler. This is the
same setting as before.


![image](https://github.com/elastic/kibana/assets/22172091/7a2580f6-61f7-4053-9ac1-93a8e8e2f01c)

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: István Zoltán Szabó <istvan.szabo@elastic.co>
  • Loading branch information
3 people authored May 22, 2024
1 parent 9e8bf2d commit a69f24b
Show file tree
Hide file tree
Showing 83 changed files with 2,652 additions and 1,013 deletions.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,14 @@
*/

import React, { useEffect, useState } from 'react';
import { EuiPopoverFooter, EuiSpacer } from '@elastic/eui';
import { EuiPopoverFooter } from '@elastic/eui';
import { type FieldVisualizeButtonProps, getFieldVisualizeButton } from '../field_visualize_button';
import { FieldCategorizeButtonProps, getFieldCategorizeButton } from '../field_categorize_button';
import { ErrorBoundary } from '../error_boundary';

export type FieldPopoverFooterProps = FieldVisualizeButtonProps | FieldCategorizeButtonProps;
export type FieldPopoverFooterProps = FieldVisualizeButtonProps;

const FieldPopoverFooterComponent: React.FC<FieldPopoverFooterProps> = (props) => {
const [visualizeButton, setVisualizeButton] = useState<JSX.Element | null>(null);
const [categorizeButton, setCategorizeButton] = useState<JSX.Element | null>(null);

useEffect(() => {
getFieldVisualizeButton(props)
Expand All @@ -25,21 +23,9 @@ const FieldPopoverFooterComponent: React.FC<FieldPopoverFooterProps> = (props) =
// eslint-disable-next-line no-console
console.error(error);
});
getFieldCategorizeButton(props)
.then(setCategorizeButton)
.catch((error) => {
// eslint-disable-next-line no-console
console.error(error);
});
}, [props]);

return visualizeButton || categorizeButton ? (
<EuiPopoverFooter>
{visualizeButton}
{visualizeButton && categorizeButton ? <EuiSpacer size="s" /> : null}
{categorizeButton}
</EuiPopoverFooter>
) : null;
return visualizeButton ? <EuiPopoverFooter>{visualizeButton}</EuiPopoverFooter> : null;
};

export const FieldPopoverFooter: React.FC<FieldPopoverFooterProps> = (props) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,6 @@ function UnifiedFieldListItemComponent({
contextualFields={workspaceSelectedFieldNames}
originatingApp={stateService.creationOptions.originatingApp}
uiActions={services.uiActions}
closePopover={() => closePopover()}
/>
)}
</>
Expand Down
1 change: 0 additions & 1 deletion packages/kbn-unified-field-list/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
"@kbn/ebt-tools",
"@kbn/shared-ux-button-toolbar",
"@kbn/field-utils",
"@kbn/ml-ui-actions",
"@kbn/visualization-utils",
"@kbn/esql-utils",
"@kbn/search-types"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ describe('checking migration metadata changes on all registered SO types', () =>
"risk-engine-configuration": "aea0c371a462e6d07c3ceb3aff11891b47feb09d",
"rules-settings": "892a2918ebaeba809a612b8d97cec0b07c800b5f",
"sample-data-telemetry": "37441b12f5b0159c2d6d5138a494c9f440e950b5",
"search": "7598e4a701ddcaa5e3f44f22e797618a48595e6f",
"search": "4579401660a4089d5122b2fc8624825cb97b0480",
"search-session": "b2fcd840e12a45039ada50b1355faeafa39876d1",
"search-telemetry": "b568601618744720b5662946d3103e3fb75fe8ee",
"security-rule": "07abb4d7e707d91675ec0495c73816394c7b521f",
Expand Down
Loading

0 comments on commit a69f24b

Please sign in to comment.