Skip to content

[KQL] Better programmatic API #77085

@lukasolson

Description

@lukasolson

KQL is being used in more and more places, such as the saved objects client, in fleet, in alerting, etc.

The KQL parser (built in PEG) doesn't perform well, so in cases where we want to improve performance, we've been interacting directly with the KQL AST nodes. Right now our APIs for doing so aren't very clean or documented.

We'd like to get to the point where we can do something simple like this:

const node = kql.and([
  kql.is(indexPattern, 'field', 'value')
  kql.not(kql.exists(indexPattern, field)
]);

And still get the performance increases we've seen from interacting directly with the AST nodes.

Related: #75693, #76589

Metadata

Metadata

Assignees

No one assigned

    Labels

    Feature:KQLKQLFeature:SearchQuerying infrastructure in KibanaIceboxTeam:DataDiscoveryDiscover, search (data plugin and KQL), data views, saved searches. For ES|QL, use Team:ES|QL. t//impact:mediumAddressing this issue will have a medium level of impact on the quality/strength of our product.loe:mediumMedium Level of Effort

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions