A package for searching log query language path
Project description
#lqlpath lqlpath is a Python package designed to retrieve field paths in Google BigQuery logs based on either keys or values, making it particularly useful for working with BigQuery Log Query Language (LQL). Whether you're searching for specific keys or values in your JSON-formatted BigQuery logs, lqlpath helps you quickly locate the relevant fields.
#Features Search by Key: Retrieve a list of field paths in a JSON file where a specific key is found, particularly for BigQuery logs. Search by Value: Retrieve a list of field paths in a JSON file where a specific value is found. BigQuery-Specific Searches: Specialized functions to search within BigQuery log structures, helping you extract key information from logs such as project, dataset, and table identifiers.
#Installation
To install the package, simply run:
pip install lqlpath
#Usage The following examples show how to search for key paths or value paths in BigQuery logs.
Example: Search Field Paths by Key
from lqlpath import get_byKey
Search for the key 'reservation' in the BigQuery JSON log file 'bq.json'
print(get_byKey('bq.json', 'reservation'))
Output:
['protoPayload.serviceData.jobInsertResponse.resource.jobStatistics.reservation']
Example: Search Field Paths by Value
from lqlpath import get_byValue
Search for the value 'us-central1' in the BigQuery JSON log file 'bq.json'
print(get_byValue('bq.json', 'us-central1'))
Output:
['protoPayload.serviceData.jobInsertResponse.resource.jobName.location']
#Specialized BigQuery Log Search by Key
The bq_get_byKey function allows you to search specifically within the structure of BigQuery logs. You can specify the type of BigQuery resource (e.g., table, dataset) and the key you're looking for.
Supported BigQuery resource types:
-BIGQUERY_RESOURCE -BIGQUERY_PROJECT -BIGQUERY_DATASET -BIGQUERY_TABLE
#Example from lqlpath import bq_get_byKey
Search for the key 'table_id' within BigQuery table resources
print(bq_get_byKey('BIGQUERY_TABLE', 'table_id'))
Output:
['resource.labels.table_id']
#Example Use Cases Log Query Language (LQL) Exploration: Use lqlpath to extract paths for keys or values from complex BigQuery logs, making it easier to write queries. BigQuery Log Analysis: Quickly find the relevant fields in your BigQuery log files when troubleshooting or monitoring BigQuery operations.
#License This project is licensed under the MIT License. See the LICENSE file for more details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file lqlpath-0.2.0-py3-none-any.whl.
File metadata
- Download URL: lqlpath-0.2.0-py3-none-any.whl
- Upload date:
- Size: 6.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b946c274011007e4d8f1e2ac0d2f87cbb804e1a4bb8a1009df6c08cd25db3dde
|
|
| MD5 |
c78f8680d14a869cdbfef951121b75da
|
|
| BLAKE2b-256 |
a4e4e0d61577a594b6ab85c5eae0432b66e50fc0df17c8c2b21b82cb7e67c215
|