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

    NAT Logs

    Scheduled Pinned Locked Moved General pfSense Questions
    50 Posts 4 Posters 4.4k 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.
    • M
      michmoor LAYER 8 Rebel Alliance @mcury
      last edited by

      @mcury

      Its already parsed for me

      9dfba30c-3c31-4e66-85f1-ad1ebe8277f8-image.png

      Firewall: NetGate,Palo Alto-VM,Juniper SRX
      Routing: Juniper, Arista, Cisco
      Switching: Juniper, Arista, Cisco
      Wireless: Unifi, Aruba IAP
      JNCIP,CCNP Enterprise

      M 1 Reply Last reply Reply Quote 0
      • M
        mcury Rebel Alliance @michmoor
        last edited by

        @michmoor
        67b0bb1a-8be3-4ded-807c-7449b7104a76-image.png

        So you got it. 👍
        Weird, I don't have those here.. Any tip of what I should do ?

        dead on arrival, nowhere to be found.

        M 1 Reply Last reply Reply Quote 0
        • M
          michmoor LAYER 8 Rebel Alliance @mcury
          last edited by

          @mcury Graylog did it for me. For the input i selected IPFIX UDP

          Firewall: NetGate,Palo Alto-VM,Juniper SRX
          Routing: Juniper, Arista, Cisco
          Switching: Juniper, Arista, Cisco
          Wireless: Unifi, Aruba IAP
          JNCIP,CCNP Enterprise

          M 1 Reply Last reply Reply Quote 1
          • M
            mcury Rebel Alliance @michmoor
            last edited by mcury

            @michmoor said in NAT Logs:

            @mcury Graylog did it for me. For the input i selected IPFIX UDP

            Also using that input.

            Did you enable tracking on the firewall rule that is associated with the NAT rule ?

            Ohh, disregard that.
            It is working here..

            680cd08a-95ed-41f0-b089-38f496296911-image.png

            dead on arrival, nowhere to be found.

            M 1 Reply Last reply Reply Quote 1
            • M
              michmoor LAYER 8 Rebel Alliance @mcury
              last edited by

              @mcury The only piece i dont know how to do is actually display data to show top talkers.
              each IPfix record shows bytes which is great but i would like a table that shows all the fields plus the amount of data seen cumulative.

              Firewall: NetGate,Palo Alto-VM,Juniper SRX
              Routing: Juniper, Arista, Cisco
              Switching: Juniper, Arista, Cisco
              Wireless: Unifi, Aruba IAP
              JNCIP,CCNP Enterprise

              M 1 Reply Last reply Reply Quote 0
              • M
                mcury Rebel Alliance @michmoor
                last edited by mcury

                @michmoor said in NAT Logs:

                The only piece i dont know how to do is actually display data to show top talkers.
                each IPfix record shows bytes which is great but i would like a table that shows all the fields plus the amount of data seen cumulative.

                hmm, as I see it, you would nee to create a widget with the search field:

                Example if the destination host is in the 192.168.255.0/24 subnet.
                postNATSourceIPv4Address:192.168.255.* OR postNATDestinationIPv4Address:192.168.255.*

                c41e8893-3c35-415f-87a6-66fe650e1f35-image.png

                Then, as per picture above, filter by destination or source (this will give you the external users data), use SUM and Data Table.

                dead on arrival, nowhere to be found.

                M 1 Reply Last reply Reply Quote 0
                • M
                  michmoor LAYER 8 Rebel Alliance @mcury
                  last edited by

                  @mcury Ok yeah thats the way to go BUT....i have to use NetFlow as netflow already has bytes parsed in the output while IPFix does not.

                  Still figuring out how to normalize the nf_bytes column to megabytes

                  11f6a491-d963-4b79-8703-e71335fc279a-image.png

                  Firewall: NetGate,Palo Alto-VM,Juniper SRX
                  Routing: Juniper, Arista, Cisco
                  Switching: Juniper, Arista, Cisco
                  Wireless: Unifi, Aruba IAP
                  JNCIP,CCNP Enterprise

                  M 1 Reply Last reply Reply Quote 0
                  • M
                    mcury Rebel Alliance @michmoor
                    last edited by mcury

                    @michmoor said in NAT Logs:

                    Still figuring out how to normalize the nf_bytes column to megabytes

                    Try this pipeline rule:

                    rule "arithmetic"
                    when
                    has_field("octetDeltaCount")
                    then
                    let size_kb = to_double($message.octetDeltaCount);
                    set_field("size_bytes", size_kb / to_double(value:"1048576"));
                    end
                    

                    This will give you something like this:

                    082e7253-69fb-4bbe-ba97-72d657b34e48-image.png

                    dead on arrival, nowhere to be found.

                    M 1 Reply Last reply Reply Quote 0
                    • M
                      michmoor LAYER 8 Rebel Alliance @mcury
                      last edited by

                      @mcury Not sure if its working to be honest.
                      There are no errors showing up in the pipeline so messages are being processed.

                      07813656-4d88-46af-94bd-a1028a62a697-image.png

                      Message:
                      ad77d9f7-ce71-4267-bc0a-c27bd6fccf05-image.png

                      Firewall: NetGate,Palo Alto-VM,Juniper SRX
                      Routing: Juniper, Arista, Cisco
                      Switching: Juniper, Arista, Cisco
                      Wireless: Unifi, Aruba IAP
                      JNCIP,CCNP Enterprise

                      M 1 Reply Last reply Reply Quote 0
                      • M
                        mcury Rebel Alliance @michmoor
                        last edited by mcury

                        @michmoor said in NAT Logs:

                        @mcury Not sure if its working to be honest.
                        There are no errors showing up in the pipeline so messages are being processed.

                        Did you edit the pipeline connections and assigned to the ipfix stream ?

                        f81dbcce-4c66-444a-b83c-f513042f1217-image.png

                        dead on arrival, nowhere to be found.

                        M 1 Reply Last reply Reply Quote 0
                        • M
                          michmoor LAYER 8 Rebel Alliance @mcury
                          last edited by

                          @mcury
                          Im on Graylog 6.0.5

                          Yes my pipeline is connected to my stream. Im using Netflow data just for testing.

                          0f4d23f6-d5d0-4848-bd5d-a387389102a3-image.png

                          Firewall: NetGate,Palo Alto-VM,Juniper SRX
                          Routing: Juniper, Arista, Cisco
                          Switching: Juniper, Arista, Cisco
                          Wireless: Unifi, Aruba IAP
                          JNCIP,CCNP Enterprise

                          M 1 Reply Last reply Reply Quote 0
                          • M
                            mcury Rebel Alliance @michmoor
                            last edited by

                            @michmoor I'm on Graylog 6.1.5, but it should work on 6.0.5, no problems with that.

                            Is Configurations tab, Manage processors, is pipeline active ?

                            397c9e91-cde7-4430-9cb9-eded0b235578-image.png

                            dead on arrival, nowhere to be found.

                            M 1 Reply Last reply Reply Quote 0
                            • M
                              michmoor LAYER 8 Rebel Alliance @mcury
                              last edited by michmoor

                              @mcury
                              Yep its active.
                              I have other pipelines in effect so this is all working. The new pipeline for Netflow is the latest addition. I guess I'm trying to figure out how to prove its working
                              With my other pipelines, I'm extracting fields into Grok Patterns so i can tell immediately if its working.

                              7c40a487-3d63-4b9d-919a-caeb5ce01949-image.png

                              Considering i see no errors in the pipeline i have to imagine its working.

                              824e3d6d-ba4d-4632-aff0-0a4e29285497-image.png

                              Firewall: NetGate,Palo Alto-VM,Juniper SRX
                              Routing: Juniper, Arista, Cisco
                              Switching: Juniper, Arista, Cisco
                              Wireless: Unifi, Aruba IAP
                              JNCIP,CCNP Enterprise

                              M 1 Reply Last reply Reply Quote 0
                              • M
                                mcury Rebel Alliance @michmoor
                                last edited by

                                @michmoor said in NAT Logs:

                                Considering i see no errors in the pipeline i have to imagine its working.

                                But do you see messages being processed in the Throughput ?

                                88a76adb-653c-4a99-93cb-35d9db0c3ad5-image.png

                                dead on arrival, nowhere to be found.

                                M 1 Reply Last reply Reply Quote 0
                                • M
                                  michmoor LAYER 8 Rebel Alliance @mcury
                                  last edited by

                                  @mcury

                                  24d85bba-5196-48a1-b78f-1f4e34458d03-image.png

                                  Firewall: NetGate,Palo Alto-VM,Juniper SRX
                                  Routing: Juniper, Arista, Cisco
                                  Switching: Juniper, Arista, Cisco
                                  Wireless: Unifi, Aruba IAP
                                  JNCIP,CCNP Enterprise

                                  M 1 Reply Last reply Reply Quote 0
                                  • M
                                    mcury Rebel Alliance @michmoor
                                    last edited by

                                    @michmoor said in NAT Logs:

                                    @mcury

                                    24d85bba-5196-48a1-b78f-1f4e34458d03-image.png

                                    Now, check if the field exists:

                                    b1a8c141-cd13-45c4-82b9-faba00110642-image.png

                                    dead on arrival, nowhere to be found.

                                    M 1 Reply Last reply Reply Quote 0
                                    • M
                                      michmoor LAYER 8 Rebel Alliance @mcury
                                      last edited by michmoor

                                      @mcury

                                      It does. I feel like we are getting close to a confirmation. LOL

                                      d5d84e66-3fc6-4bd2-95af-31a70324961d-image.png

                                      Is my pipeline rule correct?

                                      46c24019-f782-4843-adbb-c95bee59acd1-image.png

                                      Firewall: NetGate,Palo Alto-VM,Juniper SRX
                                      Routing: Juniper, Arista, Cisco
                                      Switching: Juniper, Arista, Cisco
                                      Wireless: Unifi, Aruba IAP
                                      JNCIP,CCNP Enterprise

                                      M 1 Reply Last reply Reply Quote 0
                                      • M
                                        mcury Rebel Alliance @michmoor
                                        last edited by mcury

                                        @michmoor said in NAT Logs:

                                        It does. I feel like we are getting close to a confirmation. LOL

                                        So, the rule is processing the data, and the field exists.
                                        It must be showing up in the logs..

                                        @michmoor said in NAT Logs:

                                        Is my pipeline rule correct?

                                        That is an old rule, I'm using now octetDeltaCount, replace the rule with the one I posted above.

                                        After that, go to rule simulator, JSON, paste the example below, then click in run rule simulator, and check if the field size_bytes will appear

                                        {
                                          "destinationTransportPort": 3246,
                                          "size_bytes": 0,
                                          "gl2_remote_ip": "192.168.255.249",
                                          "gl2_remote_port": 20815,
                                          "sourceIPv4Address": "192.168.255.249",
                                          "source": "192.168.255.249",
                                          "ipClassOfService": 0,
                                          "gl2_source_input": "6627f43d99aaec416300cd0e",
                                          "hostname_src": "pfsense.home.arpa.",
                                          "egressInterface": 1,
                                          "octetDeltaCount": 168,
                                          "gl2_source_node": "0f929def-42b9-4ea6-8980-799a62f7bdb3",
                                          "sourceTransportPort": 3246,
                                          "flowEndMilliseconds": "2024-04-23T20:21:02.098Z",
                                          "timestamp": "2024-04-23T20:21:24.000Z",
                                          "destinationIPv4Address": "192.168.255.253",
                                          "gl2_accounted_message_size": 575,
                                          "streams": [
                                            "63fe3ab48b6393126ef3c2f7"
                                          ],
                                          "gl2_message_id": "01HW69XJD000004NFV0XGMQ27B",
                                          "message": "Ipfix [192.168.255.249]:3246 <> [192.168.255.253]:3246 proto:1 pkts:2 bytes:168",
                                          "ingressInterface": 1,
                                          "packetDeltaCount": 2,
                                          "protocolIdentifier": 1,
                                          "hostname_dst": "rpi4.home.arpa.",
                                          "_id": "0ea147d7-01af-11ef-8e3e-dca632a54719",
                                          "flowStartMilliseconds": "2024-04-23T20:21:01.096Z"
                                        }
                                        

                                        dead on arrival, nowhere to be found.

                                        M 1 Reply Last reply Reply Quote 0
                                        • M
                                          michmoor LAYER 8 Rebel Alliance @mcury
                                          last edited by

                                          @mcury Rule simulation returns without a problem

                                          So I'm a bit confused as to how you figured out there was a field called "size_bytes" as that does not come up for me when i review the available fields. In fact, unlike NetFlow which has a field called "nf_bytes" there is nothing similar in IPFix within Graylog.

                                          Firewall: NetGate,Palo Alto-VM,Juniper SRX
                                          Routing: Juniper, Arista, Cisco
                                          Switching: Juniper, Arista, Cisco
                                          Wireless: Unifi, Aruba IAP
                                          JNCIP,CCNP Enterprise

                                          M 1 Reply Last reply Reply Quote 0
                                          • M
                                            mcury Rebel Alliance @michmoor
                                            last edited by mcury

                                            @michmoor said in NAT Logs:

                                            @mcury Rule simulation returns without a problem

                                            So I'm a bit confused as to how you figured out there was a field called "size_bytes" as that does not come up for me when i review the available fields. In fact, unlike NetFlow which has a field called "nf_bytes" there is nothing similar in IPFix within Graylog.

                                            I'm using IPFIX UDP, the rule "arithmetic" above reflects that.

                                            The size_bytes field is the one we are creating with the pipeline.
                                            I'm transforming the field octetDeltaCount, which is in bytes, to size_bytes , which is in megabytes.

                                            dead on arrival, nowhere to be found.

                                            M 1 Reply Last reply Reply Quote 1
                                            • First post
                                              Last post
                                            Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.