mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
[8.16] [Security Solution][Detection Engine] fixes preview logs issue when switching between rules (#197098) (#198050)
# Backport This will backport the following commits from `main` to `8.16`: - [[Security Solution][Detection Engine] fixes preview logs issue when switching between rules (#197098)](https://github.com/elastic/kibana/pull/197098) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Vitalii Dmyterko","email":"92328789+vitaliidm@users.noreply.github.com"},"sourceCommit":{"committedDate":"2024-10-28T16:35:36Z","message":"[Security Solution][Detection Engine] fixes preview logs issue when switching between rules (#197098)\n\n## Summary\r\n\r\n - addresses https://github.com/elastic/kibana/issues/196616","sha":"6a6d1f3b6e41f8e1740d3bba4f5537feddbbbb24","branchLabelMapping":{"^v9.0.0$":"main","^v8.17.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","Team: SecuritySolution","backport:prev-minor","Team:Detection Engine","v8.16.0","backport:version","v8.17.0"],"title":"[Security Solution][Detection Engine] fixes preview logs issue when switching between rules","number":197098,"url":"https://github.com/elastic/kibana/pull/197098","mergeCommit":{"message":"[Security Solution][Detection Engine] fixes preview logs issue when switching between rules (#197098)\n\n## Summary\r\n\r\n - addresses https://github.com/elastic/kibana/issues/196616","sha":"6a6d1f3b6e41f8e1740d3bba4f5537feddbbbb24"}},"sourceBranch":"main","suggestedTargetBranches":["8.16","8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/197098","number":197098,"mergeCommit":{"message":"[Security Solution][Detection Engine] fixes preview logs issue when switching between rules (#197098)\n\n## Summary\r\n\r\n - addresses https://github.com/elastic/kibana/issues/196616","sha":"6a6d1f3b6e41f8e1740d3bba4f5537feddbbbb24"}},{"branch":"8.16","label":"v8.16.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.x","label":"v8.17.0","branchLabelMappingKey":"^v8.17.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Vitalii Dmyterko <92328789+vitaliidm@users.noreply.github.com>
This commit is contained in:
parent
dedfdecbaf
commit
ebf33b08e5
1 changed files with 6 additions and 3 deletions
|
@ -108,6 +108,8 @@ const RulePreviewComponent: React.FC<RulePreviewProps> = ({
|
|||
|
||||
const [isDateRangeInvalid, setIsDateRangeInvalid] = useState(false);
|
||||
|
||||
const isLoggedRequestsSupported = RULE_TYPES_SUPPORTING_LOGGED_REQUESTS.includes(ruleType);
|
||||
|
||||
useEffect(() => {
|
||||
const { start, end } = refreshedTimeframe(startDate, endDate);
|
||||
setTimeframeStart(start);
|
||||
|
@ -194,7 +196,7 @@ const RulePreviewComponent: React.FC<RulePreviewProps> = ({
|
|||
interval: scheduleRuleData.interval,
|
||||
lookback: scheduleRuleData.from,
|
||||
},
|
||||
enableLoggedRequests: showElasticsearchRequests,
|
||||
enableLoggedRequests: showElasticsearchRequests && isLoggedRequestsSupported,
|
||||
});
|
||||
setIsRefreshing(true);
|
||||
}, [
|
||||
|
@ -205,6 +207,7 @@ const RulePreviewComponent: React.FC<RulePreviewProps> = ({
|
|||
startDate,
|
||||
startTransaction,
|
||||
showElasticsearchRequests,
|
||||
isLoggedRequestsSupported,
|
||||
]);
|
||||
|
||||
const isDirty = useMemo(
|
||||
|
@ -279,7 +282,7 @@ const RulePreviewComponent: React.FC<RulePreviewProps> = ({
|
|||
</EuiFlexItem>
|
||||
</EuiFlexGroup>
|
||||
</EuiFormRow>
|
||||
{RULE_TYPES_SUPPORTING_LOGGED_REQUESTS.includes(ruleType) ? (
|
||||
{isLoggedRequestsSupported ? (
|
||||
<EuiFormRow>
|
||||
<EuiFlexGroup alignItems="center" gutterSize="s" responsive>
|
||||
<EuiFlexItem grow>
|
||||
|
@ -312,7 +315,7 @@ const RulePreviewComponent: React.FC<RulePreviewProps> = ({
|
|||
logs={logs}
|
||||
hasNoiseWarning={hasNoiseWarning}
|
||||
isAborted={isAborted}
|
||||
showElasticsearchRequests={showElasticsearchRequests}
|
||||
showElasticsearchRequests={showElasticsearchRequests && isLoggedRequestsSupported}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue