export

package
v0.0.0-...-45fb939 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 9, 2026 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Overview

Package export writes ja4monitor connections to disk in JSON or CSV format. Used by the TUI E key and by the future `ja4monitor query` CLI.

JSON output is one object per connection, including the full fingerprint timeline. Good for SIEM ingestion and for sharing investigation context.

CSV output is one row per fingerprint event (denormalized), making it easy to pivot in a spreadsheet.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultPath

func DefaultPath(f Format) string

DefaultPath returns a timestamped export filename in the current working directory. Uses millisecond precision so two exports in the same second (e.g., during an incident) don't collide on the O_EXCL open in Write().

Example: ./ja4monitor-export-20260409-144532-718.json

func Write

func Write(path string, format Format, conns []*tracker.Connection) error

Write writes connections to the given path in the given format. Creates the file with 0644 permissions; fails if the file already exists to prevent accidental overwrite.

Returns a clear error if the directory is not writable so the TUI can surface it in the status bar instead of failing silently.

Types

type Format

type Format int

Format is either FormatJSON or FormatCSV.

const (
	FormatJSON Format = iota
	FormatCSV
)

func ParseFormat

func ParseFormat(c rune) (Format, bool)

ParseFormat converts a single character ('j' or 'c') to a Format. Used by the TUI export prompt.

func (Format) Extension

func (f Format) Extension() string

Extension returns the file extension for the format, including the dot.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL