New to Sentinel and KQL, looking to parse SyslogMessage String data

%3CLINGO-SUB%20id%3D%22lingo-sub-1512758%22%20slang%3D%22en-US%22%3ENew%20to%20Sentinel%20and%20KQL%2C%20looking%20to%20parse%20SyslogMessage%20String%20data%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1512758%22%20slang%3D%22en-US%22%3E%3CP%3EI%20have%20some%20windows%20events%20being%20forwarded%20as%20syslog%20and%20the%20data%20is%20coming%20in%20to%20Sentinel%20as%20one%20long%20string%20with%20ascii%20codes.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI'm%20trying%20to%20find%20a%20way%20to%20parse%20this%20data%20or%20break%20it%20up%20into%20additional%20tables.%20So%20that%20it%20can%20be%20searched%20and%20action%20items%20can%20be%20created%20specifically%20for%20the%20event%20ID.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EString%20Data%20in%20the%20SyslogMessage%20field%3A%3C%2FP%3E%3CTABLE%3E%3CTBODY%3E%3CTR%3E%3CTD%3E%3CDIV%3E17%3A39%202020%3CFONT%20color%3D%22%230000FF%22%3E%23011%3C%2FFONT%3E4634%3CFONT%20color%3D%22%230000FF%22%3E%23011%3C%2FFONT%3EMicrosoft-Windows-Security-Auditing%3CFONT%20color%3D%22%230000FF%22%3E%23011%23011%3C%2FFONT%3EN%2FA%3CFONT%20color%3D%22%230000FF%22%3E%23011%3C%2FFONT%3EAudit%20Success%3CFONT%20color%3D%22%230000FF%22%3E%23011%3C%2FFONT%3E(FQDN%20Hostname)%3CFONT%20color%3D%22%230000FF%22%3E%23011%3C%2FFONT%3E12545%3CFONT%20color%3D%22%230000FF%22%3E%23011%3C%2FFONT%3EAn%20account%20was%20logged%20off.%3CFONT%20color%3D%22%230000FF%22%3E%23015%23012%23015%23012%3C%2FFONT%3ESubject%3A%3CFONT%20color%3D%22%230000FF%22%3E%23015%23012%23011%3C%2FFONT%3ESecurity%20ID%3A%3CFONT%20color%3D%22%230000FF%22%3E%23011%23011%3C%2FFONT%3ES-1-5-21-3268862665-1393187318-1665994716-32848%3CFONT%20color%3D%22%230000FF%22%3E%23015%23012%23011%3C%2FFONT%3EAccount%20Name%3A%3CFONT%20color%3D%22%230000FF%22%3E%23011%23011%3C%2FFONT%3E(SAMAccountName)%3CFONT%20color%3D%22%230000FF%22%3E%23015%23012%23011%3C%2FFONT%3EAccount%20Domain%3A%3CFONT%20color%3D%22%230000FF%22%3E%23011%23011%3C%2FFONT%3E(Domain)%3CFONT%20color%3D%22%230000FF%22%3E%23015%23012%23011%3C%2FFONT%3ELogon%20ID%3A%3CFONT%20color%3D%22%230000FF%22%3E%23011%23011%3C%2FFONT%3E0x13A10172%3CFONT%20color%3D%22%230000FF%22%3E%23015%23012%23015%23012%3C%2FFONT%3ELogon%20Type%3A%3CFONT%20color%3D%22%230000FF%22%3E%23011%23011%23011%3C%2FFONT%3E3%3CFONT%20color%3D%22%230000FF%22%3E%23015%23012%23015%23012%3C%2FFONT%3EThis%20event%20is%20generated%20when%20a%20logon%20session%20is%20destroyed.%20It%20may%20be%20positively%20correlated%20with%20a%20logon%20event%20using%20the%20Logon%20ID%20value.%20Logon%20IDs%20are%20only%20unique%20between%20reboots%20on%20the%20same%20computer.%3C%2FDIV%3E%3C%2FTD%3E%3C%2FTR%3E%3C%2FTBODY%3E%3C%2FTABLE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThis%20data%20is%20coming%20from%20Solarwinds%20and%20being%20forwarded%20to%20Sentinel%20via%20CEF%20forwarder.%20There%20is%20currently%20no%20connector%20for%20this.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1512758%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EAzure%20Log%20Analytics%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1514342%22%20slang%3D%22en-US%22%3ERe%3A%20New%20to%20Sentinel%20and%20KQL%2C%20looking%20to%20parse%20SyslogMessage%20String%20data%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1514342%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F724006%22%20target%3D%22_blank%22%3E%40Reedk%3C%2FA%3E%2C%3C%2FP%3E%0A%3CP%3EYou%20can%20generally%20use%20the%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fazure%2Fdata-explorer%2Fkusto%2Fquery%2Fparseoperator%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%22%3Eparse%20operator%3C%2FA%3E%20to%20break%20a%20text%20into%20different%20fields%2C%20and%20then%20continue%20analyzing%20it%20as%20you%20want.%20In%20this%20case%2C%20your%20string%20is%20a%20bit%20confusing%20with%20many%20%23011%20%23012%20%23015%20delimiters%2C%20so%20first%20you%20should%20think%20how%20you%20want%20to%20parse%20it%20so%20it%20would%20make%20sense.%3C%2FP%3E%0A%3CP%3EI%20took%20a%20shot%20at%20it%3A%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-applescript%22%3E%3CCODE%3Elet%20TestStr%20%3D%20datatable(EventText%3Astring)%0A%5B%2217%3A39%202020%230114634%23011Microsoft-Windows-Security-Auditing%23011%23011N%2FA%23011Audit%20Success%23011(FQDN%20Hostname)%2301112545%23011An%20account%20was%20logged%20off.%23015%23012%23015%23012Subject%3A%23015%23012%23011Security%20ID%3A%23011%23011S-1-5-21-3268862665-1393187318-1665994716-32848%23015%23012%23011Account%20Name%3A%23011%23011(SAMAccountName)%23015%23012%23011Account%20Domain%3A%23011%23011(Domain)%23015%23012%23011Logon%20ID%3A%23011%230110x13A10172%23015%23012%23015%23012Logon%20Type%3A%23011%23011%230113%23015%23012%23015%23012This%20event%20is%20generated%20when%20a%20logon%20session%20is%20destroyed.%20It%20may%20be%20positively%20correlated%20with%20a%20logon%20event%20using%20the%20Logon%20ID%20value.%20Logon%20IDs%20are%20only%20unique%20between%20reboots%20on%20the%20same%20computer.%22%5D%3B%0ATestStr%0A%7C%20parse%20kind%3Drelaxed%20EventText%20with%20EventTime%20%22%23011%22%20SomeID1%20%22%23011%22%20EventCategory%20%22%23011%22%20SomeField1%20%22%23011%22%20SomeField2%20%22%23011%22%20EventResult%20%22%23011%22%20SomeField3%20%22%23011%22%20SomeID2%20%22%23011%22%20EventDescription%20%22%23015%23012%23015%23012%22%20MoreDetails%0A%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3BThe%20result%20was%3A%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22parse.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F204599i2E75A928B4454C8E%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22parse.png%22%20alt%3D%22parse.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EYou%20can%20use%20regex%20as%20well%2C%20check%20out%20the%20documentation%20in%20the%20above%20link.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EHTH%3C%2FP%3E%3C%2FLINGO-BODY%3E
Occasional Visitor

