0

Using osquery on my linux machine (CentOS 7 if it matters) I get automatic verbose info output about migrations when running every query using the osqueryi interactive shell. Is there any way to quiet/hide such output and return only results?

What I have:

# 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"}]

What I want:

# 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"}]
Devin
  • 1,011
  • 2
  • 14
  • 30

1 Answers1

3

You can add --logger_min_status 1 to the command line, but hopefully https://github.com/facebook/osquery/pull/5530 should fix this behaviour by default.

fmanco
  • 145
  • 3
  • any chance you'd know about https://stackoverflow.com/questions/55188336/osquery-warnings-when-using-osqueryi-and-logging-disabled – Devin Mar 15 '19 at 17:58
  • This is fixed in the current stable release. (4.0.2) – seph Sep 13 '19 at 06:33