diff --git a/doc/Extensions/Graylog.md b/doc/Extensions/Graylog.md index 6370acb98d..72ee93ec66 100644 --- a/doc/Extensions/Graylog.md +++ b/doc/Extensions/Graylog.md @@ -24,6 +24,13 @@ $config['graylog']['password'] = 'admin'; $config['graylog']['version'] = '2.1'; ``` +Graylog messages are stored using GMT timezone. You can display graylog messages in LibreNMS webui using your desired timezone by setting following option in config.php: + +```php +$config['graylog']['timezone'] = 'Europe/Bucharest'; +``` +> Timezone must be PHP supported timezones, available at: http://php.net/manual/en/timezones.php + > Since Graylog 2.1, the default API path is /api/ If you are running a version earlier than Graylog then please set `$config['graylog']['version']` to the version diff --git a/html/includes/common/graylog.inc.php b/html/includes/common/graylog.inc.php index 470d63671d..26da6d9f17 100644 --- a/html/includes/common/graylog.inc.php +++ b/html/includes/common/graylog.inc.php @@ -1,5 +1,4 @@ Graylog
| Timestamp | +Timestamp | Source | Message | Facility | @@ -71,6 +76,12 @@ if (empty($filter_device) && isset($_POST['hostname'])) { $filter_device = mres($_POST['hostname']); } +if (isset($config['graylog']['timezone'])) { + $timezone = 'row.timestamp;'; +} else { + $timezone = 'moment.parseZone(row.timestamp).local().format("YYYY-MM-DD HH:MM:SS");'; +} + $tmp_output .= ' "
|---|