Ad Widget

Collapse

Find specific string in log file

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • bab
    Senior Member
    • Aug 2020
    • 197

    #1

    Find specific string in log file

    I want to find a specific string in a log file
    this is my string "errorCode":"300"

    So I used from this key with zabbix agent active

    log["/usr/local/wildfly/wildfly-rojects/standalone/log/s.log","errorCode:00",,,skip,\0]

    with this trigger :

    nodata(/su/log["/usr/local/wildfly/wildfly-rojects/standalone/log/s.log","errorCode:00",,,skip,\0],30s)=0

    now it is showing errorCode:00 in my s.log file but cannot fire trigger .
    Do I have to change string syntsx to find errorCode:00 ?
  • bab
    Senior Member
    • Aug 2020
    • 197

    #2
    Would you please help me about it ?

    Comment

    • bab
      Senior Member
      • Aug 2020
      • 197

      #3
      Can you please help me ?

      Comment

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

        #4
        Originally posted by bab
        I want to find a specific string in a log file
        this is my string "errorCode":"300"

        So I used from this key with zabbix agent active

        log["/usr/local/wildfly/wildfly-rojects/standalone/log/s.log","errorCode:00",,,skip,\0]

        with this trigger :

        nodata(/su/log["/usr/local/wildfly/wildfly-rojects/standalone/log/s.log","errorCode:00",,,skip,\0],30s)=0

        now it is showing errorCode:00 in my s.log file but cannot fire trigger .
        Do I have to change string syntsx to find errorCode:00 ?
        So you wanted tio look for "errorCode":"300" but you created an item to look for "errorCode:00" ?? These are not matching .. What are you actually want to catch from that file ?

        Comment

        • bruno.costa
          Junior Member
          • Aug 2023
          • 3

          #5

          Are you sure the agent is configured correctly?
          You can try capturing anything on the logfile to make sure its working properly.

          You said your string is: errorCode":"300" so you regex: errorCode:00 will not work.
          If what you want is to capture errorCode x00, so any number followed by 00 you can use: "errorCode.*00"

          Comment

          Working...