Regular Expression Wildcard in Filename

Hello,

my goal could not be easier, but i cannot get it working.

  • modified check_mk.user.yml fileinfo to search for C:\Windows\Temp*.VHDX
  • tested checkmk client output > file gets displayed in the testoutput
  • made a ned enforced service > Size and Age of single-file BUT i cannot figure out how to regular express to wildcard in the filename. Currently its C:\Windows\Temp*.VHDX which does not work. I also added $ to the end an tried multiple writing, but it seems this is beond my brain.

I just want to monitor when there is a .vdhx File under C:\Windows\Temp

Please someone enlighten me, thanks!

Hi @ROBEL_IT and welcome to the checkmk community.

I guess your problem is related to the fact, that a backslash has a special meaning within reqular expressions. Try to escape your backslashes with backslashes. Also dots have special meanings and need to be escaped too. It should look like C:\\Windwos\\Temp.*\.VHDX

EDIT: I mostly use the following page to test my regular expressions: regex101: build, test, and debug regex

3 Likes

Hi Tosch,
i fogot to answer. It worked, thank you very much :slight_smile:

1 Like

Can you please mark the answer as the solution if it solved your problem?

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed. Contact an admin if you think this should be re-opened.