You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/fping-json.md
+44-38Lines changed: 44 additions & 38 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,10 +1,13 @@
1
1
# fping JSON Output Format
2
+
2
3
last updated for: fping 5.5
3
4
4
-
> [!IMPORTANT]
5
-
> The JSON output feature is currently in **alpha**. The format is subject to change in future versions.
5
+
> [!IMPORTANT] The JSON output feature is currently in **alpha**. The format is
6
+
> subject to change in future versions.
6
7
7
-
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.
8
+
When using the `--json` (or `-J`) option, fping outputs results as a **stream of
9
+
JSON objects**, separated by newlines. Each line in the output is a valid,
10
+
independent JSON document representing a specific event or statistic.
8
11
9
12
## General Format
10
13
@@ -14,11 +17,14 @@ Every JSON object output by fping follows the following pattern:
Where `type` identifies the type of the object (e.g., `resp`, `summary`) and the inner object contains the fields relevant to that type.
20
+
Where `type` identifies the type of the object (e.g., `resp`, `summary`) and the
21
+
inner object contains the fields relevant to that type.
18
22
19
23
## Forward Compatibility
20
24
21
-
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).
25
+
Any unknown object types and any unknown fields should be ignored for
26
+
forward-compatibility (we might add new objects and fields to objects over
27
+
time).
22
28
23
29
## Example
24
30
@@ -34,17 +40,19 @@ $ fping -J -c3 8.8.8.8
34
40
35
41
## JSON Object Types
36
42
37
-
> [!NOTE]
38
-
> 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.
43
+
> [!NOTE] In the actual output, each JSON object is compacted onto a single
44
+
> line. The examples in this document are formatted across multiple lines for
45
+
> readability.
39
46
40
-
The following top-level keys identify the type of information contained in each JSON object:
47
+
The following top-level keys identify the type of information contained in each
48
+
JSON object:
41
49
42
-
*`resp`: Response to a ping packet.
43
-
*`timeout`: Timeout waiting for a packet response.
44
-
*`summary`: Summary statistics for a host (used with `-c`).
45
-
*`vSum`: Summary of all RTT values for a host (used with `-C`).
46
-
*`globalSum`: Global statistics for the entire run (used with `-s`).
47
-
*`intSum`: Interval summary statistics (used with `-Q`).
50
+
-`resp`: Response to a ping packet.
51
+
-`timeout`: Timeout waiting for a packet response.
52
+
-`summary`: Summary statistics for a host (used with `-c`).
53
+
-`vSum`: Summary of all RTT values for a host (used with `-C`).
54
+
-`globalSum`: Global statistics for the entire run (used with `-s`).
55
+
-`intSum`: Interval summary statistics (used with `-Q`).
48
56
49
57
### `resp`: Response
50
58
@@ -61,16 +69,17 @@ Generated when a ping reply is received.
61
69
}
62
70
```
63
71
64
-
*`host`: Target hostname or IP.
65
-
*`seq`: Sequence number of the packet (0-indexed).
66
-
*`size`: Size of the received packet in bytes.
67
-
*`rtt`: Round-trip time in milliseconds.
72
+
-`host`: Target hostname or IP.
73
+
-`seq`: Sequence number of the packet (0-indexed).
74
+
-`size`: Size of the received packet in bytes.
75
+
-`rtt`: Round-trip time in milliseconds.
68
76
69
77
**Optional Fields:**
70
78
71
-
*`timestamps`: If ICMP timestamp requests are used (`--icmp-timestamp`), contains `originate`, `receive`, `transmit`, and `localreceive` timestamps.
72
-
*`tos`: If `--print-tos` is used, contains the Type of Service value.
73
-
*`ttl`: If `--print-ttl` is used, contains the Time To Live value.
79
+
-`timestamps`: If ICMP timestamp requests are used (`--icmp-timestamp`),
80
+
contains `originate`, `receive`, `transmit`, and `localreceive` timestamps.
81
+
-`tos`: If `--print-tos` is used, contains the Type of Service value.
82
+
-`ttl`: If `--print-ttl` is used, contains the Time To Live value.
74
83
75
84
### `timeout`: Timeout
76
85
@@ -85,8 +94,8 @@ Generated when a packet times out.
85
94
}
86
95
```
87
96
88
-
*`host`: Target hostname or IP.
89
-
*`seq`: Sequence number of the timed-out packet.
97
+
-`host`: Target hostname or IP.
98
+
-`seq`: Sequence number of the timed-out packet.
90
99
91
100
### `summary`: Host Summary
92
101
@@ -107,31 +116,28 @@ Generated at end of execution (or interval) when using `-c` (count mode).
107
116
}
108
117
```
109
118
110
-
*`xmt`: Packets transmitted.
111
-
*`rcv`: Packets received.
112
-
*`loss`: Packet loss percentage.
113
-
*`outage(ms)`: Total outage time in milliseconds (only if `--outage` is used).
114
-
*`rttMin`, `rttAvg`, `rttMax`: Minimum, average, and maximum RTTs.
119
+
-`xmt`: Packets transmitted.
120
+
-`rcv`: Packets received.
121
+
-`loss`: Packet loss percentage.
122
+
-`outage(ms)`: Total outage time in milliseconds (only if `--outage` is used).
123
+
-`rttMin`, `rttAvg`, `rttMax`: Minimum, average, and maximum RTTs.
115
124
116
125
### `vSum`: Full RTT Summary
117
126
118
-
Generated at end of execution when using `-C` (count mode with per-packet RTT reporting).
127
+
Generated at end of execution when using `-C` (count mode with per-packet RTT
128
+
reporting).
119
129
120
130
```json
121
131
{
122
132
"vSum": {
123
133
"host": "127.0.0.1",
124
-
"values": [
125
-
0.054,
126
-
0.062,
127
-
null,
128
-
0.081
129
-
]
134
+
"values": [0.054, 0.062, null, 0.081]
130
135
}
131
136
}
132
137
```
133
138
134
-
*`values`: Array of RTT values (in ms) for each sequence number. `null` indicates a timeout/loss.
139
+
-`values`: Array of RTT values (in ms) for each sequence number. `null`
140
+
indicates a timeout/loss.
135
141
136
142
### `intSum`: Interval Summary
137
143
@@ -152,8 +158,8 @@ Generated periodically when using `-Q` (quiet with interval reporting).
0 commit comments