This query is meant to show me a short amount of time where a file was created and deleted/rename itself, but it just throwing an error “An unexpected error occurred during query execution. Please try again in a few minutes.”:
DeviceFileEvents
| where Timestamp > ago(3d)
| where ActionType == "FileCreated" or ActionType == "FileRenamed"
| where FileName endswith ".exe"
| join kind=inner (DeviceProcessEvents)
on DeviceId
| where Timestamp1 > ago(3d)
| where FolderPath == FolderPath1
| where InitiatingProcessFileName1 == "explorer.exe" or InitiatingProcessParentFileName1 == "explorer.exe"
| where (Timestamp1 - Timestamp) < timespan(5m) and (Timestamp1 - Timestamp) > timespan(0m)
| extend Difference = Timestamp1 - Timestamp
| project-rename Created=Timestamp, Executed=Timestamp1, ProcessFileName=FileName1, ProcHash=SHA2561
| project Created, PreviousFileName, Executed, Difference, DeviceName, ProcessFileName, FolderPath, AccountName, ProcessCommandLine, ProcHash
| order by Created desc
Rewrote it multiple times but still erroring, it looks like there no syntax error so the query is correct right?