mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Added Graylog to device overview and log level filter mechanism (#10509)
* Added Recent Graylog Entries to Device Overview (WIP) * Improved "Recent Graylog" entries on device overview (WIP) Added $config['graylog']['device-page']['rowCount'] to set maximum rows shown in "Recent Graylog" on device overview (Default: 10) Added $config['graylog']['device-page']['maxLevel'] to set the maximum message level shown in "Recent Graylog" on device overview (Default: 7, validates value to be >= 0 and <= 7) * Fixed code styling issue * Added Log Level filter to Graylog widget Added Log Level filter to Graylog pages (device pages and graylog overview) * Added documentation for new configuration options * Removed unneccesary (and already commented) using Renamed "maxLevel" to "loglevel" as suggested by a colleague * Added doc for $config['graylog']['loglevel'] * Removed includes/html/print-graylog.inc.php and inlined it in includes/html/pages/device/overview/graylog.inc.php Removed comma in json object in resources/views/widgets/graylog.blade.php Replaced translation strings in resources/views/widgets/settings/graylog.blade.php with existing translation strings * log level -> minimum log level * Use Config::get() default functionality * Oops
This commit is contained in:
@@ -58,6 +58,7 @@ class GraylogController extends SimpleTableController
|
||||
'stream' => 'nullable|alpha_num',
|
||||
'device' => 'nullable|int',
|
||||
'range' => 'nullable|int',
|
||||
'loglevel' => 'nullable|int|min:0|max:7',
|
||||
]);
|
||||
|
||||
$search = $request->get('searchPhrase');
|
||||
@@ -67,7 +68,10 @@ class GraylogController extends SimpleTableController
|
||||
$limit = $request->get('rowCount', 10);
|
||||
$page = $request->get('current', 1);
|
||||
$offset = ($page - 1) * $limit;
|
||||
$query = $api->buildSimpleQuery($search, $device);
|
||||
$loglevel = $request->get('loglevel') ?? Config::get('graylog.loglevel');
|
||||
|
||||
$query = $api->buildSimpleQuery($search, $device).
|
||||
($loglevel !== null ? ' AND level: <='. $loglevel : '');
|
||||
|
||||
$sort = null;
|
||||
foreach ($request->get('sort', []) as $field => $direction) {
|
||||
|
||||
Reference in New Issue
Block a user