Parse the "Account Name:" value from the log results

Log content:

"A user account was locked out.

Subject:Security ID: S-1-5-18Account Name: ABCASD$Account Domain: ABCLogon ID: 0x3E7Account That Was Locked Out:Security ID: S-1-5-21-436374069-1592454029Account Name:      xyz123Additional Information:Caller Computer Name:

"

--------------------------------------------

I’m using this DQL but not getting the expected results:

fetch logs
| filter contains(content, “A user account was locked out”)
| parse content, “LD ‘Account That Was Locked Out:’ LD ‘Account Name:’ LD:locked_out_account_name”
| fields timestamp, locked_out_account_name, content

----------------------------------------------

Hi,

I was testing your DPL and I think the solution would be to replace the first two ‘LD’ with ‘DATA’, so it would look like this:

DATA 'Account That Was Locked Out:' DATA 'Account Name:' LD:locked_out_account_name

Here’s documentation explaining why ‘DATA’ should be used in this case: DPL Lines and Strings — Dynatrace Docs

It worked! Thank you.

Thanks a lot! :slightly_smiling_face: Until now I thought that DATA and LD were the same (that’s why I was only using LD—it’s shorter). Also, whenever I needed a new line, I was always adding \n  … :grinning_face: