# Log viewer (Logs Classic) : grepping log

**URL:** <https://community.dynatrace.com/t/log-viewer-logs-classic-grepping-log/45045>\
**Category:** Logs\
**Tags:** log-viewer, dynatrace-managed, log-monitoring-class\
**Created:** [April 8, 2024, 2:16pm UTC](https://community.dynatrace.com/t/log-viewer-logs-classic-grepping-log/45045 "2024-04-08T14:16:05Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![gilles\_tabary](https://avatars.discourse-cdn.com/v4/letter/g/eb9ed0/32.png) [@gilles\_tabary](https://community.dynatrace.com/u/gilles_tabary)\
**Post date:** [April 8, 2024, 2:16pm UTC](https://community.dynatrace.com/t/log-viewer-logs-classic-grepping-log/45045/1 "2024-04-08T14:16:05Z")

</div>

Hello.

On Managed&nbsp;1.286.86.20240314-161238,&nbsp;Log viewer (Logs Classic). I have some log lines like :

```markup
240408 15:35:42,538 [https-jsse-nio-x.y.z.t-8443-exec-72] [xx1234] [1234567890,abcdef] INFO c.b.a.w.c.f.LoggingRequestAuditFilter - GET /xxx/v1/ws/products/zt123456 - execution time: 4ms - Status 200

```

I must be doing something wrong somehow, because I cannot find how to search all lines containing for example string [_bcde_] or [_t123_] or [_45678_]. I looked in the doc&nbsp;[Log viewer (Logs Classic) — Dynatrace Docs](https://docs.dynatrace.com/docs/shortlink/log-monitoring-log-viewer)&nbsp;yet, no way. Even in advanced mode.&nbsp;This is such a basic need : “search for a string in a log file” that I must be missing something extremely trivial. Can someone help ?

Regards.

---

<div class="post-metadata">

**Author:** ![gilles\_tabary](https://avatars.discourse-cdn.com/v4/letter/g/eb9ed0/32.png) [@gilles\_tabary](https://community.dynatrace.com/u/gilles_tabary)\
**Post date:** [April 8, 2024, 3:10pm UTC](https://community.dynatrace.com/t/log-viewer-logs-classic-grepping-log/45045/2 "2024-04-08T15:10:43Z")

</div>

To be as specific as possible, the search I am after is “sub-string” search

---

<div class="post-metadata">

**Author:** ![Suryanto\_1](https://avatars.discourse-cdn.com/v4/letter/s/54ee81/32.png) [@Suryanto\_1](https://community.dynatrace.com/u/Suryanto_1)\
**Post date:** [April 9, 2024, 2:57am UTC](https://community.dynatrace.com/t/log-viewer-logs-classic-grepping-log/45045/3 "2024-04-09T02:57:13Z")

</div>

Have u tried ?

matchesPhrase(content, “_45678_”)

---

<div class="post-metadata">

**Author:** ![gilles\_tabary](https://avatars.discourse-cdn.com/v4/letter/g/eb9ed0/32.png) [@gilles\_tabary](https://community.dynatrace.com/u/gilles_tabary)\
**Post date:** [April 9, 2024, 8:06am UTC](https://community.dynatrace.com/t/log-viewer-logs-classic-grepping-log/45045/4 "2024-04-09T08:06:40Z")

</div>

Hello.

I tried matchesPhrase() here (Managed), the predicate is not recognised, even in advanced mode.

AFAIU matchesPhrase() is available in&nbsp;DQL in logs with **Dynatrace on Grail** , i.e. not on Managed [https://docs.dynatrace.com/docs/shortlink/lma-log-processing-matcher.](https://docs.dynatrace.com/docs/shortlink/lma-log-processing-matcher)

Any other lead ?

Regards.

---

<div class="post-metadata">

**Author:** ![marcin\_okraszew](https://avatars.discourse-cdn.com/v4/letter/m/35a633/32.png) [@marcin\_okraszew](https://community.dynatrace.com/u/marcin_okraszew)\
**Post date:** [April 9, 2024, 8:15am UTC](https://community.dynatrace.com/t/log-viewer-logs-classic-grepping-log/45045/5 "2024-04-09T08:15:49Z")

</div>

Log Classic allows you to search only by tokens, so you need to search for full words, separated by punctuation, spaces, etc. You can also search with beginning of a token, if you add asterisk.

Searching by any substring is only possible in logs powered by Grail. Then you need to use `contains` function. The suggested matchesPhrase() function works also on tokens, similarly to Classic (though, there are some differences).

---

<div class="post-metadata">

**Author:** ![gilles\_tabary](https://avatars.discourse-cdn.com/v4/letter/g/eb9ed0/32.png) [@gilles\_tabary](https://community.dynatrace.com/u/gilles_tabary)\
**Post date:** [April 9, 2024, 8:42am UTC](https://community.dynatrace.com/t/log-viewer-logs-classic-grepping-log/45045/6 "2024-04-09T08:42:47Z")

</div>

That’s an information : It is not possible to grep in Log Viewer Classic, Managed ! People here starts doing funny things to just be able to grep their logs. Which defeat quite a bit of the interest.

Log analysing wise, it looks to me like a&nbsp;_unexpectable_ functionality loss (or regression) between Log V1 to Log V2. People here are baffled, thinking of maybe other solutions.

Thanks for feedack.

---

<div class="post-metadata">

**Author:** ![gilles\_tabary](https://avatars.discourse-cdn.com/v4/letter/g/eb9ed0/32.png) [@gilles\_tabary](https://community.dynatrace.com/u/gilles_tabary)\
**Post date:** [April 18, 2024, 2:39pm UTC](https://community.dynatrace.com/t/log-viewer-logs-classic-grepping-log/45045/7 "2024-04-18T14:39:59Z")

</div>

For the record, these search criteria won’t return any line (on Managed) :

content=“123456789” # missing token trailing 0  
content=“234567890” # missing token leading 1  
content=“\*234567890” # leading wild-card not processed  
content=“\*23456789\*”&nbsp;# leading wild-card not processed  
content=“23456789\*” # trailing wild.card processed fine, yet missing token leading 1 (not replaceable by wildcard)

this will return lines :

content=“123456\*”

---

<div class="post-metadata">

**Author:** ![sundarv1](https://avatars.discourse-cdn.com/v4/letter/s/65b543/32.png) [@sundarv1](https://community.dynatrace.com/u/sundarv1)\
**Post date:** [April 18, 2024, 2:54pm UTC](https://community.dynatrace.com/t/log-viewer-logs-classic-grepping-log/45045/8 "2024-04-18T14:54:14Z")

</div>

How to search in the content when first line in the log file has “ORA”.
