Skip to main content

ketadb 工具

示例

# 添加/登录 cluster (使用已有 token)
ketacli config add -n keta -e http://localhost:9000 -t <yourtoken>

# 添加/登录 cluster (使用用户名密码,自动创建 token,密码不保存)
ketacli config add -n keta -e http://localhost:9000 -u myuser
# 或者非交互式:
ketacli config add -n keta -e http://localhost:9000 -u myuser -p mypassword

# 列出所有 cluster
ketacli config list

# 切换默认 cluster
ketacli config use -n keta

# 删除 cluster
ketacli config remove -n keta

# 枚举所有仪表盘
ketacli list dashboard --fields id,app,updateTime --sort updateTime --order asc --prefix test 

# 描述资源的字段
ketacli describe dashboard 

# 插入一条数据

ketacli insert --repo test01 '[{"a":1}]'

# 查询一条数据

ketacli search 'repo=test01 | limit 10' 

# 指定返回格式,支持json、csv、html、latex等

ketacli search 'repo=test01 | limit 10' --format json

#  创建一个资源

ketacli create repos test_repo --file file.json

# 删除一个资源
ketacli delete repos -n test_repo

# 查看可操作的资源列表
ketacli rs

# 查看具体资源操作方法
ketacli rs --type repos

# watch 资源变化
ketacli list repo --watch

ketacli search '''search2 repo="*"|stats count() as cnt by repo,sourcetype |sort by cnt |limit 10''' -w --interval 1

# 下载资源
ketacli download <assetType> [-e ectra] [--base_path path]

# 示例:下载 App
ketacli download apps --base_path apps -e app_name=keta_docs

# 下载任意资源(普通 json 接口将会保存 json 文件)
ketacli download repo -e name=_internal

# 安装 app
ketacli update apps -o install -e name=aws,version=1.0.1

# 卸载 app
ketacli update apps -o uninstall -e name=aws

# 重装/升级 app
ketacli update apps -o upgrade -e name=aws,version=1.0.1

# 终端画图
ketacli plot 'search2 start="-60m" repo="*" | timechart span="1m" count() as cnt by repo ' --y_field cnt --x_field _time --group_field repo --type line

# 内置仪表盘
ketacli dashboard -c infra-host  # 目前内置了infra-host audit k8s-monitor monitor四个仪表盘

自定义仪表盘

可参考示例仪表盘的 yaml 文件配置进行配置: charts

自动补全

在你的 .bashrc / .zshrc 中加入以下语句

zsh

eval "$(_KETACLI_COMPLETE=zsh_source ketacli)"

bash

eval "$(_KETACLI_COMPLETE=bash_source ketacli)"

Metadata

Release files for ketacli 2.10.0

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

Source distribution (sdist)

Source distribution for ketacli 2.10.0
File Size Uploaded Provenance Actions
ketacli-2.10.0.tar.gz 194.2 kB Without provenance Details for ketacli-2.10.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ketacli 2.10.0
File Interpreter ABI Platform Actions
ketacli-2.10.0-py3-none-any.whl Python 3 none any Details for ketacli-2.10.0-py3-none-any.whl

Total release size: 424.4 kB

Release files / ketacli-2.10.0.tar.gz

Download URL ketacli-2.10.0.tar.gz
Size 194.2 kB
Tags Source
SHA-256 checksum
How to use checksums
ccf0f61b635a83c8fffb758ab25274174ce62bf00e738a4f669909f777cb254a
BLAKE2b-256 checksum
How to use checksums
536e0309b13ba7983af070ff7cb15b7bd2a82b621c4f3508b7bad61b26b7edcc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.12

Release files / ketacli-2.10.0-py3-none-any.whl

Download URL ketacli-2.10.0-py3-none-any.whl
Size 230.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
707e7d5aebceffc5f7c3499a1ce6c6a0b1f7a1a1e5d77e3ef64a4e2944dd157b
BLAKE2b-256 checksum
How to use checksums
d9827665b0256b6e939dfb51db06dbb6b2e9599cfe6be4a296f378417a1274a6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.12

Security for ketacli 2.10.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

2.10.0 This release

2 release files No provenance

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