cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Monitoring File Presence Dynamically? (Log files with dates)

PedroSantos
Advisor

Hello community, I could use your advice with something.

I'm trying to monitor the presence of a file on a given directory. The easiest and most simple solution would be to use the Filesystem Extension, which allows me to use a count to do just that.

PedroSantos_0-1726233006512.png

The limiting factor is that the only available configurations for count are the following:

PedroSantos_1-1726233057992.png

 

My problem:

The name of the log file I need to check for changes daily, because the date is appended to the daily created file.

So today I would need to look for 13092024_logfile.log

But tomorrow I'll have to check if 14092024_logfile.log is present, on the same directory. And yesterday's log file will be there too, so I can't do a simple count of files.

 

 

Given how common it is to append dates to log file names, I figured someone here must've dealt with this problem before.

Any insight, advice or counsel on how to deal with this situation would be greatly appreciated 😃

To make an error is human. To spread the error across all servers in an automated way is DevOps.
3 REPLIES 3

PedroSantos
Advisor

Double post, just in case someone bumps into the same issue I did. I found a solution on the same menu:

PedroSantos_0-1726756991250.png



It wasn't immediately obvious for me, so I thought I'd share the solution anyway.

 

To make an error is human. To spread the error across all servers in an automated way is DevOps.

AntonPineiro
DynaMight Guru
DynaMight Guru

Hi,

If existing extensions are not matching your use case, you can always create your own script for checking file exist or not.

For example, script output can ingest "1" if exist; and "0" if not, using metric scripting integration.

Best regards

❤️ Emacs ❤️ Vim ❤️ Bash ❤️ Perl

adam_gardner
Dynatrace Champion
Dynatrace Champion

Deploying an OpenTelemetry collector (such as the supported Dynatrace collector) and using the filelogreceiver will achieve this:

 

receivers:
  filelog:
    include: [ c:\path\to\logs\*.log ]

 

Featured Posts