[8.7] [ML] AIOPs: Improve log categorization discover filter label (#151036) (#151299)

# Backport

This will backport the following commits from `main` to `8.7`:
- [[ML] AIOPs: Improve log categorization discover filter label
(#151036)](https://github.com/elastic/kibana/pull/151036)

<!--- Backport version: 8.9.7 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"James
Gowdy","email":"jgowdy@elastic.co"},"sourceCommit":{"committedDate":"2023-02-15T13:52:12Z","message":"[ML]
AIOPs: Improve log categorization discover filter label
(#151036)\n\nFixes the Discover filters generated by the Log
Categorisation page,\r\nadding an alias so the whole query isn't
displayed.\r\n\r\nLabel is `Categorization - <field
name>`\r\n\r\nBefore:\r\n\r\n\r\n![image](218516727-a7327a20-332f-45bd-907d-40595dfec945.png)","sha":"d04dc43513d747a8f64ea42168e5537486b95ef3","branchLabelMapping":{"^v8.8.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix",":ml","Feature:ML/AIOps","v8.7.0","v8.8.0"],"number":151036,"url":"https://github.com/elastic/kibana/pull/151036","mergeCommit":{"message":"[ML]
AIOPs: Improve log categorization discover filter label
(#151036)\n\nFixes the Discover filters generated by the Log
Categorisation page,\r\nadding an alias so the whole query isn't
displayed.\r\n\r\nLabel is `Categorization - <field
name>`\r\n\r\nBefore:\r\n\r\n\r\n![image](218516727-a7327a20-332f-45bd-907d-40595dfec945.png)","sha":"d04dc43513d747a8f64ea42168e5537486b95ef3"}},"sourceBranch":"main","suggestedTargetBranches":["8.7"],"targetPullRequestStates":[{"branch":"8.7","label":"v8.7.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.8.0","labelRegex":"^v8.8.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/151036","number":151036,"mergeCommit":{"message":"[ML]
AIOPs: Improve log categorization discover filter label
(#151036)\n\nFixes the Discover filters generated by the Log
Categorisation page,\r\nadding an alias so the whole query isn't
displayed.\r\n\r\nLabel is `Categorization - <field
name>`\r\n\r\nBefore:\r\n\r\n\r\n![image](218516727-a7327a20-332f-45bd-907d-40595dfec945.png)","sha":"d04dc43513d747a8f64ea42168e5537486b95ef3"}}]}]
BACKPORT-->

Co-authored-by: James Gowdy <jgowdy@elastic.co>
This commit is contained in:
Kibana Machine 2023-02-15 09:56:50 -05:00 committed by GitHub
parent 4afdbfb7d2
commit 79de0a7926
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -9,6 +9,7 @@ import rison from '@kbn/rison';
import moment from 'moment';
import type { TimeRangeBounds } from '@kbn/data-plugin/common';
import { i18n } from '@kbn/i18n';
import { useAiopsAppContext } from '../../hooks/use_aiops_app_context';
import type { Category } from './use_categorize_request';
import type { QueryMode } from './category_table';
@ -55,6 +56,16 @@ export function useDiscoverLinks() {
})),
},
},
meta: {
alias: i18n.translate('xpack.aiops.logCategorization.filterAliasLabel', {
defaultMessage: 'Categorization - {field}',
values: {
field,
},
}),
index,
disabled: false,
},
},
],
index,