# Why is this so hard -- Simple log parsing

**URL:** <https://community.dynatrace.com/t/why-is-this-so-hard-simple-log-parsing/56298>\
**Category:** DQL\
**Tags:** dql, dpl, logs\
**Created:** [June 25, 2026, 8:46pm UTC](https://community.dynatrace.com/t/why-is-this-so-hard-simple-log-parsing/56298 "2026-06-25T20:46:01Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jim\_hinze](https://avatars.discourse-cdn.com/v4/letter/j/258eb7/32.png) [@jim\_hinze](https://community.dynatrace.com/u/jim_hinze)\
**Post date:** [June 25, 2026, 8:46pm UTC](https://community.dynatrace.com/t/why-is-this-so-hard-simple-log-parsing/56298/1 "2026-06-25T20:46:01Z")

</div>

Sometimes this works, sometimes it does not… and quite frankly, the documentation is not helpful. Here is a log entry:

Jun 25 15:31:20 HOSTNAME CEF:0|Netwrix|Activity Monitor|9.0.1477|Windows File SystemReadTrueFalse|FileMonitor|3|rt=2026-06-25 15:31:20.431 sntdom=MYDOMAIN suser=MYDOMAIN\asmith src=192.168.241.12 duser= **C:\cycfgvol1\DEMProfile10\asmith\Desktop\MyCo Service Portal.lnk** shost=MYCONETNAS01 msg=Policy Name= FileMonitor Object Class= Success= True Blocked= False Attribute Name= New Attribute Value= Old Attribute Value= Operation= Read

The part that is bold and underlined is what I want to extract. Below is the DQL query I’m presently attempting to use (I get null values)

fetch logs  
| parse content,“'duser= ’ ALNUM:fPath 'shost=”  
| filter ((matchesValue(dt.ingest.source.ip, “192.168.2.88”)))

I’ve also tried:

fetch logs  
| parse content,“LD:text 'duser= ’ LD{0,255}:thread1 ‘shost=’”  
| filter ((matchesValue(dt.ingest.source.ip, “192.168.2.88”)))

and the weird part, parsing another string out of the log line, this works…

fetch logs  
| parse content, “LD:text ‘|Windows File’ LD{0,100}:PureCommand ‘|’”  
| fields PureCommand, dt.ingest.source.ip, content  
| filter ((matchesValue(dt.ingest.source.ip, “10.20.11.88”)) )

Ideally, I would like to extract both fields in the same DQL query.

P.S. - if anyone has a “real” source of documentation for parse and DPL I’d be very interested in it… the 2 pages in the official doc’s are sorely lacking.

Thank you in advance.

---

<div class="post-metadata">

**Author:** ![jim\_hinze](https://avatars.discourse-cdn.com/v4/letter/j/258eb7/32.png) [@jim\_hinze](https://community.dynatrace.com/u/jim_hinze)\
**Post date:** [June 25, 2026, 9:35pm UTC](https://community.dynatrace.com/t/why-is-this-so-hard-simple-log-parsing/56298/2 "2026-06-25T21:35:46Z")

</div>

Update…

This works

fetch logs  
| parse content, “”“LD ‘duser=’ LD:test ‘shost=’”“”

Next question, if I wanted to parse out part of the path returned, how do I escape the ‘\’

The following doesn’t work

fetch logs  
| parse content, “”“LD ‘duser=c:\\cycfgvol1\\’ LD:test ‘shost=’”“”

---

<div class="post-metadata">

**Author:** ![Julius\_Loman](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/julius_loman/32/51_2.png) [@Julius\_Loman](https://community.dynatrace.com/u/Julius_Loman)\
**Post date:** [June 25, 2026, 9:39pm UTC](https://community.dynatrace.com/t/why-is-this-so-hard-simple-log-parsing/56298/3 "2026-06-25T21:39:37Z")

</div>

Use DPL architect (click on extract fields).  
Probably you want something this (use any line data for duser value, extract into duser field until shost= is found:

```markup
| parse content, """LD 'duser=' LD:duser ' shost='"""

```

---

<div class="post-metadata">

**Author:** ![GerardJ](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/gerardj/32/154_2.png) [@GerardJ](https://community.dynatrace.com/u/GerardJ)\
**Post date:** [June 26, 2026, 6:14am UTC](https://community.dynatrace.com/t/why-is-this-so-hard-simple-log-parsing/56298/4 "2026-06-26T06:14:32Z")

</div>

Maybe you can try with this approach, extracting the fields with DPL, then parse the path with DQL

```markup
| parse content, """LD '|Windows File' LD:PureCommand '|' LD "duser=" LD:path "shost=""""
| fieldsAdd pathArray=splitString(path, "\\")
| fieldsAdd pathElement2=pathArray[2], fileName=arrayLast(pathArray)

```
