# Simple text log monitoring

**URL:** <https://community.dynatrace.com/t/simple-text-log-monitoring/41616>\
**Category:** Logs\
**Tags:** log-processing, log-monitoring-class, logs\
**Created:** [September 12, 2023, 9:42pm UTC](https://community.dynatrace.com/t/simple-text-log-monitoring/41616 "2023-09-12T21:42:56Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![olegus](https://avatars.discourse-cdn.com/v4/letter/o/3d9bf3/32.png) [@olegus](https://community.dynatrace.com/u/olegus)\
**Post date:** [September 12, 2023, 9:42pm UTC](https://community.dynatrace.com/t/simple-text-log-monitoring/41616/1 "2023-09-12T21:42:56Z")

</div>

I’m new to Dynatrace so bare with my dumb questions here 🙂

What I need is to make Dynatrace to watch a very simple log file in text format , check for a specific value and raise an alert if found.

So far I was able to specify a custom log source under a process that produces my logs but it seems Dynatrace does not want to monitor it. Why is that?

 ![olegus_0-1694554049092.png](https://global.discourse-cdn.com/dynatrace/original/2X/8/81ec26ed948a5438591659fe15a00e4873263179.png)

Also , I stumbled across log processing rules and I 'm struggling to create my own to simply find a word sequence there. All examples seems related to known logs from web servers like nginx /haproxy and includes some pretty complex data manipulation. Plus, It seems that logs should be in JSON format? At least that what’s required for Rule Testing section..

I have a feeling that I’ve missing something obvious here - can you point me to the right direction how can I:

- add a text log file to Dynatrace

- add a rule to simply check for words “exit code XXX”

- raise an alert

---

<div class="post-metadata">

**Author:** ![natanael\_mendes](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/natanael_mendes/32/15264_2.png) [@natanael\_mendes](https://community.dynatrace.com/u/natanael_mendes)\
**Post date:** [September 13, 2023, 2:51am UTC](https://community.dynatrace.com/t/simple-text-log-monitoring/41616/2 "2023-09-13T02:51:53Z")

</div>

Hey, you can use some rules to do this.

Check this documentation if you use classic v2

> **[Log processing](https://docs.dynatrace.com/docs/analyze-explore-automate/log-monitoring/log-processing)**
>
> Use Dynatrace powered by Grail and DQL to reshape incoming log data for better understanding, analysis, or further processing.

Check this documentation if you use Grail

> **[Set up alerts based on events extracted from logs](https://docs.dynatrace.com/docs/analyze-explore-automate/logs/lma-use-cases/lma-alert-log-based-events)**
>
> How to create and configure Davis problems and alerts with events based on logs.

---

<div class="post-metadata">

**Author:** ![mizso74](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/mizso74/32/41729_2.png) [@mizso74](https://community.dynatrace.com/u/mizso74)\
**Post date:** [September 14, 2023, 1:47pm UTC](https://community.dynatrace.com/t/simple-text-log-monitoring/41616/3 "2023-09-14T13:47:18Z")

</div>

Hi&nbsp;[@olegus](https://community.dynatrace.com/user/65794),

Could you please check my pervious posts about log monitoring.

[Solved: List log files for a metric - Dynatrace Community](https://community.dynatrace.com/post/205804)

[Solved: Application Log monitoring - Dynatrace Community](https://community.dynatrace.com/post/195075)

As a first step is to set the log collection:

1.&nbsp;At cutom log source configuration you add it manually the test file log

and then

2. At log source configuration if DT recognized your text file log after ponit 1.

It will be also usefull from other members:&nbsp;[Solved: Logs Classic - Log storage configuration vs Custom log source - Dynatrace Community](https://community.dynatrace.com/topic/222514)

Maybe you can use them.

I hope it helps.

Best regards,

Mizső

---

<div class="post-metadata">

**Author:** ![olegus](https://avatars.discourse-cdn.com/v4/letter/o/3d9bf3/32.png) [@olegus](https://community.dynatrace.com/u/olegus)\
**Post date:** [September 14, 2023, 1:56pm UTC](https://community.dynatrace.com/t/simple-text-log-monitoring/41616/4 "2023-09-14T13:56:24Z")

</div>

Thanks, Mizso,

That looks promising, a question regarding switching to Log Monitoring v2 - what will we lose when we switch to v2? We dont monitor any logs yet , but if we do, would we need to redo all log metrics ?

---

<div class="post-metadata">

**Author:** ![olegus](https://avatars.discourse-cdn.com/v4/letter/o/3d9bf3/32.png) [@olegus](https://community.dynatrace.com/u/olegus)\
**Post date:** [September 14, 2023, 2:44pm UTC](https://community.dynatrace.com/t/simple-text-log-monitoring/41616/5 "2023-09-14T14:44:13Z")

</div>

Not&nbsp; sure how this forum works, but the first post that was “accepted as a solution” (not by me btw) did not answer my questions &nbsp; - it just contains links to general DT docs, which I already read before asking those questions.&nbsp; I will re-read them and try solutions provided by Mizsco and report back.

---

<div class="post-metadata">

**Author:** ![mizso74](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/mizso74/32/41729_2.png) [@mizso74](https://community.dynatrace.com/u/mizso74)\
**Post date:** [September 14, 2023, 3:02pm UTC](https://community.dynatrace.com/t/simple-text-log-monitoring/41616/6 "2023-09-14T15:02:15Z")

</div>

Hi&nbsp;[@olegus](https://community.dynatrace.com/user/65794),

I think the answer yes. You will have to redo the log metrics. I was lucky because I switched to v2 quite early I did not have to much v1 configuration. You should do it as soon as possible because as you may read v1 support will end by 01.2024.

Regarding the v1 vs v2. No questions, v2 has much more possibilities than v1. I perfer it.

Best regards,

Mizső

---

<div class="post-metadata">

**Author:** ![mizso74](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/mizso74/32/41729_2.png) [@mizso74](https://community.dynatrace.com/u/mizso74)\
**Post date:** [September 14, 2023, 3:03pm UTC](https://community.dynatrace.com/t/simple-text-log-monitoring/41616/7 "2023-09-14T15:03:24Z")

</div>

Hi&nbsp;[@olegus](https://community.dynatrace.com/user/65794),

You can accept my answer also.&nbsp;😉

Thanks in advance.

Best regards,

Mizső

---

<div class="post-metadata">

**Author:** ![olegus](https://avatars.discourse-cdn.com/v4/letter/o/3d9bf3/32.png) [@olegus](https://community.dynatrace.com/u/olegus)\
**Post date:** [September 14, 2023, 7:12pm UTC](https://community.dynatrace.com/t/simple-text-log-monitoring/41616/8 "2023-09-14T19:12:27Z")

</div>

Mizso,

1. So far I created Custom Log Source configuration and I also created Log Storage configuration for the same log file - now i see my log in Logs&Events.

2. I’ve added DQL rule to filter my log data to show only “exit code XXX” lines

3. Looks like I’m good to go to create a Log event.

---

<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 9, 2024, 12:33pm UTC](https://community.dynatrace.com/t/simple-text-log-monitoring/41616/9 "2024-04-09T12:33:34Z")

</div>

log.source= “/opt/oracle” AND (content=“ORA-”). This is log source.&nbsp; instead of searching for content, i want to search ORA- in the first line in the log only. How to do that

---

<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 14, 2024, 6:53am UTC](https://community.dynatrace.com/t/simple-text-log-monitoring/41616/10 "2024-04-14T06:53:30Z")

</div>

Hi Mizso

log.source= “/opt/oracle” AND (content=“ORA-”). This is log source.&nbsp; instead of searching for content, i want to search ORA- in the first line in the log only. How to do we do that?

Now alerts are generatiing if ORA- is there is any part of content, instead we want to alert generated if ORA- is present in first line.

---

<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 16, 2024, 6:56am UTC](https://community.dynatrace.com/t/simple-text-log-monitoring/41616/11 "2024-04-16T06:56:09Z")

</div>

log.source= “/opt/oracle” AND (content=“ORA-”). This is log source.&nbsp; instead of searching for content, i want to search ORA- in the first line in the log only. How to do that

---

<div class="post-metadata">

**Author:** ![mizso74](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/mizso74/32/41729_2.png) [@mizso74](https://community.dynatrace.com/u/mizso74)\
**Post date:** [April 16, 2024, 6:06pm UTC](https://community.dynatrace.com/t/simple-text-log-monitoring/41616/12 "2024-04-16T18:06:46Z")

</div>

Hi&nbsp;[@sundarv1](https://community.dynatrace.com/user/74312),

I do not have solution for your request, maybe other community members have any idea…

Best regards,

Mizső

---

<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, 11:50am UTC](https://community.dynatrace.com/t/simple-text-log-monitoring/41616/13 "2024-04-18T11:50:27Z")

</div>

Hi Mizzo

og.source= “/opt/oracle” AND (content=“ORA-”). This is log source.&nbsp; instead of searching for content, i want to search ORA- in the first line in the log only. How to do that

---

<div class="post-metadata">

**Author:** ![mizso74](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/mizso74/32/41729_2.png) [@mizso74](https://community.dynatrace.com/u/mizso74)\
**Post date:** [April 18, 2024, 5:08pm UTC](https://community.dynatrace.com/t/simple-text-log-monitoring/41616/14 "2024-04-18T17:08:28Z")

</div>

Hi&nbsp;[@sundarv1](https://community.dynatrace.com/user/74312),

As I wrote I do not have solution for your request, maybe other community members have any idea…

Best regards,

Mizső

---

<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:** [May 14, 2024, 4:46am UTC](https://community.dynatrace.com/t/simple-text-log-monitoring/41616/15 "2024-05-14T04:46:00Z")

</div>

Hi

How do we display host IP Address in the Log Monitoring incidents. Currently we are getting Host name only

Thanks

Sundar.v

---

<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:** [July 10, 2024, 3:05pm UTC](https://community.dynatrace.com/t/simple-text-log-monitoring/41616/16 "2024-07-10T15:05:06Z")

</div>

Hi Mizso

How do we map to Servicenow Group to the log monitoring so that incident directly assign to group for log events?
