<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Logging connections to external SQL database or files]]></title><description><![CDATA[<p dir="auto">Hello,</p>
<p dir="auto">I would log every estabilished and closed connection with following data:</p>
<ul>
<li>date/time estabilished</li>
<li>date/time closed</li>
<li>IP LAN -&gt; Internet</li>
<li>Internet -&gt; IP LAN</li>
<li>MAC address of LAN device should be also included</li>
<li>avoid repeating messages</li>
</ul>
<p dir="auto">Right now (not on pfSense but on Linux box) I'm doing just tcpdump with following script:</p>
<pre><code>#!/bin/bash
#Check if directory exists, if not create
if test -d /home/logi/
        then echo "Directory already exists!"
        else  mkdir /home/logi
        fi
#Moving files
mv /home/logi/tcp-syn.dmp /home/logi/tcp-restart-`date +%d-%B-%Y--%H-%M`.dmp
#This is dump into RAW data
#tcpdump -i eth2 tcp [13] == 2 -w /home/logi/tcp-syn.dmp &amp; tar cvfz /home/logi/tcp-restart-`date +%d-%B-%Y--%H-%M`.tar.gz /h
#This is dump into TXT data
tcpdump -i eth2 tcp [13] == 2 -n &gt;&gt; /home/logi/tcp-syn.dmp &amp; tar cvfz /home/logi/tcp-restart-`date +%d-%B-%Y--%H-%M`.tar.gz
rm /home/logi/tcp-restart-`date +%d-%B-%Y--%H-%M`.dmp
</code></pre>
<p dir="auto">This creates daily logs in separate files, for example:</p>
<pre><code>tcp-restart-08-February-2011--16-20.tar.gz
tcp-31-july-2011.tar.gz
</code></pre>
<p dir="auto">Eth2 is my LAN interface.<br />
And they are really small files (but don't know does it log every single estabilished connection).</p>
<p dir="auto">Now I have to ask how to log connections in pfSense? Let's assume I would like to collect all logs from many pfSense boxes in one place :)</p>
]]></description><link>https://forum.netgate.com/topic/43506/logging-connections-to-external-sql-database-or-files</link><generator>RSS for Node</generator><lastBuildDate>Tue, 09 Jun 2026 18:19:13 GMT</lastBuildDate><atom:link href="https://forum.netgate.com/topic/43506.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 31 Mar 2012 22:14:43 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Logging connections to external SQL database or files on Sat, 31 Mar 2012 22:17:27 GMT]]></title><description><![CDATA[<p dir="auto">Use syslog to forward pfsense logs to this Linux box and use the same script on log received.</p>
<p dir="auto">Or use a syslog server That do this sql/frontend for you.</p>
]]></description><link>https://forum.netgate.com/post/328184</link><guid isPermaLink="true">https://forum.netgate.com/post/328184</guid><dc:creator><![CDATA[marcelloc]]></dc:creator><pubDate>Sat, 31 Mar 2012 22:17:27 GMT</pubDate></item></channel></rss>