Ad Widget

Collapse

Monitoring Log with date in the name

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • hgoalv
    Junior Member
    • Oct 2017
    • 17

    #1

    Monitoring Log with date in the name

    I have an application that daily it generates a log whose name is date_nameapp.log.

    How can I do to monitor daily the corresponding log?

    I was reading for logrt, but I don't know how do it with the date in the name log.

    Thanks
  • kaspars.mednis
    Senior Member
    Zabbix Certified Trainer
    Zabbix Certified SpecialistZabbix Certified Professional
    • Oct 2017
    • 349

    #2
    Here was bad solution
    Last edited by kaspars.mednis; 27-10-2017, 12:47.

    Comment

    • hgoalv
      Junior Member
      • Oct 2017
      • 17

      #3
      A lot of thanks, for your reply.

      I'm starting wiuth the logs monitoring in zabbix.

      Comment

      • kaspars.mednis
        Senior Member
        Zabbix Certified Trainer
        Zabbix Certified SpecialistZabbix Certified Professional
        • Oct 2017
        • 349

        #4
        I have looked more closely at logrt syntaxis, and have found more correct way to do this without DB hacks. It can be done with zabbix built in tools

        Code:
        logrt[/path/to/file/regexp_describing_filename_pattern,<regexp>,<encoding>,<maxproclines>,<mode>,<maxdelay>].
        /path/to/file/regexp_describing_filename_pattern- this is a regular expression, which matches your filename

        Note that regexp depends on Zabbix version: 3.4 uses PCRE regexps, older versions - POSIX extended regexps.
        "So it depends which version is your Zabbix agent."

        If you are not similar with regexp, write your date format here, i think the regexp for that will be quite simple.

        Regards,
        Kaspars
        Last edited by kaspars.mednis; 27-10-2017, 13:35.

        Comment

        • hgoalv
          Junior Member
          • Oct 2017
          • 17

          #5
          Log monitoring

          the log files have this name for example:

          20171027_10851_app.log the format is date_hour_name.log and in the same folder I have more logs for other last days.

          I want monitoring everyday the corresponding log to the date.

          Comment

          • kaspars.mednis
            Senior Member
            Zabbix Certified Trainer
            Zabbix Certified SpecialistZabbix Certified Professional
            • Oct 2017
            • 349

            #6
            A few more questions:

            20171027_10851_app.log
            - How to decode the 10851 part ? you said date_hour_name.log , so 20171027 is date 27 oct 2017, app is application name, but i can't decode 10851
            - Which version of zabbix_agent are you using ?

            Regards,
            Kaspars

            Comment

            • hgoalv
              Junior Member
              • Oct 2017
              • 17

              #7
              This 10851 is the hour

              Comment

              Working...