# Log ingest rule for custom log source (source type; log path)

**URL:** <https://community.dynatrace.com/t/log-ingest-rule-for-custom-log-source-source-type-log-path/43541>\
**Category:** Logs\
**Tags:** log-configuration, log-monitoring-class\
**Created:** [January 10, 2024, 11:27am UTC](https://community.dynatrace.com/t/log-ingest-rule-for-custom-log-source-source-type-log-path/43541 "2024-01-10T11:27:35Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![marina\_pollehn](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/marina_pollehn/32/39120_2.png) [@marina\_pollehn](https://community.dynatrace.com/u/marina_pollehn)\
**Post date:** [January 10, 2024, 11:27am UTC](https://community.dynatrace.com/t/log-ingest-rule-for-custom-log-source-source-type-log-path/43541/1 "2024-01-10T11:27:35Z")

</div>

I have added a custom log source, namely&nbsp;d:\apps\signaturelogging\*.txt of source type log path. The folder does exist according to Dynatrace (I checked with the Filesystem Monitoring extension) and there are also logs written to it (according to the Filesystem monitoring extension and my own knowledge ;)). Nevertheless my log ingest rules do not seem to work.

My approaches so far were:

1. 

Log source is any of: signaturelogging

1. 

Log source is any of: d:\apps\signaturelogging\*.txt

1. 

Log content is any of:  
\*signatureservice\*\*signaturerequest\*\*error\*\*signature\*

(these are words I am expecting in the log messages).

Anyone an idea of how I should write the log ingest rule? What am I doing wrong?

---

<div class="post-metadata">

**Author:** ![gbaudart](https://avatars.discourse-cdn.com/v4/letter/g/e47c2d/32.png) [@gbaudart](https://community.dynatrace.com/u/gbaudart)\
**Post date:** [January 10, 2024, 1:44pm UTC](https://community.dynatrace.com/t/log-ingest-rule-for-custom-log-source-source-type-log-path/43541/2 "2024-01-10T13:44:43Z")

</div>

Hi&nbsp;[@marina\_pollehn](https://community.dynatrace.com/user/2456)&nbsp;,

To add logs with a specific extension (eg: .txt).  
It is necessary to add a “Security Rule” to the machine.

Drop it to this path:

```markup
/var/lib/dynatrace/oneagent/agent/config/logmodule

```

The contents of the “securityRulesLoganalytics.json” file:

```markup
{
    "@version":"1.0.0",
    "allowed-log-paths-configuration":[
        {
            "directory-pattern":"d:\apps\signaturelogging\",
            "file-pattern":"*.txt",
            "action":"INCLUDE"
        }
    ]
}

```

Let me know if it works.

---

<div class="post-metadata">

**Author:** ![marina\_pollehn](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/marina_pollehn/32/39120_2.png) [@marina\_pollehn](https://community.dynatrace.com/u/marina_pollehn)\
**Post date:** [January 10, 2024, 2:46pm UTC](https://community.dynatrace.com/t/log-ingest-rule-for-custom-log-source-source-type-log-path/43541/3 "2024-01-10T14:46:24Z")

</div>

Little question regarding the /config/logmodule. Would this also remain after an update of the OneAgent? Not keen on making these adjustments after every update 😉

---

<div class="post-metadata">

**Author:** ![gbaudart](https://avatars.discourse-cdn.com/v4/letter/g/e47c2d/32.png) [@gbaudart](https://community.dynatrace.com/u/gbaudart)\
**Post date:** [January 10, 2024, 2:49pm UTC](https://community.dynatrace.com/t/log-ingest-rule-for-custom-log-source-source-type-log-path/43541/4 "2024-01-10T14:49:47Z")

</div>

Yes, it remains good

---

<div class="post-metadata">

**Author:** ![CTull](https://avatars.discourse-cdn.com/v4/letter/c/da6949/32.png) [@CTull](https://community.dynatrace.com/u/CTull)\
**Post date:** [August 8, 2024, 4:57pm UTC](https://community.dynatrace.com/t/log-ingest-rule-for-custom-log-source-source-type-log-path/43541/5 "2024-08-08T16:57:49Z")

</div>

Afternoon,

I have my Custom Log Sources set to:  
Log Path&nbsp;&nbsp;D:\Program Files\Apache Software Foundation\Tomcat\logs\*  
I have my security policy set as:&nbsp; &nbsp;{  
“directory-pattern”: “/Program Files/Apache Software Foundation/Tomcat/logs/”,  
“file-pattern”:“\*”,  
“action”:“INCLUDE”  
},

However, there are files in here in the GB file size and I only want one file that changes its date each day for rotation.

What would be the wildcard for this entry.

Example:

localhost\_access\_log.2024-05-24&nbsp; &nbsp;and&nbsp; &nbsp;localhost\_access\_log.2024-05-25&nbsp; and&nbsp;localhost\_access\_log.2024-08-03

I have tried to update the security rule to this but it is still ingesting logs from other files in that directory.

{  
“directory-pattern”: “/Program Files/Apache Software Foundation/Tomcat/logs/”,  
“file-pattern”:“localhost\_access\_log.####-##-##”,  
“action”:“INCLUDE”  
},

Any ideas how to gather this rotated file and the use of wildcards?&nbsp; The examples listed in the dynatrace does does not show many examples of wildcards.
