Nov 15 2023 02:04 AM
Hi,
I'm searching through AuditLogs to check for a previous event and using the let statement to assign to a temporary table called AuditSearch.
Another search of the AuditLog is being done with following where statement to see if a previous entry exists. This works Ok if a record is added to the temporary table, however if no records are there and is empty the where statement doesn't work.
Q what is what the best way to either
- check for the temporary table has no records
or add a dummy record to the table. as long as something exists it works doesnt need to match.
| where | where User !in (AuditSearch)
thanks
Lee
Nov 15 2023 06:14 AM
Perhaps create a fake table and use Union isfuzzy=true to handle the error?
let AuditSearch = materialize ( AuditLogs
| distinct OperationName);
let fake_ = datatable (name:string)['fake value'];
union isfuzzy=true AuditSearch, fake_
//| extend OperationName = "This is not in the original" /// supply a made up value
| where OperationName !in (AuditSearch)
| distinct OperationName
Nov 20 2023 01:10 AM