Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (Flatly)
  • No Skin
Collapse
Brand Logo

NetXMS Forum

  1. Home
  2. Support
  3. log parsing

log parsing

Scheduled Pinned Locked Moved Support
5 Posts 2 Posters 36.4k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L
    L
    lindeamon
    wrote on last edited by
    #1

    hi,

    how do i define several parameters to be passed in the <event>.
    what will happen if i will write a variable name after the dot ?
    for example:
    <match>process:(.var)</match>
    <event params="1">200000</event>

    will the param name be "var" ?

    10x,
    lindeamon

    1 Reply Last reply
    0
    • V
      V
      Victor Kirhenshtein
      wrote on last edited by
      #2

      hi!

      currently named parameters are not supported in the log parser. If you pass multiple parameters, they will be numbered in order they appear in regexp. For example, if you have the following rule:

      <match>Error (.*) at (.*)</match>
      <event params="2">200000</match>

      You will have two parameters - number 1 and number 2, and it will be possible to use them in macro expansion as %1 and %2. For log record

      Error 4 at test

      with this rule you will have
      %1 == "4"
      %2 == "test"

      Best regards,
      Victor

      1 Reply Last reply
      0
      • L
        L
        lindeamon
        wrote on last edited by
        #3

        thank you victor.
        i have another 2 questions that came up my mind reading your answer.

        1. can one xml file contain 2 <parser> sections ?
        2. can the <event> contain two attributes meaning passing the two param ? something like this <event params="1","2"> or <event params="1",params="2">

        10x,
        lindeamon

        1 Reply Last reply
        0
        • V
          V
          Victor Kirhenshtein
          wrote on last edited by
          #4
          1. No. You should create separate xml file for each parser.
          2. You can pass as many parameters as you like. Attribute params contains number of parameters, so if you have 4 parameters for the event, you will have <event params="4">. Of course you have to have appropriate number of capturing groups in regular expression.

          Best regards,
          Victor

          1 Reply Last reply
          0
          • L
            L
            lindeamon
            wrote on last edited by
            #5

            thank you very much

            1 Reply Last reply
            0

            Hello! It looks like you're interested in this conversation, but you don't have an account yet.

            Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

            With your input, this post could be even better 💗

            Register Login
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            Powered by NodeBB Contributors
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups