# Regex for custom log source

**URL:** <https://community.dynatrace.com/t/regex-for-custom-log-source/51393>\
**Category:** Logs\
**Tags:** regex, log-configuration, logs\
**Created:** [April 28, 2025, 3:05pm UTC](https://community.dynatrace.com/t/regex-for-custom-log-source/51393 "2025-04-28T15:05:33Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shal](https://avatars.discourse-cdn.com/v4/letter/s/2bfe46/32.png) [@Shal](https://community.dynatrace.com/u/Shal)\
**Post date:** [April 28, 2025, 3:05pm UTC](https://community.dynatrace.com/t/regex-for-custom-log-source/51393/1 "2025-04-28T15:05:33Z")

</div>

Hi Team,

I am trying to add below log file in Custom log source

| D:\xxx\Apps\BusSys\_UAT\_OC5\xxx.BLT.BulkImportServerWS\2025.4.24.1-mainBulkLoadTool-OC5\logs\2025-04-24\log.txt |
| --- |

The words highlighted in red change according to the date the folder and file are generated.

Can someone suggest how I can add a custom log for this pattern?

I tried ones below

- D:\xxx\Apps\BusSys\_UAT\_OC5\xxx.BLT.BulkImportServerWS  
\2025.4.24.1-mainBulkLoadTool-OC5\logs\*\log\*
- D:\xxx\Apps\BusSys\_UAT\_OC5\xxx\  
2025.4.24.1-mainBulkLoadTool-OC5\logs\xxx\*.txt
- D:\xxx\Apps\BusSys\_UAT\_OC5\xxx.BLT.BulkImportServerWS\  
\*\logs\*\*.txt

It either shows No log data or the file does not exist.

---

<div class="post-metadata">

**Author:** ![Joachim\_Erdei](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/joachim_erdei/32/32437_2.png) [@Joachim\_Erdei](https://community.dynatrace.com/u/Joachim_Erdei)\
**Post date:** [April 29, 2025, 1:15pm UTC](https://community.dynatrace.com/t/regex-for-custom-log-source/51393/2 "2025-04-29T13:15:34Z")

</div>

Hi Shal,

the last one looks OK. (You can think of it as patterns for searching files on disk.) Have you created an ingest rule to ingest this custom log source?

---

<div class="post-metadata">

**Author:** ![Shal](https://avatars.discourse-cdn.com/v4/letter/s/2bfe46/32.png) [@Shal](https://community.dynatrace.com/u/Shal)\
**Post date:** [April 29, 2025, 2:56pm UTC](https://community.dynatrace.com/t/regex-for-custom-log-source/51393/3 "2025-04-29T14:56:22Z")

</div>

Hi Joachim,

Yes I have added custom log source as well as log ingestion rule as below:

Log source is any of : D:\XXX\Apps\BusSys\_UAT\_OC5\xxxBLT.BulkImportServerWS\*\logs\*\*.txt

Thanks

---

<div class="post-metadata">

**Author:** ![Joachim\_Erdei](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/joachim_erdei/32/32437_2.png) [@Joachim\_Erdei](https://community.dynatrace.com/u/Joachim_Erdei)\
**Post date:** [April 30, 2025, 6:40am UTC](https://community.dynatrace.com/t/regex-for-custom-log-source/51393/4 "2025-04-30T06:40:40Z")

</div>

Hi Shal,

just to be clear, is “xxx” in your paths a replacement for something sensitive, or a part that might have multiple values (like a wildcard)? If taken literally, please note that you log ingest rule covers the second of custom log sources in the first post, and the rest are not matched (Merchants vs xxx).

Can you say what is the exact full path to the log file you try to ingest? Knowing that I could match it with the rules.

---

<div class="post-metadata">

**Author:** ![Shal](https://avatars.discourse-cdn.com/v4/letter/s/2bfe46/32.png) [@Shal](https://community.dynatrace.com/u/Shal)\
**Post date:** [May 2, 2025, 6:30am UTC](https://community.dynatrace.com/t/regex-for-custom-log-source/51393/5 "2025-05-02T06:30:49Z")

</div>

Hi Joachim,

Yes, sorry for the confusion. You can consider the actual file path as below:

D:\xxx\Apps\BusSys\_UAT\_OC5\xxx.BLT.BulkImportServerWS\2025.4.24.1-mainBulkLoadTool-OC5\logs\2025-04-24\log.txt

The text highlighted in red generates based on date . Sometimes instead of log.txt there can be files like log.00001.txt or log.00002.txt also.

That is the reason am considering it as wildcards and added the below rule .

Just checking if the custom log source and rule can be added as below&nbsp; so that if there is any recent file it can capture it.

D:\xxxApps\BusSys\_UAT\_OC5\xxxBLT.BulkImportServerWS\*\logs\*\*.txt

Thanks!

---

<div class="post-metadata">

**Author:** ![Joachim\_Erdei](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/joachim_erdei/32/32437_2.png) [@Joachim\_Erdei](https://community.dynatrace.com/u/Joachim_Erdei)\
**Post date:** [May 5, 2025, 7:17am UTC](https://community.dynatrace.com/t/regex-for-custom-log-source/51393/6 "2025-05-05T07:17:12Z")

</div>

It looks to me that the custom log source rule is perfectly OK. Please remember that custom log source name (not the file name) is your “log.source” attribute, which you can choose in your ingest rules.

Just for your information - you should also have a built-in rule (disabled on default) which ingests all custom log sources - you can just enable it if you find it suitable.
