2024-08-01 11:02:37 -05:00
|
|
|
class sqlQuerymodel:
|
2024-08-10 00:49:53 -05:00
|
|
|
def queryData(overRideflag, configQuery):
|
2024-08-01 11:02:37 -05:00
|
|
|
"""Embedded query data"""
|
|
|
|
q ="""DECLARE @stopTime DATETIME2
|
|
|
|
SET @stopTime=DATEADD(DAY, -30, GETDATE())
|
2024-08-10 00:49:53 -05:00
|
|
|
SELECT p.ProtocolCommandID, t.Time_stamp, p.RemoteIP, p.RemotePort, p.LocalIP, p.LocalPort, p.Protocol, p.SiteName, p.Command, p.FileName, p.VirtualFolderName, p.FileSize, p.TransferTime, p.BytesTransferred, p.Description, p.ResultID, t.TransactionID, p.Actor, t.TransactionObject, t.NodeName, t.TransactionGUID, a.Protocol user_type
|
2024-08-01 11:02:37 -05:00
|
|
|
FROM tbl_Transactions t
|
|
|
|
Full JOIN tbl_ProtocolCommands p ON(t.TransactionID=p.TransactionID)
|
|
|
|
Full join tbl_Authentications a ON(t.TransactionID=a.TransactionID)
|
2024-08-10 00:49:53 -05:00
|
|
|
WHERE p.Time_stamp>@stopTime AND p.Command IS NOT NULL"""
|
|
|
|
return configQuery if overRideflag else q
|