# Log processing not splitting lines

**URL:** <https://community.dynatrace.com/t/log-processing-not-splitting-lines/37120>\
**Category:** Logs\
**Tags:** log-processing, log-monitoring-class\
**Created:** [November 3, 2022, 4:04am UTC](https://community.dynatrace.com/t/log-processing-not-splitting-lines/37120 "2022-11-03T04:04:39Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![mferstl](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/mferstl/32/26292_2.png) [@mferstl](https://community.dynatrace.com/u/mferstl)\
**Post date:** [November 3, 2022, 4:04am UTC](https://community.dynatrace.com/t/log-processing-not-splitting-lines/37120/1 "2022-11-03T04:04:39Z")

</div>

I have a custom logfile and want to use log processing, but it doesn’t split the loglines as it should, is there a way to tell the system to do that?

The log is json formatted, so every {} is one logline  
example of the content:  
“content”: “{\“servertime\”:\“2022-11-02T23:44:48.3637831-04:00\”,\“action\”:\“Start US\”,\“region\”:\“US\”,\“time\”:0}{\“region\”:\“US\”,\“action\”:\“Start US\”,\“time\”:0,\“servertime\”:\“2022-11-02T23:45:17.8491586-04:00\”}{\“region\”:\“US\”,\“action\”:\“Start US\”,\“time\”:0,\“servertime\”:\“2022-11-02T23:46:00.7540443-04:00\”}”

---

<div class="post-metadata">

**Author:** ![uros\_djukic1](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/uros_djukic1/32/37084_2.png) [@uros\_djukic1](https://community.dynatrace.com/u/uros_djukic1)\
**Post date:** [November 3, 2022, 8:05am UTC](https://community.dynatrace.com/t/log-processing-not-splitting-lines/37120/2 "2022-11-03T08:05:51Z")

</div>

Hi mferstl,

All depend on the way you proceed for parsing your JSON with all attributes and fields.&nbsp;  
this is a useful link :&nbsp;[Log processing examples (Logs Classic) — Dynatrace Docs](https://www.dynatrace.com/support/help/how-to-use-dynatrace/log-monitoring/acquire-log-data/log-processing/log-processing-examples#example-4-parse-out-specific-fields-from-json-content)

You can use for instance :

PARSE(content,“JSON:parsedJson”)

| FIELDS\_ADD (resultDescription:parsedJson[“resultDescription”])  
| PARSE(resultDescription,“SPACE? JSON:resultDescriptionFormated”)

| FIELDS\_ADD(

or

USING(INOUT content)  
| PARSE(content,“JSON:parsedJson”)

| FIELDS\_ADD (resultDescription:parsedJson[“resultDescription”])

to avoid character limitation.

hope it helps,  
Thanks

---

<div class="post-metadata">

**Author:** ![mferstl](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/mferstl/32/26292_2.png) [@mferstl](https://community.dynatrace.com/u/mferstl)\
**Post date:** [November 3, 2022, 8:59am UTC](https://community.dynatrace.com/t/log-processing-not-splitting-lines/37120/3 "2022-11-03T08:59:46Z")

</div>

tried both, it seems it only takes the first json and ignores the others, is there a way to load each json into a array and loop through the array?

Maybe it takes longer to take effect, will monitor for a longer time and then give feedback

thanks a lot for the moment

---

<div class="post-metadata">

**Author:** ![uros\_djukic1](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/uros_djukic1/32/37084_2.png) [@uros\_djukic1](https://community.dynatrace.com/u/uros_djukic1)\
**Post date:** [November 3, 2022, 9:29am UTC](https://community.dynatrace.com/t/log-processing-not-splitting-lines/37120/4 "2022-11-03T09:29:04Z")

</div>

you can now try to concatenate like this :&nbsp;  
FIELDS\_ADD(content: attribute1 + attribute2)  
[Log processing functions - String | Dynatrace Docs](https://www.dynatrace.com/support/help/shortlink/lma-log-processing-functions#strings)

Moreover, you can parse out the other attributes that manner :

PARSE(content, “LD ‘\“US\”:’ SPACE? DQS:US”)

those attributes :

“US\”,\“action\”

PARSE(content,“JSON{STRING:US, STRING:action}:parsed”)  
| FIELDS\_ADD(US: parsed[US], action: parsed[action])  
| FIELDS\_REMOVE(parsed)

---

<div class="post-metadata">

**Author:** ![mferstl](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/mferstl/32/26292_2.png) [@mferstl](https://community.dynatrace.com/u/mferstl)\
**Post date:** [November 3, 2022, 10:03am UTC](https://community.dynatrace.com/t/log-processing-not-splitting-lines/37120/5 "2022-11-03T10:03:10Z")

</div>

no, its still happening

Message{“region”:“CN”,“servertime”:“2022-11-03T05:50:07.1373187-04:00”,“action”:“Start CN”,“time”:0} {“time”:291.5652348,“region”:“ROW”,“servertime”:“2022-11-03T05:50:09.5621787-04:00”,“action”:“ROW total runtime”}  
OtheractionStart CNprocess.technology1..NET2.CLRregionCNtime0

---

<div class="post-metadata">

**Author:** ![mferstl](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/mferstl/32/26292_2.png) [@mferstl](https://community.dynatrace.com/u/mferstl)\
**Post date:** [November 3, 2022, 10:41am UTC](https://community.dynatrace.com/t/log-processing-not-splitting-lines/37120/6 "2022-11-03T10:41:58Z")

</div>

seems to work, lets hope it continues to do so

---

<div class="post-metadata">

**Author:** ![gilgi](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/gilgi/32/11747_2.png) [@gilgi](https://community.dynatrace.com/u/gilgi)\
**Post date:** [January 22, 2023, 10:28am UTC](https://community.dynatrace.com/t/log-processing-not-splitting-lines/37120/7 "2023-01-22T10:28:11Z")

</div>

Hi,

Automatic parsing will be done when Dynatrace finds a timestamp inside the log line. I believe yours is the servertime field. You should add a timestamp configuration for your logs and this will be done automatically. You could also (if the log lines are very long and you can’t control where will the timestamp be in the string control the number of strings to look at in each row to identify the field.

All previous comments that I see will only occur after the json has entered Dynatrace so first make sure the timestamp is defined correctly, otherwise you might be missing some lines.
