Osquery (im_osquery)
This module is a wrapper for the Osquery monitoring tool. It uses filesystem-based configurations to manage its lifecycle and collect OS-specific data, ensuring seamless integration with Osquery system monitoring workflows.
Currently, the module does not support other osqueryd
instances running in prallel wth it.
This module is still in development and will include new functionality and improvements in future NXLog versions. |
To examine the supported platforms, see the list of installer packages in the Available Modules chapter. |
Configuration
The im_osquery module accepts the following directives in addition to the common module directives.
Required directives
The following directives are required for the module to start.
Block directive to define scheduled queries and their parameters. You can specify more than one QueryMap directive in the same module instance. QueryMap supports the following directives:
|
Optional directives
Boolean directive to specify whether NXLog should monitor the |
|
Boolean directive to specify whether the module should delete all Osquery log files when it stops.
The |
|
Boolean directive to specify whether the module should create the folder specified by the Path directive if it does not exist.
The default value is |
|
Boolean directive to specify if all |
|
Boolean directive to specify whether to rotate the logs when they exceed the size limit defined by LogRotationSize.
The default value is |
|
Specifies the maximum |
|
Specifies the full folder path where the If this directive is not specified, the module creates a sub-folder in the SpoolDir directory.
For example, if SpoolDir is |
|
This optional boolean directive instructs the module whether to save the position of the last read event before NXLog exits. On the next startup, NXLog will try to read the saved position from the cache file. When This directive can be overridden by the global NoCache directive.
If NoCache is |
Examples
This configuration creates event records from three Osquery tables—system_info
, memory_info
, and osquery_info
.
<Input osquery> Module im_osquery <QueryMap> Name system_info Query "SELECT * FROM system_info" </QueryMap> <QueryMap> Name memory_usage Query "SELECT * FROM memory_info" Removed FALSE </QueryMap> <QueryMap> Name processes Query "SELECT i.*, p.resident_size, p.user_time, p.system_time, t.minutes AS c FROM osquery_info i, processes p, time t WHERE p.pid = i.pid;" </QueryMap> </Input>