-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[EDR Workflows][Osquery] Fix last results pack value #192678
[EDR Workflows][Osquery] Fix last results pack value #192678
Conversation
Pinging @elastic/security-defend-workflows (Team:Defend Workflows) |
const dateTime = lastResultsData?.['@timestamp']; | ||
if (!dateTime) return undefined; | ||
|
||
return Array.isArray(dateTime) ? dateTime[0] : dateTime; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was reported that this issue is a regression. As a result, I’ve accounted for the possibility that some stack versions might return the search aggregation as a string rather than an array of strings.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good! 🚀 but... what about tests? : ) i'd suggest to add some if applicable
💚 Build Succeeded
Metrics [docs]Async chunks
History
To update your PR or re-run it, just comment with: |
@szwarckonrad this pull request has an |
Added |
The “Last Results” tab in the active pack details is displaying incorrect date-time values. This is due to a mismatch in data format. The component responsible for formatting the date-time values expects a string, but it is currently receiving an array with a single string inside. Before: ![Screenshot 2024-09-12 at 10 33 39](https://github.com/user-attachments/assets/844fd699-a086-44d8-aa0b-a06e65e5aa60) After: ![Screenshot 2024-09-12 at 12 40 04](https://github.com/user-attachments/assets/bcce9b69-58b8-438d-89e8-c78a3922845c) (cherry picked from commit cfcb6e8)
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
…193579) # Backport This will backport the following commits from `main` to `8.x`: - [[EDR Workflows][Osquery] Fix last results pack value (#192678)](#192678) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Konrad Szwarc","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-09-17T08:18:09Z","message":"[EDR Workflows][Osquery] Fix last results pack value (#192678)\n\nThe “Last Results” tab in the active pack details is displaying\r\nincorrect date-time values. This is due to a mismatch in data format.\r\nThe component responsible for formatting the date-time values expects a\r\nstring, but it is currently receiving an array with a single string\r\ninside.\r\n\r\nBefore:\r\n\r\n![Screenshot 2024-09-12 at 10 33\r\n39](https://github.com/user-attachments/assets/844fd699-a086-44d8-aa0b-a06e65e5aa60)\r\n\r\nAfter: \r\n\r\n![Screenshot 2024-09-12 at 12 40\r\n04](https://github.com/user-attachments/assets/bcce9b69-58b8-438d-89e8-c78a3922845c)","sha":"cfcb6e8f4ddf078ccdcec2a03788e39c6e4dfdef","branchLabelMapping":{"^v9.0.0$":"main","^v8.16.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","Team:Defend Workflows","v8.16.0","backport:version"],"title":"[EDR Workflows][Osquery] Fix last results pack value","number":192678,"url":"https://github.com/elastic/kibana/pull/192678","mergeCommit":{"message":"[EDR Workflows][Osquery] Fix last results pack value (#192678)\n\nThe “Last Results” tab in the active pack details is displaying\r\nincorrect date-time values. This is due to a mismatch in data format.\r\nThe component responsible for formatting the date-time values expects a\r\nstring, but it is currently receiving an array with a single string\r\ninside.\r\n\r\nBefore:\r\n\r\n![Screenshot 2024-09-12 at 10 33\r\n39](https://github.com/user-attachments/assets/844fd699-a086-44d8-aa0b-a06e65e5aa60)\r\n\r\nAfter: \r\n\r\n![Screenshot 2024-09-12 at 12 40\r\n04](https://github.com/user-attachments/assets/bcce9b69-58b8-438d-89e8-c78a3922845c)","sha":"cfcb6e8f4ddf078ccdcec2a03788e39c6e4dfdef"}},"sourceBranch":"main","suggestedTargetBranches":["8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/192678","number":192678,"mergeCommit":{"message":"[EDR Workflows][Osquery] Fix last results pack value (#192678)\n\nThe “Last Results” tab in the active pack details is displaying\r\nincorrect date-time values. This is due to a mismatch in data format.\r\nThe component responsible for formatting the date-time values expects a\r\nstring, but it is currently receiving an array with a single string\r\ninside.\r\n\r\nBefore:\r\n\r\n![Screenshot 2024-09-12 at 10 33\r\n39](https://github.com/user-attachments/assets/844fd699-a086-44d8-aa0b-a06e65e5aa60)\r\n\r\nAfter: \r\n\r\n![Screenshot 2024-09-12 at 12 40\r\n04](https://github.com/user-attachments/assets/bcce9b69-58b8-438d-89e8-c78a3922845c)","sha":"cfcb6e8f4ddf078ccdcec2a03788e39c6e4dfdef"}},{"branch":"8.x","label":"v8.16.0","branchLabelMappingKey":"^v8.16.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Konrad Szwarc <[email protected]>
The “Last Results” tab in the active pack details is displaying incorrect date-time values. This is due to a mismatch in data format. The component responsible for formatting the date-time values expects a string, but it is currently receiving an array with a single string inside.
Before:
After: