kusto
123 TopicsKQL String Search With Wildcards?
Is it possible to do KQL string searches with wildcards? For example, I'm hunting for files written to C:\ProgramData\ but I don't want to see files written to subfolders. I've done this in Splunk so I was surprised that the last line in my query below does not filter out anything. Show this: C:\ProgramData\evil.exe Filter this out: C:\ProgramData\MyApp\NotEvil.exe Query: DeviceFileEvents | where ActionType == "FileCreated" | where FolderPath contains "ProgramData" | where FolderPath !contains "ProgramData\\*\\*"Solved58KViews0likes2CommentsSearching Historical Logs for Threat Intelligence Matches.
Hello all, I was just wondering what the best or most efficient way to search logs for threat intelligence IOCs was, I saw a previous post explaining how to do it if you would like to search a large amount of values via watchlist but I would like to do it only for threat intelligence IOCs, I have a search below that works for IP addresses and can also be applied to file hashes. ThreatIntelligenceIndicator | where isnotempty(NetworkIP) | summarize by ThreatIntelIP=NetworkIP | join ( Network_MetaParser | where isnotempty(SrcIpAddr) | summarize by SrcIpAddr, DstIpAddr, EventProduct, DvcAction, DstPortNumber, NetworkProtocol, TimeGenerated ) on $left.ThreatIntelIP == $right.DstIpAddr My question is regarding URL/Domain names. How do I search my logs for any URLs/domains that match or contain the URL/Domain values from threat intelligence. I've tried doing something like the below but it doesn't seem to work. Any suggestions would be greatly appreciated! | summarize by URL | where isnotempty(URL) | where URL has_any (ThreatIntelligenceIndicator)17KViews0likes4Commentslist all log sources
So I'm just getting started with Microsoft Sentinel, and am looking for a way to produce a single report "listing all log sources". I'm looking for something like: TableName, SourceType, ComputerName I have tried CommonSecurityLog | summarize by DeviceVendor, Computer From Link, but Only get the first DeviceVendor (Fortinet in my case) but I don't get all other types.13KViews0likes3CommentsEscape character in KQL?
Hello guys, I have a problem where I'm unable to escape characters in my KQL query. We are ingesting some custom windows event logs that are being "normalized" in XML format. However, when sentinel normalizes these events, it puts all of them nested fields. Does this for some of the Azure logs as well. However, usually I can retrieve some data from those by using the following query AzureActivity | where OperationName == "signin" | expand Identity == OperationName.AdditionalFields.LoginIdentity So basically using the expand I extract identity field that is nested within other 2 fields. This works fine, however, the log I'm working with has numbers as field. So when I try the same thing but with AzureActivity | where OperationName == "signin" | expand Identity == OperationName.01.LoginIdentity It errors, it doesn't like that "01" part and query wont run, not that because 01 doesn't exist because it does but because its an integer? not sure. So I am trying to escape the "01" part. See below for the log example that might help explaining So in the image above, I want to extract fields like operation, processIdentity etc. So then I can use this fields for further filtering or use it to build a workbook. So then in my query I can say, WindowsEvent | where EventID = "7777" | where processIdentity = "identity" any help apricated 🙂12KViews0likes3CommentsCombine 2 columns in Single coulmn in KQL
Hi , I have data in sign-in logs as username and location, I want to combine username, location columns and add it to 3rd column. How I can do it in KQL. I have data like- User Name Location User-1 IN User-2 US User-3 GB User-4 MX I want it like following- User Details User-1 - IN User-2 - US User-3 - GB User-4 - MX9.9KViews0likes1CommentKQL query in sentinel for users first activity
Hi all, since I am new to writing queries I would really appreciate your help. I need to write a query that will show a specific users first activity and last activity in a day. I need to also project which activity it was and to sum it all up, I need the results to be in a row for each day. I would really appreciate any suggestions or help. Thank you9.4KViews0likes12CommentsUse "where contains" from a list
Hello, I have been trying to setup Linux audit logs in Azure Sentinel, using the OMS auditd parser found in the OMS agent. (Not AUOMS, which I can't use as I have isolated servers). Anyone who've played with auditd knows that the logs generated can be incredibly hard to do anything with, so I have set up keywords based on what I want to monitor for, however even then, I will still get some sort of "system noise" and filtering auditd is even harder, especially when some of the things logged can be relevant to threat hunting later on. So, I took a bit of a different approach, made sure we had the relevant rules setup in auditd and then sent that up to Sentinel, where I then decided to filter out slowly. However, it slowly became a long query filled with "excludes", i.e. where Column contains "XXXYYYZZZ". And I have to use contains, else I would have to set a column for each field in auditd and thus make it even harder to read and parse, with a huge amount of columns that serve no purpose. I have tried to put the events in "ConsoleCommand", "Execute" and "Process", as well as the normal ones such as CWD, Path, User etc. So essentially I have to exclude from 6-7 different fields and none of these field will ever only have the value that I want to exclude, so I have to use contains. Now, I wanted to do this in a smart way and instead of having to constantly update a function in Azure Sentinel, I am making use of externaldata, looking at a separate exclude list for each field, such as LinuxConsoleCommandExclude.txt, which have been uploaded to an Azure Storage Blob. There are in turn created from a csv file, with a self-made ExcludeID, Data (the string to exclude) and a comment field, so there is some sort of documentation as to why we exclude this. I have done this as I have found no way to make use of externaldata to only look at the second column. But I digress, I just wanted to explain the setup. So, LinuxConsoleCommandExeclude.txt contains something like: logrotate chown omsagent.omiusers /opt/microsoft/auoms/bin/auomsctl -s Now, I would like to have a "foreach" kind of thing, with the contains string operator, but as far as I have found out, the only string operator that actually has this feature is in. So how do I do this right or am I really just setting myself up for failure here? I wish I could set this up in a datatable, just to provide an example but the amount of noise auditd but here is an example of an output I have created, with my homebrew parser: SerialNumber 8063430 Computer anonymous-system PPID ["3768"] PID ["3789"] AUID ["471"] RecordTypes ["SYSCALL","EXECVE","CWD","PATH","PROCTITLE"] Keyword ["T1166_Seuid_and_Setgid"] Executable ["PROCTITLE: 2F6F70742F6D6963726F736F66742F61756F6D732F62696E2F61756F6D7363746C002D73","PATH: ","CWD: ","EXECVE: ","SYSCALL: /opt/microsoft/auoms/bin/auomsctl "] Process [] ConsoleCommand ["EXECVE: /opt/microsoft/auoms/bin/auomsctl -s ","SYSCALL: 564fb89d63a0 564fb89d75c0 564fb89d6d80 5b9"] TTY ["(none)"] Succesful ["yes"] User ["root"] AuditUser ["omsagent"] CurrentWorkingDirectory ["/opt/microsoft/omsconfig/Scripts/2.6x-2.7x"] Path ["/lib64/ld-linux-x86-64.so.2","/opt/microsoft/auoms/bin/auomsctl"] Just to add: I am not looking for ways to filter out the example, this is an extreme example. I am mainly asking for a way to have where contains to actually do a foreach based on a list as the alternative would be messy and hard to administer.Solved8.3KViews0likes4CommentsKusto query question, expanding multi-row, getting values from named keys
I want to query the OfficeActivity table and pull out values from the Parameters field. The field is a JSON string, so i know i need to convert to to Dynamic, and then i need to get values for Identity and User etc. I do not know what position the Identity and User appear so i cannot use normal [0] or [1] indexing. I would like the end result to be something like this. TimeGenerated Operation UserId Paramters.Identity Parameters.User Parameters.AccessRights x/x/x/ Add-MailboxPermission Bob John Peter FullAccess7.8KViews0likes7Comments