Ad Widget

Collapse

logfile rotation issue using logrt function in Windows

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • genebofunk
    Junior Member
    • Jan 2024
    • 5

    #1

    logfile rotation issue using logrt function in Windows

    Hello,
    I have tried searching the forums for this issue. I have searched and found several other posts but I have not seen one that solves the issue I am having. I'm trying to search for a string in a log. When I use the regular log function on a single file it finds it no problem. As soon as I try using logrt with a wildcard it does not return anything. I checked the zabbix agent logs running on the windows machine that hosts it. I see zabbix indexing the log files correctly. So its not a permissions issue. But it just does not return anything for some reason.
    The examples are below. As you can see I did both tests in the same directory but get nothing using the one example with logrt and the wildcard. Am I missing something obvious?
    Click image for larger version

Name:	Capture.jpg
Views:	180
Size:	28.2 KB
ID:	500786

    Thanks for any help and pointers.
  • Brambo
    Senior Member
    • Jul 2023
    • 245

    #2
    It looks ok, the only difference I see with my own logrt items is that I have the path including wildcard symbol in " " so it looks like:
    Code:
    logrt["c:\mypath\log\mylogfile_*.log",{$myregex},,,,,,,]
    The _ before the * is part of the filename, I also have examples with a . before the wildcard and that works as well.
    It could be that logrt needs al comma's but I'm not sure about it but there is a reason I have them there but it's been to long ago to remember it was somehow needed to get it working or just making it this without a reason
    Last edited by Brambo; 20-03-2025, 10:52. Reason: typo's

    Comment

    • cyber
      Senior Member
      Zabbix Certified SpecialistZabbix Certified Professional
      • Dec 2006
      • 4806

      #3
      You can omit all those commas from the end of parameter list. You need correct amount only if you change some parameter in the end of the line...

      Comment

      • genebofunk
        Junior Member
        • Jan 2024
        • 5

        #4
        I tried adding the " " marks to the location but this did not work? Any other suggestions?

        Comment

        • genebofunk
          Junior Member
          • Jan 2024
          • 5

          #5
          This is from the log of zabbix agent that is running on the server that is doing the logrt check. To me it looks like it finds the directory, but is not finding the logfile correctly. I know my item key has an item in it that happens in this log ever few minutes. Its been running for a few hours but never seems to find it.. Any clues from this?

          1208:20250327:074448.031 In process_logrt() flags:0x08 filename:'C:\ProgramData\Lawo\R3LAY\Logging\R3LAYV irtualPatchBayLogfile*.txt' lastlogsize:0 mtime:0
          1208:20250327:074448.039 In split_filename() filename:'C:\ProgramData\Lawo\R3LAY\Logging\R3LAYV irtualPatchBayLogfile*.txt'
          1208:20250327:074448.048 split_filename() C:\ProgramData\Lawo\R3LAY\Logging\R3LAYVirtualPatc hBayLogfile*.txt
          1208:20250327:074448.056 split_filename() ^
          1208:20250327:074448.064 In split_string() str:'C:\ProgramData\Lawo\R3LAY\Logging\R3LAYVirtua lPatchBayLogfile*.txt' del:'\R3LAYVirtualPatchBayLogfile*.txt'
          1208:20250327:074448.073 End of split_string():SUCCEED part1:'C:\ProgramData\Lawo\R3LAY\Logging\' part2:'R3LAYVirtualPatchBayLogfile*.txt'
          1208:20250327:074448.081 End of split_filename():SUCCEED directory:'C:\ProgramData\Lawo\R3LAY\Logging\' filename_regexp:'R3LAYVirtualPatchBayLogfile*.txt'
          1208:20250327:074448.090 log files reside on 'NTFS' file system
          1208:20250327:074448.101 there are no recently modified files matching "R3LAYVirtualPatchBayLogfile*.txt" in "C:\ProgramData\Lawo\R3LAY\Logging"
          1208:20250327:074448.109 End of process_logrt():SUCCEED
          1208:20250327:074448.118 In need_meta_update() key:logrt["C:\ProgramData\Lawo\R3LAY\Logging\R3LAYVirtua lPat chBayLogfile*.txt",SocketThread,,10]
          1208:20250327:074448.126 End of need_meta_update():FAIL

          Thanks

          Comment

          Working...