Skip to main content

Slice a pcap file into pieces and process in parallel

Project description

# Slice a large pcap file and process in parallel

## Install

python setup.py install

## Usage

The below is an example to slice a pcap file into 10 files.

slicecap -r source.pcap -n 10 – “cat - > dest-{SLICE_ID}.pcap”

The -r or –infile option specifies input pcap file to slice. Stdin is not acceptable because slicecap will change file handle pointer using the seek() method.

The -n or –number option specifies the total number of sliced pcap files. This default value is 2.

The -g or –maxgap option specifies the maximum time difference (in seconds) used to compare packet timestamps to find the pcap pkthdr boundary. The default value is 3600.

The -p or –parallel option specifies the maximum number of parallel subprocesses. The default value is automatically determined based on the number of cores of the host node. It doesn’t make sense to specify a larger value than the number of cores.

After the option, you can specify a subprocess to process the sliced pcap data. In the above example, the sliced data will just redirected into files. In the subprocess definition, you can use the following keywords that are replaced dynamically when executed. Since the replacement will be done by the Python text formatting function, you can specify formatting rules using the standard Python text formatter syntax.

  • OFFSET: The file offset value in bytes.

  • SIZE: The size of the sliced pcap data.

  • SLICE_ID: The ID number (begins from 0) of the sliced file.

## Bug Reports Please submit bug reports or patches through the GitHub interface.

## Author Keiichi SHIMA / IIJ Innovation Institute Inc. / WIDE project

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

slicecap-0.3.0.tar.gz (5.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

slicecap-0.3.0-py3-none-any.whl (6.1 kB view details)

Uploaded Python 3

File details

Details for the file slicecap-0.3.0.tar.gz.

File metadata

  • Download URL: slicecap-0.3.0.tar.gz
  • Upload date:
  • Size: 5.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for slicecap-0.3.0.tar.gz
Algorithm Hash digest
SHA256 260413bea6b6c818362e3df20715d1a20e24897db0e1733095009505520b7bc6
MD5 13e19b233abcd392f8b71ec681b30132
BLAKE2b-256 68e0504b44b161b5ed319922553c7604413703974e1863a155b7726d45f0f6ce

See more details on using hashes here.

File details

Details for the file slicecap-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: slicecap-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 6.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for slicecap-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 684249395f2428a7f8efa6bbe25098c5da6e14d4dc83070c1d305346735875c3
MD5 050aa415a5926e8cac3b537aa99a611e
BLAKE2b-256 a20e1cc17b750ad27a6b9bd5abe7a2d304cad4f399167ca621a8864488fc306a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page