Giter VIP home page Giter VIP logo

conntrack-to-csv's Introduction

conntrack-to-csv

Turn conntrack -L output into a CSV.

This is useful when you want to import your conntrack entries into a spreadsheet.

Requirements

You just need python3 and pip3.

$ python3 --version
Python 3.11.0

$ pip3 --version
pip 22.3 from ./conntrack-to-csv/venv/Lib/site-packages/pip (python 3.11)

Installation

Just clone this project and Install the requirements with pip3.

# Clone this project
$ git clone [email protected]:penafieljlm/conntrack-to-csv.git

# Navigate into the project
$ cd conntrack-to-csv

# Install the requirements
$ pip3 install -r requirements.txt

Usage

The following snippet describes how to use the script.

$ python3 conntrack-to-csv.py3 -h
usage: conntrack-to-csv.py3 [-h] input output

positional arguments:
  input       Input file path
  output      Output file path

options:
  -h, --help  show this help message and exit

Typical use-case is as follows:

# Dump conntrack entries into a file
$ conntrack -L > conntrack.txt

# Convert conntrack entries file into a CSV file
$ python3 conntrack-to-csv.py3 conntrack.txt conntrack.csv

You can read from stdin by specifying - as the input file path:

$ conntrack -L | python3 conntrack-to-csv.py3 - conntrack.csv

You can write to stdout by specifying - as the output file path:

$ conntrack -L | python3 conntrack-to-csv.py3 - -

Notes

To check syntax with mypy:

$ mypy conntrack-to-csv.py3

To automatically sort imports with isort:

$ isort conntrack-to-csv.py3

conntrack-to-csv's People

Contributors

penafieljlm avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.