LinuxCommandLibrary

sc_warts2json

Convert sc_warts format to JSON

TLDR

Convert warts files to JSON and output the result

$ sc_warts2json [path/to/file1.warts path/to/file2.warts ...]
copy

SYNOPSIS

sc_warts2json [-o output_file] [-p] [-r] [-R] [-v] [warts_file ...]
If no warts_file is specified, sc_warts2json reads data from standard input.

PARAMETERS

-o
    Redirects the JSON output to the specified output_file instead of standard output (stdout).

-p
    Enables "pretty printing" of the JSON output, adding indentation and newlines to make it more human-readable.

-r
    If specified, sc_warts2json outputs the converted Warts records as elements within a single JSON array. Without this option, it prints a stream of individual JSON objects (one per line).

-R
    Outputs a single JSON object with two top-level fields: a status field indicating the processing outcome (e.g., success or error), and a data field containing an array of the converted Warts records. This provides more context about the conversion process itself.

-v
    Activates verbose mode, causing sc_warts2json to print informational and diagnostic messages to standard error (stderr) during processing.

DESCRIPTION

sc_warts2json is a utility from the scamper suite designed to transform network measurement data stored in the binary Warts format into a human-readable and machine-parseable JSON (JavaScript Object Notation) format. Warts is a specialized format used by scamper for efficient storage of various network measurement types, including traceroute paths, ping results, and Multi-Destination Address (MDA) probing data.

The conversion to JSON facilitates easier analysis and integration of scamper's output with other tools and programming languages that readily support JSON parsing. Each individual measurement record within a Warts file (e.g., a single traceroute or ping) is converted into a distinct JSON object. By default, these objects are output as a stream of JSON entities, but options are available to enclose them within a single JSON array for a more structured output. This command is invaluable for researchers and network engineers who collect large volumes of network performance data and need to process it programmatically.

CAVEATS

The sc_warts2json command is specifically designed for Warts files generated by scamper. Compatibility with Warts files from other sources is not guaranteed and may lead to parsing errors.

For very large Warts files, converting to pretty-printed JSON (using the -p option) can significantly increase the output file size and may consume more memory and processing time.

Ensure that the input Warts file is not corrupted; corrupted files may cause the conversion process to fail or produce incomplete JSON output.

INPUT/OUTPUT BEHAVIOR

By default, sc_warts2json reads from standard input if no specific Warts files are provided as arguments. It writes the resulting JSON output to standard output, which can then be piped to other commands or redirected to a file.

ERROR HANDLING

The command typically exits with a non-zero status code if it encounters errors during file parsing or processing, indicating a failure. Verbose mode (-v) can provide more details on such errors.

HISTORY

sc_warts2json was first implemented in March 2017 as part of the ongoing development of the scamper network measurement suite by the Center for Applied Internet Data Analysis (CAIDA). Its creation addressed the growing need for easier programmatic access and analysis of scamper's measurement data, moving from a binary-centric format (Warts) to a widely adopted, interoperable text-based format (JSON).

SEE ALSO

scamper(1), sc_warts_dump(1), sc_warts2text(1)

Copied to clipboard