Example for MySQL or MariaDB:
SELECT
/* event identifier */
`e`.`nId`,
/* time, when the event occurred */
`e`.`tmRiseTime`,
/* internal name of the event type */
`e`.`strEventType`,
/* displayed name of the event */
`e`.`wstrEventTypeDisplayName`,
/* displayed description of the event */
`e`.`wstrDescription`,
/* device group name */
`e`.`wstrGroupName`,
/* displayed name of the device, on which the event occurred */
`h`.`wstrDisplayName`,
CONCAT(
LEFT(CAST(((`h`.`nIp` DIV 1677721) & 255) AS CHAR), 4), '.',
LEFT(CAST(((`h`.`nIp` DIV 65536) & 255) AS CHAR), 4), '.',
LEFT(CAST(((`h`.`nIp` DIV 256) & 255) AS CHAR), 4), '.',
/* IP address of the device, on which the event occurred */
LEFT(CAST(((`h`.`nIp`) & 255) AS CHAR), 4)
) AS `strIp`
FROM `v_akpub_ev_event` AS `e`
INNER JOIN `v_akpub_host` AS `h` ON `h`.`nId` = `e`.`nHostId`
WHERE `e`.`tmRiseTime` >= ADDDATE( UTC_TIMESTAMP( ) , INTERVAL -7 DAY)
ORDER BY `e`.`tmRiseTime` DESC ;
|