مثال لاستعلام SQL في أداة klsql2 المساعدة

يعرض هذا القسم مثالاً لاستعلام SQL، الذي يتم تنفيذه بواسطة أداة klsql2 المساعدة.

يوضح المثال التالي استعادة الأحداث التي حدثت في الأجهزة خلال السبعة أيام الماضية، وعرض للأحداث التي طُلبت وقت حدوثها. ويتم عرض الأحداث الأخيرة أولاً.

مثال:

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,‏

 

/* name of the group, where the device is located */

e.wstrGroupName,‏

 

/* displayed name of the device, on which the event occurred */

h.wstrDisplayName,‏

CAST(((h.nIp / 16777216) & 255) AS varchar(4)) + '.' +

CAST(((h.nIp / 65536) & 255) AS varchar(4)) + '.' +

CAST(((h.nIp / 256) & 255) AS varchar(4)) + '.' +

 

/* IP-address of the device, on which the event occurred */

CAST(((h.nIp) & 255) AS varchar(4)) as strIp

FROM v_akpub_ev_event e

INNER JOIN v_akpub_host h ON h.nId=e.nHostId

WHERE e.tmRiseTime>=DATEADD(Day, -7, GETUTCDATE())

ORDER BY e.tmRiseTime DESC

انظر أيضًا:

تكوين تصدير الحدث إلى أنظمة SIEM

أعلى الصفحة