From owner-freebsd-pf@FreeBSD.ORG Tue Aug 27 11:25:28 2013 Return-Path: Delivered-To: freebsd-pf@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id C883AB13 for ; Tue, 27 Aug 2013 11:25:28 +0000 (UTC) (envelope-from patfbsd@davenulle.org) Received: from smtp.lamaiziere.net (net.lamaiziere.net [94.23.254.147]) by mx1.freebsd.org (Postfix) with ESMTP id 92253201A for ; Tue, 27 Aug 2013 11:25:28 +0000 (UTC) Received: from mr129166.localdomain (mr129166.cri.univ-rennes1.fr [129.20.129.166]) by smtp.lamaiziere.net (Postfix) with ESMTPA id C9601A28D; Tue, 27 Aug 2013 13:25:20 +0200 (CEST) Received: from mr129166 (localhost [127.0.0.1]) by mr129166.localdomain (Postfix) with ESMTP id B9EB72CA2; Tue, 27 Aug 2013 13:25:19 +0200 (CEST) Date: Tue, 27 Aug 2013 13:25:15 +0200 From: Patrick Lamaiziere To: "Mike." Subject: Re: formatting script for pfctl -v -s rules Message-ID: <20130827132515.13aca0b4@mr129166> In-Reply-To: <201308261223420296.00BDCCA4@smtp.24cl.home> References: <201308261223420296.00BDCCA4@smtp.24cl.home> X-Mailer: Claws Mail 3.9.2 (GTK+ 2.24.19; amd64-portbld-freebsd9.1) Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Cc: freebsd-pf@freebsd.org X-BeenThere: freebsd-pf@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Technical discussion and general questions about packet filter \(pf\)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Aug 2013 11:25:28 -0000 Le Mon, 26 Aug 2013 12:23:42 -0400, "Mike." a écrit : Hello, > I've written a quick script to format the output of pfctl -v -s rules > into a one-line-per-rule format. For me, this format is more useful. > > The script and sample output are available here: > > http://archive.mgm51.com/sources/pfstats.html > > I use this script with FreeBSD 8.4 and 9.1 Thanks, I think my colleagues will like this. The script does not work on OpenBSD 5.3 because cut(1) does not handle the '-' file. I think it is not needed at all : sed s/" *"/" "/g | \ cut -d' ' -f3,5,7,11- | \ Regards,