The web based syslog
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

111 lines
6.0KB

  1. -- --------------------------------------------------------
  2. -- Host: 127.0.0.1
  3. -- Server Version: 5.5.43-0+deb7u1 - (Debian)
  4. -- Server Betriebssystem: debian-linux-gnu
  5. -- HeidiSQL Version: 9.2.0.4971
  6. -- --------------------------------------------------------
  7. /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
  8. /*!40101 SET NAMES utf8mb4 */;
  9. /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
  10. /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
  11. -- Exportiere Struktur von Tabelle logger.hosts
  12. CREATE TABLE IF NOT EXISTS `hosts` (
  13. `id` int(11) NOT NULL AUTO_INCREMENT,
  14. `name` varchar(50) NOT NULL DEFAULT '0',
  15. PRIMARY KEY (`id`),
  16. UNIQUE KEY `name` (`name`)
  17. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  18. -- Daten Export vom Benutzer nicht ausgewählt
  19. -- Exportiere Struktur von View logger.LastHour
  20. -- Erstelle temporäre Tabelle um View Abhängigkeiten zuvorzukommen
  21. CREATE TABLE `LastHour` (
  22. `id` BIGINT(20) NOT NULL,
  23. `date` DATETIME NOT NULL,
  24. `facility` ENUM('kern','user','mail','daemon','auth','syslog','lpr','news','uucp','authpriv','ftp','cron','local0','local1','local2','local3','local4','local5','local6','local7') NOT NULL COLLATE 'utf8_general_ci',
  25. `level` ENUM('emerg','alert','crit','err','warning','notice','info','debug') NOT NULL COLLATE 'utf8_general_ci',
  26. `host` VARCHAR(50) NOT NULL COLLATE 'utf8_general_ci',
  27. `program` VARCHAR(50) NOT NULL COLLATE 'utf8_general_ci',
  28. `pid` INT(10) UNSIGNED NOT NULL,
  29. `message` TEXT NOT NULL COLLATE 'utf8_general_ci',
  30. `idhost` INT(11) NULL
  31. ) ENGINE=MyISAM;
  32. -- Exportiere Struktur von Tabelle logger.newlogs
  33. CREATE TABLE IF NOT EXISTS `newlogs` (
  34. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  35. `date` datetime NOT NULL,
  36. `facility` enum('kern','user','mail','daemon','auth','syslog','lpr','news','uucp','authpriv','ftp','cron','local0','local1','local2','local3','local4','local5','local6','local7') NOT NULL,
  37. `level` enum('emerg','alert','crit','err','warning','notice','info','debug') NOT NULL,
  38. `host` varchar(50) NOT NULL,
  39. `program` varchar(50) NOT NULL,
  40. `pid` int(10) unsigned NOT NULL,
  41. `message` text NOT NULL,
  42. `idhost` int(11) DEFAULT NULL,
  43. PRIMARY KEY (`id`),
  44. KEY `level` (`level`),
  45. KEY `host` (`host`),
  46. KEY `date` (`date`),
  47. KEY `idhost` (`idhost`),
  48. CONSTRAINT `FK_newlogs_hosts` FOREIGN KEY (`idhost`) REFERENCES `hosts` (`id`)
  49. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='New logging table';
  50. -- Daten Export vom Benutzer nicht ausgewählt
  51. -- Exportiere Struktur von View logger.Today
  52. -- Erstelle temporäre Tabelle um View Abhängigkeiten zuvorzukommen
  53. CREATE TABLE `Today` (
  54. `id` BIGINT(20) NOT NULL,
  55. `date` DATETIME NOT NULL,
  56. `facility` ENUM('kern','user','mail','daemon','auth','syslog','lpr','news','uucp','authpriv','ftp','cron','local0','local1','local2','local3','local4','local5','local6','local7') NOT NULL COLLATE 'utf8_general_ci',
  57. `level` ENUM('emerg','alert','crit','err','warning','notice','info','debug') NOT NULL COLLATE 'utf8_general_ci',
  58. `host` VARCHAR(50) NOT NULL COLLATE 'utf8_general_ci',
  59. `program` VARCHAR(50) NOT NULL COLLATE 'utf8_general_ci',
  60. `pid` INT(10) UNSIGNED NOT NULL,
  61. `message` TEXT NOT NULL COLLATE 'utf8_general_ci',
  62. `idhost` INT(11) NULL
  63. ) ENGINE=MyISAM;
  64. -- Exportiere Struktur von View logger.Week
  65. -- Erstelle temporäre Tabelle um View Abhängigkeiten zuvorzukommen
  66. CREATE TABLE `Week` (
  67. `id` BIGINT(20) NOT NULL,
  68. `date` DATETIME NOT NULL,
  69. `facility` ENUM('kern','user','mail','daemon','auth','syslog','lpr','news','uucp','authpriv','ftp','cron','local0','local1','local2','local3','local4','local5','local6','local7') NOT NULL COLLATE 'utf8_general_ci',
  70. `level` ENUM('emerg','alert','crit','err','warning','notice','info','debug') NOT NULL COLLATE 'utf8_general_ci',
  71. `host` VARCHAR(50) NOT NULL COLLATE 'utf8_general_ci',
  72. `program` VARCHAR(50) NOT NULL COLLATE 'utf8_general_ci',
  73. `pid` INT(10) UNSIGNED NOT NULL,
  74. `message` TEXT NOT NULL COLLATE 'utf8_general_ci',
  75. `idhost` INT(11) NULL
  76. ) ENGINE=MyISAM;
  77. -- Exportiere Struktur von View logger.LastHour
  78. -- Entferne temporäre Tabelle und erstelle die eigentliche View
  79. DROP TABLE IF EXISTS `LastHour`;
  80. CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `LastHour` AS select `newlogs`.`id` AS `id`,`newlogs`.`date` AS `date`,`newlogs`.`facility` AS `facility`,`newlogs`.`level` AS `level`,`newlogs`.`host` AS `host`,`newlogs`.`program` AS `program`,`newlogs`.`pid` AS `pid`,`newlogs`.`message` AS `message`,`newlogs`.`idhost` AS `idhost` from `newlogs` where (`newlogs`.`date` >= (now() - interval 1 hour));
  81. -- Exportiere Struktur von View logger.Today
  82. -- Entferne temporäre Tabelle und erstelle die eigentliche View
  83. DROP TABLE IF EXISTS `Today`;
  84. CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `Today` AS select `newlogs`.`id` AS `id`,`newlogs`.`date` AS `date`,`newlogs`.`facility` AS `facility`,`newlogs`.`level` AS `level`,`newlogs`.`host` AS `host`,`newlogs`.`program` AS `program`,`newlogs`.`pid` AS `pid`,`newlogs`.`message` AS `message`,`newlogs`.`idhost` AS `idhost` from `newlogs` where (cast(now() as date) = cast(`newlogs`.`date` as date));
  85. -- Exportiere Struktur von View logger.Week
  86. -- Entferne temporäre Tabelle und erstelle die eigentliche View
  87. DROP TABLE IF EXISTS `Week`;
  88. CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `Week` AS select `newlogs`.`id` AS `id`,`newlogs`.`date` AS `date`,`newlogs`.`facility` AS `facility`,`newlogs`.`level` AS `level`,`newlogs`.`host` AS `host`,`newlogs`.`program` AS `program`,`newlogs`.`pid` AS `pid`,`newlogs`.`message` AS `message`,`newlogs`.`idhost` AS `idhost` from `newlogs` where (`newlogs`.`date` >= (now() - interval 168 hour));
  89. /*!40101 SET SQL_MODE=IFNULL(@OLD_SQL_MODE, '') */;
  90. /*!40014 SET FOREIGN_KEY_CHECKS=IF(@OLD_FOREIGN_KEY_CHECKS IS NULL, 1, @OLD_FOREIGN_KEY_CHECKS) */;
  91. /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
Social stuff:
Mastodon