I have some windows events being forwarded as syslog and the data is coming in to Sentinel as one long string with ascii codes.

 

I'm trying to find a way to parse this data or break it up into additional tables. So that it can be searched and action items can be created specifically for the event ID.

 

String Data in the SyslogMessage field:

17:39 2020#0114634#011Microsoft-Windows-Security-Auditing#011#011N/A#011Audit Success#011(FQDN Hostname)#01112545#011An account was logged off.#015#012#015#012Subject:#015#012#011Security ID:#011#011S-1-5-21-3268862665-1393187318-1665994716-32848#015#012#011Account Name:#011#011(SAMAccountName)#015#012#011Account Domain:#011#011(Domain)#015#012#011Logon ID:#011#0110x13A10172#015#012#015#012Logon Type:#011#011#0113#015#012#015#012This event is generated when a logon session is destroyed. It may be positively correlated with a logon event using the Logon ID value. Logon IDs are only unique between reboots on the same computer.

 

This data is coming from Solarwinds and being forwarded to Sentinel via CEF forwarder. There is currently no connector for this.

 

 

1 Reply

Hi @Reedk,

You can generally use the parse operator to break a text into different fields, and then continue analyzing it as you want. In this case, your string is a bit confusing with many #011 #012 #015 delimiters, so first you should think how you want to parse it so it would make sense.

I took a shot at it:

let TestStr = datatable(EventText:string)
["17:39 2020#0114634#011Microsoft-Windows-Security-Auditing#011#011N/A#011Audit Success#011(FQDN Hostname)#01112545#011An account was logged off.#015#012#015#012Subject:#015#012#011Security ID:#011#011S-1-5-21-3268862665-1393187318-1665994716-32848#015#012#011Account Name:#011#011(SAMAccountName)#015#012#011Account Domain:#011#011(Domain)#015#012#011Logon ID:#011#0110x13A10172#015#012#015#012Logon Type:#011#011#0113#015#012#015#012This event is generated when a logon session is destroyed. It may be positively correlated with a logon event using the Logon ID value. Logon IDs are only unique between reboots on the same computer."];
TestStr
| parse kind=relaxed EventText with EventTime "#011" SomeID1 "#011" EventCategory "#011" SomeField1 "#011" SomeField2 "#011" EventResult "#011" SomeField3 "#011" SomeID2 "#011" EventDescription "#015#012#015#012" MoreDetails

 The result was:

parse.png

You can use regex as well, check out the documentation in the above link.

 

HTH