Ad Widget

Collapse

How can use log to find specific words

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

    #1

    How can use log to find specific words

    I have created an item that can search in specific file and if find something will show in the last value .So this is my key
    log[/net/storage/dump/digital-orcl/dgtlbnk-2023021603.log,RESOURCE] now it is searching in the file and if could find RESOURCE will show it.
    But is it possible to search and find many items such as error OR warning OR failed for example :

    log[/net/storage/dump/digital-orcl/dgtlbnk-2023021603.log,error OR warning OR failed]

    and ignore case sensitive
  • Hamardaban
    Senior Member
    Zabbix Certified SpecialistZabbix Certified Professional
    • May 2019
    • 2713

    #2
    The second parameter in the log key is "regexp - a regular expression describing the required template"
    You can read more here and here.
    There are many articles about regular expressions on the Internet. And the best - https://regex101.com

    Code:
    log[/net/storage/dump/digital-orcl/dgtlbnk-2023021603.log,"(?i)error|warning|failed"]​​
    Last edited by Hamardaban; 16-02-2023, 14:23.

    Comment

    • bab
      Senior Member
      • Aug 2020
      • 176

      #3
      Originally posted by Hamardaban
      The second parameter in the log key is "regexp - a regular expression describing the required template"
      You can read more here and here.
      There are many articles about regular expressions on the Internet. And the best - https://regex101.com

      Code:
      log[/net/storage/dump/digital-orcl/dgtlbnk-2023021603.log,"(?i)error|warning|failed"]​​

      So thanks. Would you please say what does mean (?i) ?

      Comment

      • Hamardaban
        Senior Member
        Zabbix Certified SpecialistZabbix Certified Professional
        • May 2019
        • 2713

        #4
        case insensitive
        pls read about "regular expression" (the magic of google to help) and links that i provided.​

        Comment

        • bab
          Senior Member
          • Aug 2020
          • 176

          #5
          Originally posted by Hamardaban
          case insensitive
          pls read about "regular expression" (the magic of google to help) and links that i provided.​

          So thanks. I was read it but I am looking for exclude words for example according to follow sample trigger will fire if it finds words such as oracle
          but I want exclude oracle word from the list and find other words that include ora

          log[/net/storage/dump/digital-orcl/dgtlbnk-2023021603.log,"(?i)error|warning|ora"]​​

          Comment

          Working...