-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdoc.go
36 lines (28 loc) · 1.03 KB
/
doc.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/*
Package kql-go provides a robust parser for Kibana Query Language (KQL).
KQL is a simple yet powerful query language used in Kibana for filtering and searching data.
This package implements a complete parser that converts KQL queries into an Abstract Syntax Tree (AST).
Basic Usage:
import "github.com/laojianzi/kql-go"
query := "response:200 AND (method:GET OR method:POST)"
ast, err := kql.Parse(query)
if err != nil {
log.Fatal(err)
}
Features:
- Escaped character handling
- Wildcard patterns
- Parentheses grouping
- AND/OR/NOT operators
- Field:value pairs
- String literals with quotes
Thread Safety:
The parser is designed to be thread-safe. Each Parse call creates a new parser instance,
making it safe to use across multiple goroutines.
Error Handling:
The parser provides detailed error messages with position information,
making it easy to identify and fix syntax errors in queries.
For more information about KQL syntax, visit:
https://www.elastic.co/guide/en/kibana/current/kuery-query.html
*/
package kql