Skip to main content

kibana-ql

Parser for the Kibana Query Language (KQL).

Install

pip install kibana-ql

Use

from kibana_ql import KqlParser
p = KqlParser()
tree = p.parse("field: value")
p.ast(tree)  # {'field': 'field', 'value': 'value'}
tree = p.parse('document: "tax" and @date > now-2w')
p.ast(tree)  # {'op': 'and', 'left': {'field': 'document', 'value': 'tax'}, 'right': {'field': '@date', 'op': '>', 'value': ('now-2w',)}}

Tests

py -m unittest discover -v -s tests -p "*_test.py"

Notes

Grammar file based on https://github.com/elastic/kibana/blob/main/packages/kbn-es-query/src/kuery/grammar/grammar.peggy.

Release files for kibana-ql 0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for kibana-ql 0.2
File Size Uploaded
kibana_ql-0.2.tar.gz 3.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for kibana-ql 0.2
File Interpreter ABI Platform
kibana_ql-0.2-py3-none-any.whl Python 3 none any Details

Total release size: 8.5 kB

Release files / kibana_ql-0.2.tar.gz

Download URL kibana_ql-0.2.tar.gz
Size 3.8 kB
Tags Source
SHA-256 checksum
How to use checksums
c7f4ddf548aa1cf7086713edf157f435214a5be9f6ee992ff88000787f2c1fd7
BLAKE2b-256 checksum
How to use checksums
339731332631ddd3f8c28d906c93c2247b5f54b87c15d30d490ec5ecf177c74a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.11.3

Release files / kibana_ql-0.2-py3-none-any.whl

Download URL kibana_ql-0.2-py3-none-any.whl
Size 4.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7a6a476465219ceb8a37b7d472cd86593f2241a298e9a46f32a315ce0ab919c4
BLAKE2b-256 checksum
How to use checksums
d4bcf9a0152ca515db3384dc565b09721591646200e3677acaed9b4985658b46
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.11.3

Release history Release notifications | RSS feed

This release

0.2 This release

2 release files

0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page