Skip to main content

ZLP CLI

Project description

zt-zlp-cli

ZLP 日志管理平台 命令行工具,用于登录并查询实例、库、表结构与 SQL 结果。

环境要求

  • Python >=3.10
  • 可用浏览器(首次登录会自动打开)

安装

开发安装(源码)

pip install -e .

打包发布

python -m pip install --upgrade build twine
python -m build
twine upload dist/*

快速开始

1) 登录并缓存 Cookie

首次运行会打开浏览器,请完成登录。成功后会缓存 Cookie 到本地。

zt-zlp-cli login

2) 获取系统列表

zt-zlp-cli discover systems

2) 获取服务列表

zt-zlp-cli discover services --system LMS --log-type json

2.1) 日志搜索

zt-zlp-cli discover logs \
  --system LMS \
  --service fbu-lms-labelservice-pro-json \
  --log-type json \
  --custom-sql "select topic,ClientIp,PrintMethod from \$table limit 10" \
  --query-statement "SiteName = 'CN'" \
  --start-time "2026-04-12 00:00:00" \
  --end-time "2026-04-14 23:59:59"

全局参数

  • -o, --output:输出格式,支持:
    • json(默认)
    • human(表格)

示例:

zt-zlp-cli -o human sql instances

配置说明

默认配置目录:~/.zt-zlp-cli

  • Cookie 缓存:~/.zt-zlp-cli/cookies.json
  • 配置文件:~/.zt-zlp-cli/config.yaml

环境变量(可选)

支持通过环境变量自动填充登录页账号密码(如 SSO 页面字段可用):

  • ZT_SSO_USERNAME
  • ZT_SSO_PASSWORD

未设置时可在浏览器中手动完成登录。

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

zt_zlp_cli-0.0.1.tar.gz (8.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

zt_zlp_cli-0.0.1-py3-none-any.whl (9.3 kB view details)

Uploaded Python 3

File details

Details for the file zt_zlp_cli-0.0.1.tar.gz.

File metadata

  • Download URL: zt_zlp_cli-0.0.1.tar.gz
  • Upload date:
  • Size: 8.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for zt_zlp_cli-0.0.1.tar.gz
Algorithm Hash digest
SHA256 a55fda137393e139b1f798c3f0be751aa9cf7a00210e0e7571692cc3a340b69c
MD5 880a19e2f0aff76c272a3cfbe9c68feb
BLAKE2b-256 e131ccbcb605ed864205af07cd3d37ae949e286ceb2f8429543878ee393681d2

See more details on using hashes here.

File details

Details for the file zt_zlp_cli-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: zt_zlp_cli-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 9.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for zt_zlp_cli-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 07edd840fc14dd16055ad65d213f187011e436aa2b3fe15eba5d236e42225a2d
MD5 3126a6919a24cefa37138d40586e578c
BLAKE2b-256 2ec3ddf9b81f88e45440d635e4eda01fec7f18ba2b86ec57718fdd1776361c5a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page