Skip to content
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

[Inventory] Page crashes when building a kql filter #200981

Closed
crespocarlos opened this issue Nov 20, 2024 · 1 comment · Fixed by #200984
Closed

[Inventory] Page crashes when building a kql filter #200981

crespocarlos opened this issue Nov 20, 2024 · 1 comment · Fixed by #200984
Assignees
Labels
bug Fixes for quality problems that affect the customer experience Team:obs-ux-infra_services Observability Infrastructure & Services User Experience Team

Comments

@crespocarlos
Copy link
Contributor

Summary

Inventory crashes when asKqlFilter is called

Image

The problem happens when an identity field value string has special characters, causing the kql builder to throw an error

SyntaxError: Expected end of input but ":" found.

      12 |   const { parseCursor, cursorSymbol, allowLeadingWildcards = true, helpers: { nodeTypes } } = options;
      13 |   const buildFunctionNode = nodeTypes.function.buildNodeWithArgumentNodes;
    > 14 |   const buildLiteralNode = nodeTypes.literal.buildNode;
         |                    ^
      15 |   const buildWildcardNode = nodeTypes.wildcard.buildNode;
      16 |   const { KQL_WILDCARD_SYMBOL } = nodeTypes.wildcard;
      17 | }

AC

  • asKqlFilter works with strings containing any characters
@crespocarlos crespocarlos self-assigned this Nov 20, 2024
@crespocarlos crespocarlos added the bug Fixes for quality problems that affect the customer experience label Nov 20, 2024
@botelastic botelastic bot added the needs-team Issues missing a team label label Nov 20, 2024
@crespocarlos crespocarlos added Team:obs-ux-infra_services Observability Infrastructure & Services User Experience Team and removed needs-team Issues missing a team label labels Nov 20, 2024
@elasticmachine
Copy link
Contributor

Pinging @elastic/obs-ux-infra_services-team (Team:obs-ux-infra_services)

@crespocarlos crespocarlos changed the title [Inventory] Page crashes when building the kql ilter [Inventory] Page crashes when building the kql filter Nov 20, 2024
@crespocarlos crespocarlos changed the title [Inventory] Page crashes when building the kql filter [Inventory] Page crashes when building a kql filter Nov 21, 2024
crespocarlos added a commit that referenced this issue Nov 21, 2024
fixes [#200981](#200981)

## Summary

This PR fixes a problem with the asKqlFilter throwing an error when
building filters with string containing special characters.
kibanamachine pushed a commit to kibanamachine/kibana that referenced this issue Nov 21, 2024
fixes [elastic#200981](elastic#200981)

## Summary

This PR fixes a problem with the asKqlFilter throwing an error when
building filters with string containing special characters.

(cherry picked from commit 8f8a671)
kibanamachine pushed a commit to kibanamachine/kibana that referenced this issue Nov 21, 2024
fixes [elastic#200981](elastic#200981)

## Summary

This PR fixes a problem with the asKqlFilter throwing an error when
building filters with string containing special characters.

(cherry picked from commit 8f8a671)
kibanamachine added a commit that referenced this issue Nov 21, 2024
# Backport

This will backport the following commits from `main` to `8.x`:
- [[Inventory][ECO] Fix asKqlFilter
(#200984)](#200984)

<!--- Backport version: 9.4.3 -->

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

<!--BACKPORT [{"author":{"name":"Carlos
Crespo","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-11-21T12:04:53Z","message":"[Inventory][ECO]
Fix asKqlFilter (#200984)\n\nfixes
[#200981](https://github.com/elastic/kibana/issues/200981)\r\n\r\n##
Summary\r\n\r\nThis PR fixes a problem with the asKqlFilter throwing an
error when\r\nbuilding filters with string containing special
characters.","sha":"8f8a671567f429814f049965db5dbf2a92582c04","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","backport:prev-major","Team:obs-ux-infra_services","Team:obs-entities"],"title":"[Inventory][ECO]
Fix
asKqlFilter","number":200984,"url":"https://github.com/elastic/kibana/pull/200984","mergeCommit":{"message":"[Inventory][ECO]
Fix asKqlFilter (#200984)\n\nfixes
[#200981](https://github.com/elastic/kibana/issues/200981)\r\n\r\n##
Summary\r\n\r\nThis PR fixes a problem with the asKqlFilter throwing an
error when\r\nbuilding filters with string containing special
characters.","sha":"8f8a671567f429814f049965db5dbf2a92582c04"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/200984","number":200984,"mergeCommit":{"message":"[Inventory][ECO]
Fix asKqlFilter (#200984)\n\nfixes
[#200981](https://github.com/elastic/kibana/issues/200981)\r\n\r\n##
Summary\r\n\r\nThis PR fixes a problem with the asKqlFilter throwing an
error when\r\nbuilding filters with string containing special
characters.","sha":"8f8a671567f429814f049965db5dbf2a92582c04"}}]}]
BACKPORT-->

Co-authored-by: Carlos Crespo <[email protected]>
kibanamachine added a commit that referenced this issue Nov 21, 2024
# Backport

This will backport the following commits from `main` to `8.17`:
- [[Inventory][ECO] Fix asKqlFilter
(#200984)](#200984)

<!--- Backport version: 9.4.3 -->

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

<!--BACKPORT [{"author":{"name":"Carlos
Crespo","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-11-21T12:04:53Z","message":"[Inventory][ECO]
Fix asKqlFilter (#200984)\n\nfixes
[#200981](https://github.com/elastic/kibana/issues/200981)\r\n\r\n##
Summary\r\n\r\nThis PR fixes a problem with the asKqlFilter throwing an
error when\r\nbuilding filters with string containing special
characters.","sha":"8f8a671567f429814f049965db5dbf2a92582c04","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","backport:prev-major","Team:obs-ux-infra_services","Team:obs-entities"],"title":"[Inventory][ECO]
Fix
asKqlFilter","number":200984,"url":"https://github.com/elastic/kibana/pull/200984","mergeCommit":{"message":"[Inventory][ECO]
Fix asKqlFilter (#200984)\n\nfixes
[#200981](https://github.com/elastic/kibana/issues/200981)\r\n\r\n##
Summary\r\n\r\nThis PR fixes a problem with the asKqlFilter throwing an
error when\r\nbuilding filters with string containing special
characters.","sha":"8f8a671567f429814f049965db5dbf2a92582c04"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/200984","number":200984,"mergeCommit":{"message":"[Inventory][ECO]
Fix asKqlFilter (#200984)\n\nfixes
[#200981](https://github.com/elastic/kibana/issues/200981)\r\n\r\n##
Summary\r\n\r\nThis PR fixes a problem with the asKqlFilter throwing an
error when\r\nbuilding filters with string containing special
characters.","sha":"8f8a671567f429814f049965db5dbf2a92582c04"}}]}]
BACKPORT-->

Co-authored-by: Carlos Crespo <[email protected]>
Co-authored-by: Elastic Machine <[email protected]>
paulinashakirova pushed a commit to paulinashakirova/kibana that referenced this issue Nov 26, 2024
fixes [elastic#200981](elastic#200981)

## Summary

This PR fixes a problem with the asKqlFilter throwing an error when
building filters with string containing special characters.
CAWilson94 pushed a commit to CAWilson94/kibana that referenced this issue Dec 12, 2024
fixes [elastic#200981](elastic#200981)

## Summary

This PR fixes a problem with the asKqlFilter throwing an error when
building filters with string containing special characters.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Fixes for quality problems that affect the customer experience Team:obs-ux-infra_services Observability Infrastructure & Services User Experience Team
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants