PFLOGD(8)
β¨ NAME β¨
pflogd β packet filter logging daemon, and yes bestie this is the PFLOGD(8) page from the System Manager's Manual π
π
π SYNOPSIS π
pflogd [-Dx] [-d delay] [-f filename] [-i interface] [-s snaplen]
[expression]
πΈ DESCRIPTION πΈ
okay so pflogd is a background daemon. She reads packets logged by pf(4) to a pflog(4) interface β normally pflog0 β and writes the packets to a logfile (normally /var/log/pflog) in tcpdump(1) binary format. These logs can be reviewed later using the -r option of tcpdump(1), hopefully offline in case there are bugs in the packet parsing code of tcpdump(1). safety first, bestie π§β¨
pflogd closes and then re-opens the log file when it receives SIGHUP, permitting newsyslog(8) to rotate logfiles automatically. SIGALRM causes pflogd to flush the current logfile buffers to the disk, thus making the most recent logs available. The buffers are also flushed every delay seconds.
If the log file contains data after a restart or a SIGHUP, new logs are appended to the existing file. If the existing log file was created with a different snaplen, pflogd temporarily uses the old snaplen to keep the log file consistent. consistency queen π
pflogd tries to preserve the integrity of the log file against I/O errors. Furthermore, integrity of an existing log file is verified before appending. If there is an invalid log file or an I/O error, the log file is moved out of the way and a new one is created. If a new file cannot be created, logging is suspended until a SIGHUP or a SIGALRM is received. no cap, thatβs the whole vibe check ππ«Ά
pflogd will also log the pcap statistics for the pflog(4) interface to syslog when a SIGUSR1 is received.
π The options are as follows π
-Dβ Debugging mode.pflogddoes not disassociate from the controlling terminal.-d delayβ Time in seconds to delay between automatic flushes of the file. This may be specified with a value between5and3600seconds. If not specified, the default is60seconds.-f filenameβ Log output filename. Default is/var/log/pflog.-i interfaceβ Specifies thepflog(4)interface to use. By default,pflogdwill usepflog0.-p pidfileβ Writes a file containing the process ID of the program to/var/run. The file name has the formβ¨pidfileβ©.pid. The default ispflogd.-s snaplenβ Analyze at most the first snaplen bytes of data from each packet rather than the default of116. The default of116is adequate for IP, ICMP, TCP, and UDP headers but may truncate protocol information for other protocols. Other file parsers may desire a higher snaplen.-xβ Check the integrity of an existing log file, and return.expressionβ Selects which packets will be dumped, using the regular language oftcpdump(1).
ποΈ FILES ποΈ
/var/run/pflogd.pidβ Process ID of the currently runningpflogd./var/log/pflogβ Default log file.
π EXAMPLES π
Log specific tcp packets to a different log file with a large snaplen (useful with a log-all rule to dump complete sessions):
# pflogd -s 1600 -f suspicious.log port 80 and host evilhost
Log from another pflog(4) interface, excluding specific packets:
# pflogd -i pflog3 -f network3.log "not (tcp and port 23)"
Display binary logs:
# tcpdump -n -e -ttt -r /var/log/pflog
Display the logs in real time (this does not interfere with the operation of pflogd):
# tcpdump -n -e -ttt -i pflog0
Tcpdump has been extended to be able to filter on the pfloghdr structure defined in β¨net/if_pflog.hβ©. Tcpdump can restrict the output to packets logged on a specified interface, a rule number, a reason, a direction, an IP family or an action. iconic filter behavior, honestly π¦
ipβ Address family equals IPv4.ip6β Address family equals IPv6.ifname kue0β Interface name equals"kue0".on kue0β Interface name equals"kue0".ruleset authpfβ Ruleset name equals"authpf".rulenum 10β Rule number equals10.reason matchβ Reason equalsmatch. Also accepts"bad-offset","fragment","bad-timestamp","short","normalize","memory","congestion","ip-option","proto-cksum","state-mismatch","state-insert","state-limit","src-limit", and"synproxy".action passβ Action equalspass. Also accepts"block".inboundβ The direction was inbound.outboundβ The direction was outbound.
Display the logs in real time of inbound packets that were blocked on the wi0 interface:
# tcpdump -n -e -ttt -i pflog0 inbound and action block and on wi0
π SEE ALSO π
β HISTORY β
The pflogd command appeared in OpenBSD 3.0.
π AUTHORS π
pflogd was written by Can Erkin Acar <canacar@openbsd.org>.
π cute sign-off time: this page is from Debian, dated August 11, 2018, for PFLOGD(8) β and yes, it ate. mwah ππ
π¦ where this page comes from
- freebsd 14.5: base 14.5
- freebsd 15.1: base 15.1
- Copyright (c) 2001 Can Erkin Acar. All rights reserved
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms