# Parse multiple entries in quotes

**URL:** <https://community.dynatrace.com/t/parse-multiple-entries-in-quotes/43835>\
**Category:** DQL\
**Tags:** dql, parse\
**Created:** [January 25, 2024, 3:48pm UTC](https://community.dynatrace.com/t/parse-multiple-entries-in-quotes/43835 "2024-01-25T15:48:53Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![S\_Hadley1138](https://avatars.discourse-cdn.com/v4/letter/s/ed655f/32.png) [@S\_Hadley1138](https://community.dynatrace.com/u/S_Hadley1138)\
**Post date:** [January 25, 2024, 3:48pm UTC](https://community.dynatrace.com/t/parse-multiple-entries-in-quotes/43835/1 "2024-01-25T15:48:53Z")

</div>

Just a follow up on this one…&nbsp; but slightly different question,&nbsp;[@sinisa\_zubic](https://community.dynatrace.com/user/38283)&nbsp;as you are clearly a wizard in this area…

[Solved: simple csv event log parse - Dynatrace Community](https://community.dynatrace.com/post/234060)

So IF i have some lines in my log with multiple entries, but not all…&nbsp; for example

2024-01-11T13:23:02.578Z,192.168.0.100,Server1,Tree,Green,Warning  
2024-01-11T13:24:06.345Z,192.168.0.103,Server2,Bush,DarkGreen,Alert  
2024-01-11T13:27:04.543Z,192.168.0.103,Server2,Road,“Grey,Yellow,White”,Alert  
2024-01-11T13:28:03.345Z,192.168.0.178,Server5,Path,Black,Bannana

how would I&nbsp;get the this to parse, as the 3rd line has multiple entries in the 5th field, comma separated, but encapsulated in “”.&nbsp; the way you showed me wont work as the Colour field is also csv, but in quotes?

JSONTIMESTAMP\*:timestamp\_parsed ‘,’

IPV4ADDR\*:clientip ‘,’

LD\*:clienthostname ‘,’

LD\*:object ‘,’

(Array{LD\*:i (‘"’ | \>\>‘,’)}{1,}:Colour)? ‘",’

LD\*:status

any guidance&nbsp;would be appreciated

---

<div class="post-metadata">

**Author:** ![krzysztof\_hoja](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/krzysztof_hoja/32/34625_2.png) [@krzysztof\_hoja](https://community.dynatrace.com/u/krzysztof_hoja)\
**Post date:** [January 25, 2024, 7:29pm UTC](https://community.dynatrace.com/t/parse-multiple-entries-in-quotes/43835/2 "2024-01-25T19:29:51Z")

</div>

I would do it in 2 steps:  
- as 5th field can be just string or quoted string, alterative comes in handy like in previous exercise. There are ready to use DPL matchers for quoted strings:&nbsp;[DPL Lines and Strings — Dynatrace Docs](https://docs.dynatrace.com/docs/platform/grail/dynatrace-pattern-language/log-processing-lines-strings#quoted-strings)&nbsp;like _ **DQS** _ I used. Please not that order matters.  
- when we have color or multiple colors captured in color field, it can be split into array using _ **splitString** _ function

```markup
data record(c="2024-01-11T13:23:02.578Z,192.168.0.100,Server1,Tree,Green,Warning"),
record(c="2024-01-11T13:24:06.345Z,192.168.0.103,Server2,Bush,DarkGreen,Alert"),
record(c="2024-01-11T13:27:04.543Z,192.168.0.103,Server2,Road,\"Grey,Yellow,White\",Alert"),
record(c="2024-01-11T13:28:03.345Z,192.168.0.178,Server5,Path,Black,Bannana"),
record(c="2024-01-11T13:28:03.345Z,192.168.0.178,Server5,Path,,Nothing")
| parse c, "JSONTIMESTAMP*:timestamp_parsed ',' IPV4ADDR*:clientip ',' LD*:clienthostname ',' LD*:object ',' (DQS*:color|LD*:color) ',' LD*:status"
| fieldsAdd color=splitString(color,",")

```

Result looks like this:

 ![krzysztof_hoja_0-1706210841982.png](https://global.discourse-cdn.com/dynatrace/original/3X/4/9/492413afa0a3eaecbc83f154fde378407aa109cf.png)
