# fping JSON Output Format
+
last updated for: fping 5.5
-> [!IMPORTANT]
-> The JSON output feature is currently in **alpha**. The format is subject to change in future versions.
+> [!IMPORTANT] The JSON output feature is currently in **alpha**. The format is
+> subject to change in future versions.
-When using the `--json` (or `-J`) option, fping outputs results as a **stream of JSON objects**, separated by newlines. Each line in the output is a valid, independent JSON document representing a specific event or statistic.
+When using the `--json` (or `-J`) option, fping outputs results as a **stream of
+JSON objects**, separated by newlines. Each line in the output is a valid,
+independent JSON document representing a specific event or statistic.
## General Format
{ "type": { "field1": "value1", "field2": "value2" } }
```
-Where `type` identifies the type of the object (e.g., `resp`, `summary`) and the inner object contains the fields relevant to that type.
+Where `type` identifies the type of the object (e.g., `resp`, `summary`) and the
+inner object contains the fields relevant to that type.
## Forward Compatibility
-Any unknown object types and any unknown fields should be ignored for forward-compatibility (we might add new objects and fields to objects over time).
+Any unknown object types and any unknown fields should be ignored for
+forward-compatibility (we might add new objects and fields to objects over
+time).
## Example
## JSON Object Types
-> [!NOTE]
-> In the actual output, each JSON object is compacted onto a single line. The examples in this document are formatted across multiple lines for readability.
+> [!NOTE] In the actual output, each JSON object is compacted onto a single
+> line. The examples in this document are formatted across multiple lines for
+> readability.
-The following top-level keys identify the type of information contained in each JSON object:
+The following top-level keys identify the type of information contained in each
+JSON object:
-* `resp`: Response to a ping packet.
-* `timeout`: Timeout waiting for a packet response.
-* `summary`: Summary statistics for a host (used with `-c`).
-* `vSum`: Summary of all RTT values for a host (used with `-C`).
-* `globalSum`: Global statistics for the entire run (used with `-s`).
-* `intSum`: Interval summary statistics (used with `-Q`).
+- `resp`: Response to a ping packet.
+- `timeout`: Timeout waiting for a packet response.
+- `summary`: Summary statistics for a host (used with `-c`).
+- `vSum`: Summary of all RTT values for a host (used with `-C`).
+- `globalSum`: Global statistics for the entire run (used with `-s`).
+- `intSum`: Interval summary statistics (used with `-Q`).
### `resp`: Response
}
```
-* `host`: Target hostname or IP.
-* `seq`: Sequence number of the packet (0-indexed).
-* `size`: Size of the received packet in bytes.
-* `rtt`: Round-trip time in milliseconds.
+- `host`: Target hostname or IP.
+- `seq`: Sequence number of the packet (0-indexed).
+- `size`: Size of the received packet in bytes.
+- `rtt`: Round-trip time in milliseconds.
**Optional Fields:**
-* `timestamps`: If ICMP timestamp requests are used (`--icmp-timestamp`), contains `originate`, `receive`, `transmit`, and `localreceive` timestamps.
-* `tos`: If `--print-tos` is used, contains the Type of Service value.
-* `ttl`: If `--print-ttl` is used, contains the Time To Live value.
+- `timestamps`: If ICMP timestamp requests are used (`--icmp-timestamp`),
+ contains `originate`, `receive`, `transmit`, and `localreceive` timestamps.
+- `tos`: If `--print-tos` is used, contains the Type of Service value.
+- `ttl`: If `--print-ttl` is used, contains the Time To Live value.
### `timeout`: Timeout
}
```
-* `host`: Target hostname or IP.
-* `seq`: Sequence number of the timed-out packet.
+- `host`: Target hostname or IP.
+- `seq`: Sequence number of the timed-out packet.
### `summary`: Host Summary
}
```
-* `xmt`: Packets transmitted.
-* `rcv`: Packets received.
-* `loss`: Packet loss percentage.
-* `outage(ms)`: Total outage time in milliseconds (only if `--outage` is used).
-* `rttMin`, `rttAvg`, `rttMax`: Minimum, average, and maximum RTTs.
+- `xmt`: Packets transmitted.
+- `rcv`: Packets received.
+- `loss`: Packet loss percentage.
+- `outage(ms)`: Total outage time in milliseconds (only if `--outage` is used).
+- `rttMin`, `rttAvg`, `rttMax`: Minimum, average, and maximum RTTs.
### `vSum`: Full RTT Summary
-Generated at end of execution when using `-C` (count mode with per-packet RTT reporting).
+Generated at end of execution when using `-C` (count mode with per-packet RTT
+reporting).
```json
{
"vSum": {
"host": "127.0.0.1",
- "values": [
- 0.054,
- 0.062,
- null,
- 0.081
- ]
+ "values": [0.054, 0.062, null, 0.081]
}
}
```
-* `values`: Array of RTT values (in ms) for each sequence number. `null` indicates a timeout/loss.
+- `values`: Array of RTT values (in ms) for each sequence number. `null`
+ indicates a timeout/loss.
### `intSum`: Interval Summary
}
```
-* `time`: Unix timestamp of the report.
-* Other fields are similar to `summary`.
+- `time`: Unix timestamp of the report.
+- Other fields are similar to `summary`.
### `globalSum`: Global Summary