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

PFBlockerNG Log Parsing for syslog

Scheduled Pinned Locked Moved pfBlockerNG
5 Posts 3 Posters 3.8k 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.
  • V
    vito
    last edited by Aug 29, 2015, 2:56 PM Aug 29, 2015, 2:16 PM

    We are sending pfsense to a syslog server (kiwi)
    In Kiwi you can build a filter to parse the log and run rules against the results.
    I have been looking for something to scrape to parse pfblockerNG logs (or alerts more so) to send to a different display and different log file.
    I was able to do this with Squid and Snort as both adds a tag to the log, but I cannot find something constant for PFBlockerNG.
    I will assume I am missing something and I could just be blind. 
    Thanks in advance.
    Vito

    1 Reply Last reply Reply Quote 0
    • B
      BBcan177 Moderator
      last edited by Aug 29, 2015, 3:17 PM

      Hi Vito,

      The pfblockerng.log is not easily parsed for a syslog… Its meant to be more informative then a single line log. It also doesn't contain any alert information. That log contains the details about the downloads and summary information.

      The best is to use the firewall.log and parse that for the alerts. Unfortunately pfSense doesn't log the table name in the Alert. Not sure if the Devs are going to fix that or not... But that would make the syslog alerts more informative...  I log all my logs to Security Onion which uses ELSA. You could also do the same with ELK... A user posted a help link just yesterday:

      https://forum.pfsense.org/index.php?PHPSESSID=nmofscd1r7s1vmiuk4m4t1r4a7&topic=98740.0

      "Experience is something you don't get until just after you need it."

      Website: http://pfBlockerNG.com
      Twitter: @BBcan177  #pfBlockerNG
      Reddit: https://www.reddit.com/r/pfBlockerNG/new/

      1 Reply Last reply Reply Quote 0
      • V
        vito
        last edited by Aug 29, 2015, 3:39 PM

        Thanks!
        Yeah, i meant to add i was trying from the firewall.log
        :(
        I will take a look at the link you provided!

        Snort and Squid were pretty straight forward as i captured the word "snort" and "squid" from the message
        It would be great if PFBlocker could add a header or something just to the message it self.
        (Mainly looking to parse the info from the alerts tab in PFBlockerNG)

        1 Reply Last reply Reply Quote 0
        • B
          BBcan177 Moderator
          last edited by Aug 29, 2015, 4:02 PM

          You can view the raw firewall log by the following command:

          clog /var/log/filter.log

          Here is the wiki pfSense doc for the log format in 2.2.x
          https://doc.pfsense.org/index.php/Filter_Log_Format_for_pfSense_2.2

          Unfortunately each line doesn't have the table name, but it does reference the packet fence rule number. Those are at the start of the syslog line beginning with the "@" symbol…

          This command will show the existing Rule numbers for pfBNG:
          pfctl -vv -sr | grep 'pfB'_

          Execute the following command to get a list of the pf Rule numbers as a reference… Adding/Deleting rules might change the numbers, so I don't think it stays consistent with changes to the rules... I think in 2.2.4 this has been improved upon but I haven't fully tested it either...

          "Experience is something you don't get until just after you need it."

          Website: http://pfBlockerNG.com
          Twitter: @BBcan177  #pfBlockerNG
          Reddit: https://www.reddit.com/r/pfBlockerNG/new/

          1 Reply Last reply Reply Quote 0
          • K
            killmasta93
            last edited by Sep 3, 2015, 5:40 PM

            hey vito for ELK server logs disable first all log capture by default and let pfblockerNG do all the log reporting. Then on Kibana (ELK) you will see the rule it will be filtering for ex: rule 85 is blocking all top IPv4 list while rule 92 is blocking youtube. see pictures
            hope this helps im working now on filtering the syslog (system logs for pfsense) but seems hopeless  :-[

            Clipboarder.2015.09.03-003.png
            Clipboarder.2015.09.03-003.png_thumb
            Clipboarder.2015.09.03-004.png
            Clipboarder.2015.09.03-004.png_thumb
            Clipboarder.2015.09.03-005.png
            Clipboarder.2015.09.03-005.png_thumb
            Clipboarder.2015.09.03-006.png
            Clipboarder.2015.09.03-006.png_thumb

            Tutorials:

            https://www.mediafire.com/folder/v329emaz1e9ih/Tutorials

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