-
Notifications
You must be signed in to change notification settings - Fork 8k
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
[Fleet] Fix KQL/kuery for getting Fleet Server agent count #180650
Conversation
Pinging @elastic/fleet (Team:Fleet) |
🤖 GitHub commentsExpand to view the GitHub comments
Just comment with:
|
💛 Build succeeded, but was flaky
Failed CI StepsTest Failures
Metrics [docs]Page load bundle
To update your PR or re-run it, just comment with: cc @jen-huang |
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.
LGTM
…80650) ## Summary Resolves [elastic#180427](elastic#180427) - see issue for repro steps. Code introduced in elastic#179603 made the KQL to look up count of Fleet Server agents malformed. This is used to determine if the Add agent flyout should show "Add Fleet Server" instructions or show the normal instructions. When user has multiple Fleet Server policies on 8.13.2, the Add agent flyout will never show the normal instructions regardless of actual Fleet Server enrollment due to error response from the query. Although the code was introduced in 8.13.2, the issue was "hidden" in 8.14.0 when strict KQL validation was turned off (elastic#176806). Thus, this issue is only present in 8.13.2, 8.14 with the feature flag for strict validation turned on, or a future release if/when we turn strict validation back on. This PR will be backported to 8.13 in case another patch release is cut. This fix adds parenthesis around the concatenation of multiple policy IDs: <img width="763" alt="image" src="https://github.com/elastic/kibana/assets/1965714/99019ca2-e613-431f-8ff1-590116ba7511"> (cherry picked from commit 382ad45)
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
…80650) (#180668) # Backport This will backport the following commits from `main` to `8.13`: - [[Fleet] Fix KQL/kuery for getting Fleet Server agent count (#180650)](#180650) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Jen Huang","email":"its.jenetic@gmail.com"},"sourceCommit":{"committedDate":"2024-04-12T08:14:40Z","message":"[Fleet] Fix KQL/kuery for getting Fleet Server agent count (#180650)\n\n## Summary\r\n\r\nResolves [#180427](#180427) -\r\nsee issue for repro steps.\r\n\r\nCode introduced in #179603 made\r\nthe KQL to look up count of Fleet Server agents malformed. This is used\r\nto determine if the Add agent flyout should show \"Add Fleet Server\"\r\ninstructions or show the normal instructions. When user has multiple\r\nFleet Server policies on 8.13.2, the Add agent flyout will never show\r\nthe normal instructions regardless of actual Fleet Server enrollment due\r\nto error response from the query.\r\n\r\nAlthough the code was introduced in 8.13.2, the issue was \"hidden\" in\r\n8.14.0 when strict KQL validation was turned off\r\n(#176806). Thus, this issue is\r\nonly present in 8.13.2, 8.14 with the feature flag for strict validation\r\nturned on, or a future release if/when we turn strict validation back\r\non.\r\n\r\nThis PR will be backported to 8.13 in case another patch release is cut.\r\nThis fix adds parenthesis around the concatenation of multiple policy\r\nIDs:\r\n\r\n<img width=\"763\" alt=\"image\"\r\nsrc=\"https://github.com/elastic/kibana/assets/1965714/99019ca2-e613-431f-8ff1-590116ba7511\">","sha":"382ad457d38a4b2a6b10baa76484b8b5109e3c5d","branchLabelMapping":{"^v8.14.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Team:Fleet","v8.14.0","v8.13.3"],"title":"[Fleet] Fix KQL/kuery for getting Fleet Server agent count","number":180650,"url":"#180650 Fix KQL/kuery for getting Fleet Server agent count (#180650)\n\n## Summary\r\n\r\nResolves [#180427](#180427) -\r\nsee issue for repro steps.\r\n\r\nCode introduced in #179603 made\r\nthe KQL to look up count of Fleet Server agents malformed. This is used\r\nto determine if the Add agent flyout should show \"Add Fleet Server\"\r\ninstructions or show the normal instructions. When user has multiple\r\nFleet Server policies on 8.13.2, the Add agent flyout will never show\r\nthe normal instructions regardless of actual Fleet Server enrollment due\r\nto error response from the query.\r\n\r\nAlthough the code was introduced in 8.13.2, the issue was \"hidden\" in\r\n8.14.0 when strict KQL validation was turned off\r\n(#176806). Thus, this issue is\r\nonly present in 8.13.2, 8.14 with the feature flag for strict validation\r\nturned on, or a future release if/when we turn strict validation back\r\non.\r\n\r\nThis PR will be backported to 8.13 in case another patch release is cut.\r\nThis fix adds parenthesis around the concatenation of multiple policy\r\nIDs:\r\n\r\n<img width=\"763\" alt=\"image\"\r\nsrc=\"https://github.com/elastic/kibana/assets/1965714/99019ca2-e613-431f-8ff1-590116ba7511\">","sha":"382ad457d38a4b2a6b10baa76484b8b5109e3c5d"}},"sourceBranch":"main","suggestedTargetBranches":["8.13"],"targetPullRequestStates":[{"branch":"main","label":"v8.14.0","branchLabelMappingKey":"^v8.14.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/180650","number":180650,"mergeCommit":{"message":"[Fleet] Fix KQL/kuery for getting Fleet Server agent count (#180650)\n\n## Summary\r\n\r\nResolves [#180427](#180427) -\r\nsee issue for repro steps.\r\n\r\nCode introduced in #179603 made\r\nthe KQL to look up count of Fleet Server agents malformed. This is used\r\nto determine if the Add agent flyout should show \"Add Fleet Server\"\r\ninstructions or show the normal instructions. When user has multiple\r\nFleet Server policies on 8.13.2, the Add agent flyout will never show\r\nthe normal instructions regardless of actual Fleet Server enrollment due\r\nto error response from the query.\r\n\r\nAlthough the code was introduced in 8.13.2, the issue was \"hidden\" in\r\n8.14.0 when strict KQL validation was turned off\r\n(#176806). Thus, this issue is\r\nonly present in 8.13.2, 8.14 with the feature flag for strict validation\r\nturned on, or a future release if/when we turn strict validation back\r\non.\r\n\r\nThis PR will be backported to 8.13 in case another patch release is cut.\r\nThis fix adds parenthesis around the concatenation of multiple policy\r\nIDs:\r\n\r\n<img width=\"763\" alt=\"image\"\r\nsrc=\"https://github.com/elastic/kibana/assets/1965714/99019ca2-e613-431f-8ff1-590116ba7511\">","sha":"382ad457d38a4b2a6b10baa76484b8b5109e3c5d"}},{"branch":"8.13","label":"v8.13.3","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Jen Huang <its.jenetic@gmail.com>
Summary
Resolves #180427 - see issue for repro steps.
Code introduced in #179603 made the KQL to look up count of Fleet Server agents malformed. This is used to determine if the Add agent flyout should show "Add Fleet Server" instructions or show the normal instructions. When user has multiple Fleet Server policies on 8.13.2, the Add agent flyout will never show the normal instructions regardless of actual Fleet Server enrollment due to error response from the query.
Although the code was introduced in 8.13.2, the issue was "hidden" in 8.14.0 when strict KQL validation was turned off (#176806). Thus, this issue is only present in 8.13.2, 8.14 with the feature flag for strict validation turned on, or a future release if/when we turn strict validation back on.
This PR will be backported to 8.13 in case another patch release is cut. This fix adds parenthesis around the concatenation of multiple policy IDs: