0

在我的 linux 机器上使用 osquery(如果重要的话是 CentOS 7),当使用osqueryi交互式 shell 运行每个查询时,我会自动获得有关迁移的详细信息输出。有没有办法安静/隐藏这样的输出并只返回结果?

我有的:

# osqueryi --json "SELECT * FROM memory_info";

I0228 15:39:12.077577  6039 database.cpp:563] Checking database version for migration
I0228 15:39:12.077644  6039 database.cpp:587] Performing migration: 0 -> 1
I0228 15:39:12.077657  6039 database.cpp:619] Migration 0 -> 1 successfully completed!
I0228 15:39:12.077663  6039 database.cpp:587] Performing migration: 1 -> 2
I0228 15:39:12.077672  6039 database.cpp:619] Migration 1 -> 2 successfully completed!

[{"active":"320831488","buffers":"2158592","cached":"379183104","inactive":"130363392","memory_free":"1393258496","memory_total":"1928024064","swap_cached":"0","swap_free":"1610608640","swap_total":"1610608640"}]

我想要的是:

# osqueryi --json "SELECT * FROM memory_info";

[{"active":"320831488","buffers":"2158592","cached":"379183104","inactive":"130363392","memory_free":"1393258496","memory_total":"1928024064","swap_cached":"0","swap_free":"1610608640","swap_total":"1610608640"}]
4

1 回答 1

3

您可以添加--logger_min_status 1到命令行,但希望https://github.com/facebook/osquery/pull/5530默认会修复此行为。

于 2019-03-14T21:51:47.980 回答