• Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Search
  • Register
  • Login
Netgate Discussion Forum
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Search
  • Register
  • Login

Advanced Log Filter - Specify EXACT Port number

Scheduled Pinned Locked Moved General pfSense Questions
5 Posts 3 Posters 972 Views
Loading More Posts
  • 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.
  • A
    anengelsen
    last edited by May 6, 2020, 2:22 PM

    I would like to apply a (destination port) filter to the Firewall logs.

    Is it possible to specify an exact port number? Right now I am getting port values that are not an exact match.

    Example:
    Destination Port #: 19
    Results: 1900, 3190, 19, 51419, etc.

    Screen Shot 2020-05-06 at 10.18.01 AM.png

    Thanks!

    1 Reply Last reply Reply Quote 0
    • J
      jimp Rebel Alliance Developer Netgate
      last edited by May 6, 2020, 2:53 PM

      As the help text under the Apply Filter button says, the fields accept regular expressions. So if you only want to match port 19 then you would anchor the regex with the start and end of string like so: ^19$

      Remember: Upvote with the 👍 button for any user/post you find to be helpful, informative, or deserving of recognition!

      Need help fast? Netgate Global Support!

      Do not Chat/PM for help!

      1 Reply Last reply Reply Quote 2
      • A
        anengelsen
        last edited by anengelsen May 6, 2020, 3:01 PM May 6, 2020, 3:01 PM

        @jimp That works! Thank you very much.

        This is the external resource that I need to bookmark. ;)
        https://www.php.net/manual/en/function.preg-match.php#105924

        K 1 Reply Last reply May 6, 2020, 3:14 PM Reply Quote 0
        • K
          Konstanti @anengelsen
          last edited by Konstanti May 6, 2020, 3:16 PM May 6, 2020, 3:14 PM

          @anengelsen
          Hi
          you can also use a regular expression like this
          (19)

          c0728892-08bf-486a-9b7f-3bdbc6e7457a-image.png

          1 Reply Last reply Reply Quote 0
          • J
            jimp Rebel Alliance Developer Netgate
            last edited by May 6, 2020, 3:28 PM

            That matches the string anywhere in the port number, same as leaving it as 19 which isn't what OP wanted. They wanted it to only match port 19 and no others, so using ^19$ is the way to do it.

            Remember: Upvote with the 👍 button for any user/post you find to be helpful, informative, or deserving of recognition!

            Need help fast? Netgate Global Support!

            Do not Chat/PM for help!

            1 Reply Last reply Reply Quote 1
            2 out of 5
            • First post
              2/5
              Last post
            Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.
              This community forum collects and processes your personal information.
              consent.not_received