nsave
nsave is a tool for capturing and saving data packets. It continuously captures packets and saves them locally. You can query connections and packets based on conditions and export them as pcap files.
It is currently in the prototype stage and should not be used in critical production environments.
Operating Environment
Linux, macOS.
Configuration
The configuration items are as follows:
= "en1"
= 2000
= "tcp"
= true
# pcap_file = "~/misc/https.pcap"
= "/Users/lch/misc/nsave_data/"
# Number of threads writing to disk
= 2
= 2048
= 1024
# Microseconds. 500 milliseconds
= 500000000
# Milliseconds
= 5
# Milliseconds
= 100
# 16M 1024 * 1024 * 16
= 16777216
# 2M 1024 * 1024 * 2
= 2097152
# 80k 1024 * 80
= 81920
= 1024
= 1024
= 1024
# Microseconds. 10 seconds
= 10000000000
= 8
Place the configuration file .nsave.toml in the current user's directory.
Running
Execute nsave, and it will start continuously capturing packets and saving them locally.
Querying
You can query connections or packets based on time, five-tuple, or BPF filters.
Querying connections by five-tuple:
Dump the query results to a pcap file:
Querying packets with a BPF filter:
BPF queries can also be dumped to a pcap file: