跳转到主要内容

在此处添加简短描述!

项目描述

Bonfire是通过REST API查询Graylog搜索的命令行界面。它试图模拟在本地文件上使用tail的感觉。

用法

示例

> bonfire -h logserver -u jdoe -@ "10 minutes ago" "*"
...

> bonfire -h logserver -u jdoe -f "source:localhost AND level:2"
...

Bonfire用法

Usage: bonfire [OPTIONS] [QUERY]

  Bonfire - An interactive graylog cli client

Options:
  --node TEXT                     Label of a preconfigured graylog node
  -h, --host TEXT                 Your graylog node's host
  -s, --tls                       Use HTTPS
  --port INTEGER                  Your graylog port (default: 12900)
  --endpoint TEXT                 Your graylog API endpoint e.g /api (default:
                                  /)
  -u, --username TEXT             Your graylog username
  -p, --password TEXT             Your graylog password (default: prompt)
  -k, --keyring / -nk, --no-keyring
                                  Use keyring to store/retrieve password
  -@, --search-from TEXT          Query range from
  -#, --search-to TEXT            Query range to (default: now)
  -t, --tail                      Show the last n lines for the query
                                  (default)
  -d, --dump                      Print the query result as a csv
  -o, --output TEXT               Output logs to file (only tail/dump mode)
  -f, --follow                    Poll the logging server for new logs
                                  matching the query (sets search from to now,
                                  limit to None)
  -l, --interval INTEGER          Polling interval in ms (default: 1000)
  -n, --limit INTEGER             Limit the number of results (default: 10)
  -a, --latency INTEGER           Latency of polling queries (default: 2)
  -r, --stream TEXT               Stream ID of the stream to query (default:
                                  no stream filter)
  -e, --field TEXT                Fields to include in the query result
  -x, --template-option TEXT      Template options for the stored query
  -s, --sort TEXT                 Field used for sorting (default: timestamp)
  --asc / --desc                  Sort ascending / descending
  --help                          Show this message and exit.

配置

Bonfire可以进行配置。它将查找~/.bonfire.cfg或当前目录中的bonfire.cfg。配置文件可以指定API节点。如果没有指定主机,将使用名为default的节点。您还可以配置查询,这些查询可以通过以冒号开始查询来引用

[node:default]
host=1.2.3.4
port=12900
endpoint=/
username=jdoe

[node:dev]
host=4.3.2.1
port=9000
endpoint=/api
username=jdoe

[query:example]
query=facility:*foo* AND source:*bar*
from=2015-03-01 15:00:00
limit=100
fields=message,name,facility,source

现在您可以运行查询,例如

> bonfire --node=dev :example
... runs the example query on the node dev

> bonfire :example
... runs the example query on the default node

查询模板

选项

查询

已知问题

  • bonfire期望graylog的时间区为UTC。

发布说明

  • v0.0.7: 问题修复,TLS和代理支持
    • 添加代理支持

    • 添加对https URL的支持

    • 在转储格式中添加时间戳

  • v0.0.6: 文档修复
    • 修改README.rst

  • v0.0.5: 清理
    • 删除终端UI想法

    • 添加第一次测试

    • 修复日期和时间处理(时区)

    • 添加python3兼容性

  • v0.0.4: 扩展文档和流访问
    • 如果没有指定流且用户没有全局搜索权限,则使用用户可访问的第一个流

  • v0.0.3: 小型修复
    • 在GET请求中使用accept头部。

    • 修复查询特定字段时的错误

  • v0.0.1: 初次发布
    • 功能集有限。

项目详情


下载文件

下载适用于您平台的文件。如果您不确定选择哪个,请了解有关安装包的更多信息。

源分发

bonfire-0.0.8.tar.gz (15.0 kB 查看哈希值)

上传时间

构建分发

bonfire-0.0.8-py3-none-any.whl (16.4 kB 查看哈希值)

上传时间 Python 3

由以下机构支持

AWS AWS 云计算和安全赞助商 Datadog Datadog 监控 Fastly Fastly CDN Google Google 下载分析 Microsoft Microsoft PSF赞助商 Pingdom Pingdom 监控 Sentry Sentry 错误记录 StatusPage StatusPage 状态页面