mirror of
https://github.com/kellyjonbrazil/jc.git
synced 2026-04-03 17:44:07 +02:00
Compare commits
600 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4cd721be85 | ||
|
|
d58ca402a7 | ||
|
|
5386879040 | ||
|
|
f19a1f23a9 | ||
|
|
5023e5be4c | ||
|
|
5527d22459 | ||
|
|
9d567c2e70 | ||
|
|
39c03a15d5 | ||
|
|
5e6d2562f9 | ||
|
|
7009d5a014 | ||
|
|
42f9ddabb9 | ||
|
|
30efb5afc0 | ||
|
|
786dc76c09 | ||
|
|
fc48874a5d | ||
|
|
67164e7b23 | ||
|
|
3db9774ac6 | ||
|
|
03aef93d9a | ||
|
|
9b7e3de3ed | ||
|
|
291b6b061a | ||
|
|
08496533e2 | ||
|
|
f8dceb5046 | ||
|
|
240ed4047f | ||
|
|
0bf6f7cd7c | ||
|
|
313bd86e3e | ||
|
|
56259d5605 | ||
|
|
8a4885c1fe | ||
|
|
5b06f84917 | ||
|
|
37a1428914 | ||
|
|
bff065daf3 | ||
|
|
c60d899f31 | ||
|
|
fb7c390506 | ||
|
|
22afb69573 | ||
|
|
be51304c9c | ||
|
|
44f83d800f | ||
|
|
bf07973d90 | ||
|
|
11e94b686c | ||
|
|
c68bf674a1 | ||
|
|
dbbc310082 | ||
|
|
e861f4a597 | ||
|
|
049e93707c | ||
|
|
164294ecb7 | ||
|
|
22ef489795 | ||
|
|
8f9d650f6c | ||
|
|
7e134a63bd | ||
|
|
9b5c25cb5b | ||
|
|
894946b207 | ||
|
|
92ad2068db | ||
|
|
59662a1500 | ||
|
|
125b88a2ca | ||
|
|
79fce8c769 | ||
|
|
a4a53f8b3b | ||
|
|
743e1ae90f | ||
|
|
dbcff80907 | ||
|
|
6e10965aed | ||
|
|
0c8c4a9c53 | ||
|
|
7632541a1e | ||
|
|
a213ad9a85 | ||
|
|
15ac5a9004 | ||
|
|
0658668eb0 | ||
|
|
ccef69ac37 | ||
|
|
64676fda2e | ||
|
|
6ea2d776ae | ||
|
|
98ced9616c | ||
|
|
ae19183803 | ||
|
|
8536514baf | ||
|
|
81982a9f79 | ||
|
|
1acbb2f096 | ||
|
|
80fb4d40a5 | ||
|
|
c972dd1aac | ||
|
|
9dde65c25c | ||
|
|
7486b0c7cd | ||
|
|
5c7a520a0b | ||
|
|
193ddf71f8 | ||
|
|
c46fe9816c | ||
|
|
aada5f0794 | ||
|
|
5c7bf363a6 | ||
|
|
00b74be540 | ||
|
|
96cb01f57a | ||
|
|
adf5f403ae | ||
|
|
1c09c95c71 | ||
|
|
64f442d743 | ||
|
|
cd8d43446b | ||
|
|
7361eac1a4 | ||
|
|
9d41f0a938 | ||
|
|
00274c15df | ||
|
|
d0b8a91f94 | ||
|
|
098e8dbef6 | ||
|
|
ec29b8bbc6 | ||
|
|
1d8f83b8c6 | ||
|
|
12c4419c6a | ||
|
|
b134c53f33 | ||
|
|
23ff19fdb5 | ||
|
|
7a43ba631b | ||
|
|
2beb26f3e3 | ||
|
|
4b55f49e99 | ||
|
|
c0239a771c | ||
|
|
bc4738e900 | ||
|
|
1c76caf59b | ||
|
|
0679951d4a | ||
|
|
df7aee9e4b | ||
|
|
a8d97a2521 | ||
|
|
9370b336d8 | ||
|
|
118f98222a | ||
|
|
dc997821f4 | ||
|
|
aef0fdb435 | ||
|
|
21ee3c0e78 | ||
|
|
d6c665f74b | ||
|
|
79305a50d0 | ||
|
|
e758aa41ef | ||
|
|
910cb34b09 | ||
|
|
976fea4eb2 | ||
|
|
81447ec9e6 | ||
|
|
61b8e9f7b5 | ||
|
|
8e86a04448 | ||
|
|
f23715a783 | ||
|
|
fa693a8bb1 | ||
|
|
103168c25b | ||
|
|
ae7ed4eec5 | ||
|
|
caa516db72 | ||
|
|
f05c3d6113 | ||
|
|
5d872b1535 | ||
|
|
1559cd9f5c | ||
|
|
a5a87c7da1 | ||
|
|
0e6cec62c1 | ||
|
|
3bb1d89165 | ||
|
|
f5f5f102fb | ||
|
|
0c82fe7e4d | ||
|
|
13ffe8a84d | ||
|
|
4c6eebaa33 | ||
|
|
f8fbb2dce2 | ||
|
|
dbfe682674 | ||
|
|
2a148d44a1 | ||
|
|
0648d2e9e3 | ||
|
|
ac9128fa0c | ||
|
|
4d7a872670 | ||
|
|
07f716b254 | ||
|
|
b0d6a7307c | ||
|
|
53ad793ff8 | ||
|
|
ea4332d8e4 | ||
|
|
5c5ff9324f | ||
|
|
2ab6352fdb | ||
|
|
56dcbaf40c | ||
|
|
029b5abcac | ||
|
|
32521ac91a | ||
|
|
bf88407902 | ||
|
|
63cf47db63 | ||
|
|
9970866b3b | ||
|
|
d61941b276 | ||
|
|
081fdb8026 | ||
|
|
f64dfbf79d | ||
|
|
5fb73f4ad5 | ||
|
|
1c16d32420 | ||
|
|
e367e0d714 | ||
|
|
4046649e32 | ||
|
|
77fcfe439c | ||
|
|
71d1355419 | ||
|
|
d1b270f336 | ||
|
|
9190a08332 | ||
|
|
3fae50e305 | ||
|
|
3582497ed4 | ||
|
|
19a67daabf | ||
|
|
02a7e5fd8a | ||
|
|
df72b16022 | ||
|
|
61bdc13810 | ||
|
|
1350a34316 | ||
|
|
7cfe68b96a | ||
|
|
7a93a61f54 | ||
|
|
362977e598 | ||
|
|
5cac897beb | ||
|
|
cad94cc6b3 | ||
|
|
fe4e429e85 | ||
|
|
d83b10e2d5 | ||
|
|
bd2a757fcd | ||
|
|
358b69a4cb | ||
|
|
08821a1454 | ||
|
|
90277c1d87 | ||
|
|
a51e702f77 | ||
|
|
466e37128b | ||
|
|
f1ea61388f | ||
|
|
72c11fda3a | ||
|
|
d6645983ef | ||
|
|
01e911ecdb | ||
|
|
12c0b3d889 | ||
|
|
c1075e40b7 | ||
|
|
fabe3f01b7 | ||
|
|
3a2ff61899 | ||
|
|
aeff94d272 | ||
|
|
c94f5d83fa | ||
|
|
b0756fa0f9 | ||
|
|
6c85abd57b | ||
|
|
7659ae94bd | ||
|
|
e306e81e43 | ||
|
|
6d5768b26b | ||
|
|
cee9f8bf32 | ||
|
|
b8e2678c01 | ||
|
|
b0fe96ed03 | ||
|
|
bb65ec380b | ||
|
|
ae6248227b | ||
|
|
36ce3c791d | ||
|
|
5d639db5a8 | ||
|
|
63161ffdbb | ||
|
|
cf11c71831 | ||
|
|
048f8c1f4b | ||
|
|
b6b42d9071 | ||
|
|
d43863ee9f | ||
|
|
177d10577f | ||
|
|
47d8e163de | ||
|
|
e49c621e59 | ||
|
|
5e32a6d828 | ||
|
|
b1358a7eca | ||
|
|
ba89092e12 | ||
|
|
f855420a82 | ||
|
|
1589a81945 | ||
|
|
eec2583cb2 | ||
|
|
481c6a8de2 | ||
|
|
68717e8493 | ||
|
|
c524d37136 | ||
|
|
6674f549f2 | ||
|
|
ba371ec730 | ||
|
|
44d1d52426 | ||
|
|
edcca4fb96 | ||
|
|
6fbf9458d1 | ||
|
|
a476e4639b | ||
|
|
5534a1c755 | ||
|
|
c45518db70 | ||
|
|
55480c059a | ||
|
|
04a2af8681 | ||
|
|
71f672a0e0 | ||
|
|
33c40874fa | ||
|
|
b3ced64672 | ||
|
|
a60bf00d54 | ||
|
|
8d9a2744af | ||
|
|
bcd7bac950 | ||
|
|
e996b3a9f6 | ||
|
|
e207cccdc5 | ||
|
|
9776dd1082 | ||
|
|
bcff00799f | ||
|
|
0dc76621bc | ||
|
|
1040c5706f | ||
|
|
265d08e3bd | ||
|
|
491fce7052 | ||
|
|
3404bc4840 | ||
|
|
064e3f6ac0 | ||
|
|
71f0c4f9da | ||
|
|
18143608dc | ||
|
|
83a6d92449 | ||
|
|
ac1f690c54 | ||
|
|
b063f1bfb4 | ||
|
|
4c5caa7b86 | ||
|
|
85edda6e5f | ||
|
|
6e1a4a103c | ||
|
|
2879c084e5 | ||
|
|
4ecc94e531 | ||
|
|
b8ef583b93 | ||
|
|
fd61e19135 | ||
|
|
79011465af | ||
|
|
27acedf8b7 | ||
|
|
532c37140c | ||
|
|
7f4a951065 | ||
|
|
b9fb7fad9c | ||
|
|
be85d78f55 | ||
|
|
23e02090e0 | ||
|
|
50f2a811ad | ||
|
|
28ee448c44 | ||
|
|
688a2099b5 | ||
|
|
6f0a53ed02 | ||
|
|
8a14de663e | ||
|
|
09344e938a | ||
|
|
bf41140322 | ||
|
|
689a85db9b | ||
|
|
5e0d206e7a | ||
|
|
61addd7950 | ||
|
|
60bb9e2aa9 | ||
|
|
842fbbab64 | ||
|
|
bbd227caf4 | ||
|
|
975b4f5e4f | ||
|
|
06840931ba | ||
|
|
9f4327f517 | ||
|
|
3f13c70dfa | ||
|
|
26f8803b23 | ||
|
|
60f1e79b2f | ||
|
|
5ab2ebe45a | ||
|
|
9c8fe80d6d | ||
|
|
1e7e22330f | ||
|
|
7244868fbd | ||
|
|
86ed39ecdd | ||
|
|
94d87b726f | ||
|
|
0984a1ec26 | ||
|
|
de5da060ce | ||
|
|
592435572c | ||
|
|
3172a18a46 | ||
|
|
7f1c57b89c | ||
|
|
39555a48b5 | ||
|
|
e4cdfa13ca | ||
|
|
cb4011bc03 | ||
|
|
299b0faf7c | ||
|
|
2ffd698c03 | ||
|
|
dde54690fc | ||
|
|
8d03055b34 | ||
|
|
8a850be857 | ||
|
|
2a530712cf | ||
|
|
fd22c7dc3a | ||
|
|
b884f6aacc | ||
|
|
ce680d4082 | ||
|
|
644d3f350d | ||
|
|
0144863d33 | ||
|
|
a6b56519a2 | ||
|
|
0a71caf9cd | ||
|
|
35e74328c4 | ||
|
|
e46ac0ff7e | ||
|
|
17fe6c7691 | ||
|
|
01ca7a69c4 | ||
|
|
6d04db6113 | ||
|
|
7c899abb15 | ||
|
|
89d4df2a05 | ||
|
|
71c8364f80 | ||
|
|
214cd6b9e0 | ||
|
|
73c280de3a | ||
|
|
23e1dd3e35 | ||
|
|
2b060aae0d | ||
|
|
186ad73651 | ||
|
|
de7a010f62 | ||
|
|
ac1bcd2918 | ||
|
|
a2e6243282 | ||
|
|
01f92ced81 | ||
|
|
b493bcf4fa | ||
|
|
f6ee30be20 | ||
|
|
50da124ea7 | ||
|
|
5e22f9e2bd | ||
|
|
a384eb4c15 | ||
|
|
dc4620eeb2 | ||
|
|
d7cfa38eee | ||
|
|
a27110ebe5 | ||
|
|
f5988527fb | ||
|
|
c405309742 | ||
|
|
747d12224f | ||
|
|
2b621ab68e | ||
|
|
8689865d31 | ||
|
|
358324533d | ||
|
|
bc5821e69f | ||
|
|
d5b478c968 | ||
|
|
368eba1826 | ||
|
|
6cffb449f4 | ||
|
|
d79d9c7f13 | ||
|
|
179822b994 | ||
|
|
ba369a0b73 | ||
|
|
6a5251f0ef | ||
|
|
004fd74748 | ||
|
|
e8d6d4c080 | ||
|
|
8644f70db4 | ||
|
|
72f233b186 | ||
|
|
fc85950a73 | ||
|
|
fd5cbbb4d5 | ||
|
|
888b6bd6d5 | ||
|
|
81ea83064c | ||
|
|
45859b01e5 | ||
|
|
5b8f166169 | ||
|
|
7e045ba7b0 | ||
|
|
6247975ee6 | ||
|
|
297451230c | ||
|
|
754d555768 | ||
|
|
b61a91f82d | ||
|
|
1ac7a724bd | ||
|
|
2fcf46505c | ||
|
|
fdec4f08c0 | ||
|
|
076c197385 | ||
|
|
3432e830f2 | ||
|
|
14a237749c | ||
|
|
1559c4751e | ||
|
|
af7c4ce8ec | ||
|
|
5763ce6160 | ||
|
|
d7ca6caae8 | ||
|
|
2c4f232aaa | ||
|
|
bddfa71fa6 | ||
|
|
f537ab058b | ||
|
|
1b44b5b05a | ||
|
|
f6e971c652 | ||
|
|
dfa7a71f53 | ||
|
|
3639e02843 | ||
|
|
27b6e79c8a | ||
|
|
f370151b54 | ||
|
|
597a8f468e | ||
|
|
8bd7a00410 | ||
|
|
4867052972 | ||
|
|
688c3a34f6 | ||
|
|
e357b27433 | ||
|
|
dd70bf92f3 | ||
|
|
0a97523928 | ||
|
|
f67bd02283 | ||
|
|
ef1055a9b6 | ||
|
|
cd970b5871 | ||
|
|
11b0863a65 | ||
|
|
5b8cb497de | ||
|
|
38e2addbb6 | ||
|
|
58158ce8b1 | ||
|
|
5ca281f02e | ||
|
|
ac39ce6b98 | ||
|
|
38fb0a6828 | ||
|
|
38c41cfaf4 | ||
|
|
95ba628ac3 | ||
|
|
a53f2ecbaf | ||
|
|
aa1ff55bbe | ||
|
|
097d013447 | ||
|
|
3916623c46 | ||
|
|
42c50c5fa1 | ||
|
|
ea515bbecc | ||
|
|
9f8006060b | ||
|
|
6cd51c4426 | ||
|
|
b1e96bb50c | ||
|
|
50d3bda3b7 | ||
|
|
3dfa4a1bbc | ||
|
|
d1922acfc8 | ||
|
|
3947e424e7 | ||
|
|
25e202a09e | ||
|
|
8eab3c1590 | ||
|
|
4f294aa0ef | ||
|
|
81aa09a2e2 | ||
|
|
10fc8cb48d | ||
|
|
186f0708cc | ||
|
|
622b3ff9ed | ||
|
|
c06963c3d6 | ||
|
|
9009313748 | ||
|
|
d55a8c3079 | ||
|
|
fee6a61f19 | ||
|
|
6f1ef09d2a | ||
|
|
cf6c13e605 | ||
|
|
028f55910a | ||
|
|
d7684d39a8 | ||
|
|
f652ccd4b1 | ||
|
|
6be92498bc | ||
|
|
677e04ab7d | ||
|
|
46fdc457fc | ||
|
|
0306b6b73b | ||
|
|
c881653d55 | ||
|
|
7650d831e3 | ||
|
|
e7a8cc3b8b | ||
|
|
d173b2f237 | ||
|
|
49ba6ed0f2 | ||
|
|
2792d05c7f | ||
|
|
cacda0f3cc | ||
|
|
c420547ff8 | ||
|
|
83d388613f | ||
|
|
094b059aea | ||
|
|
e36a8c627b | ||
|
|
d341e91290 | ||
|
|
557afc95bd | ||
|
|
cb9979ac94 | ||
|
|
5486957141 | ||
|
|
d49155df95 | ||
|
|
0dd4b5f620 | ||
|
|
690603bfda | ||
|
|
b877cc9509 | ||
|
|
32fddce8fb | ||
|
|
03a2b35846 | ||
|
|
086cdc559c | ||
|
|
97eefe28f1 | ||
|
|
32019c99f4 | ||
|
|
f30e15159f | ||
|
|
efd0bae0d6 | ||
|
|
253aa03e07 | ||
|
|
32183118de | ||
|
|
6c8ad1139c | ||
|
|
980c2907ad | ||
|
|
00129f4b40 | ||
|
|
f178bea0d0 | ||
|
|
c583598257 | ||
|
|
1e14425555 | ||
|
|
4a103927cd | ||
|
|
ab3dc41358 | ||
|
|
c9fcd3d203 | ||
|
|
5186347b48 | ||
|
|
e4a40704b5 | ||
|
|
fcfbbc6d84 | ||
|
|
95a38c7712 | ||
|
|
be0f4477bf | ||
|
|
3ebd897601 | ||
|
|
c60e1e8d7f | ||
|
|
eb205562bf | ||
|
|
83a50bb610 | ||
|
|
331171b826 | ||
|
|
1d9965dad6 | ||
|
|
647820c75e | ||
|
|
d9c7dde174 | ||
|
|
ef8c688fa1 | ||
|
|
b0f0d02e75 | ||
|
|
51bc2674bd | ||
|
|
5fc2008517 | ||
|
|
611e5c7ea2 | ||
|
|
74c8b0678a | ||
|
|
00afd79858 | ||
|
|
45fae976f0 | ||
|
|
ae9c1746f1 | ||
|
|
fa1699298b | ||
|
|
c8720b259c | ||
|
|
113a90a5a0 | ||
|
|
7c0e43b2e1 | ||
|
|
d51df73f37 | ||
|
|
8da203648b | ||
|
|
12cc670fa0 | ||
|
|
88222edb7f | ||
|
|
7ca0a511d5 | ||
|
|
02e08403e3 | ||
|
|
e29262b95a | ||
|
|
c449914936 | ||
|
|
9c290b5e11 | ||
|
|
2d9dcde0e3 | ||
|
|
da681a463e | ||
|
|
aeb494703e | ||
|
|
da4e3670b1 | ||
|
|
075e2301e4 | ||
|
|
df3f94b017 | ||
|
|
3df006fb97 | ||
|
|
52d98a1157 | ||
|
|
7c772d3a5a | ||
|
|
a583ecba7b | ||
|
|
76e7347ecf | ||
|
|
e49e6ad179 | ||
|
|
859bece921 | ||
|
|
8ffde41fa4 | ||
|
|
c88bf3e94b | ||
|
|
e623ceacc8 | ||
|
|
92a044ba9b | ||
|
|
906eeefa52 | ||
|
|
e5913cd10d | ||
|
|
52d252f199 | ||
|
|
28425cc493 | ||
|
|
a0ae19a8fd | ||
|
|
0bebb312dd | ||
|
|
0e35e85753 | ||
|
|
bc816bb858 | ||
|
|
e171861629 | ||
|
|
8f539af4ab | ||
|
|
122a4d8f32 | ||
|
|
8bd935791e | ||
|
|
edbae09a17 | ||
|
|
d115d43559 | ||
|
|
bdb218cb0f | ||
|
|
e4e07b76ec | ||
|
|
fd28fea3b6 | ||
|
|
d3c1a73ced | ||
|
|
c4de1c53b9 | ||
|
|
860167b950 | ||
|
|
4ebde3af5f | ||
|
|
ab5e9a46b4 | ||
|
|
c348fa89a9 | ||
|
|
140dc656a2 | ||
|
|
2cad23a7f3 | ||
|
|
9e5c3ae6fb | ||
|
|
ab33836637 | ||
|
|
cb684fa6de | ||
|
|
de6307dc38 | ||
|
|
da51b2b5a0 | ||
|
|
03f0984e1d | ||
|
|
e1f6007dea | ||
|
|
0508256d28 | ||
|
|
993fcd989b | ||
|
|
65d647bc0a | ||
|
|
23d5204634 | ||
|
|
8a239b8f9c | ||
|
|
0a89652ae5 | ||
|
|
6d6054d1dc | ||
|
|
bc9cdadfb0 | ||
|
|
cfe98506a5 | ||
|
|
c4c159f056 | ||
|
|
4d761d7e8a | ||
|
|
c1f36f7455 | ||
|
|
c976c3226d | ||
|
|
cc6287c124 | ||
|
|
966fe97759 | ||
|
|
1f2fe65185 | ||
|
|
b83cd24d57 | ||
|
|
5b4e4fd943 | ||
|
|
61cd9acaa2 | ||
|
|
d2895928bd | ||
|
|
5c354b02ea | ||
|
|
a764642a85 | ||
|
|
a9b0fe6728 | ||
|
|
79ade2c182 | ||
|
|
146dc070ea | ||
|
|
c1b2bae333 | ||
|
|
e771b36a18 | ||
|
|
edcb2280cc | ||
|
|
a249ca1da3 | ||
|
|
f1383b5c66 | ||
|
|
00e497828e | ||
|
|
5968eb697e | ||
|
|
ea78b389c9 | ||
|
|
0b726f7acc | ||
|
|
4d4b95c995 | ||
|
|
fc06d195ec | ||
|
|
c7fc2e3b92 | ||
|
|
980fc77812 | ||
|
|
75dc1722da | ||
|
|
9326f1f0da | ||
|
|
ac831444ce | ||
|
|
4746cb3814 | ||
|
|
6c38a3bbaa | ||
|
|
9699a184d1 | ||
|
|
51eb2c9fa8 | ||
|
|
abf6ea1fec |
8
.github/workflows/pythonapp.yml
vendored
8
.github/workflows/pythonapp.yml
vendored
@@ -13,11 +13,11 @@ jobs:
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
matrix:
|
||||
os: [macos-latest, ubuntu-latest, windows-latest]
|
||||
python-version: ["3.7", "3.8", "3.9", "3.10"]
|
||||
os: [macos-latest, ubuntu-20.04, windows-latest]
|
||||
python-version: ["3.6", "3.7", "3.8", "3.9", "3.10", "3.11"]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
- name: "Set up timezone to America/Los_Angeles"
|
||||
uses: szenius/set-timezone@v1.0
|
||||
with:
|
||||
@@ -25,7 +25,7 @@ jobs:
|
||||
timezoneMacos: "America/Los_Angeles"
|
||||
timezoneWindows: "Pacific Standard Time"
|
||||
- name: Set up Python ${{ matrix.python-version }}
|
||||
uses: actions/setup-python@v1
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
- name: Install dependencies
|
||||
|
||||
201
CHANGELOG
201
CHANGELOG
@@ -1,5 +1,204 @@
|
||||
jc changelog
|
||||
|
||||
20230730 v1.23.4
|
||||
- Add `/etc/resolve.conf` file parser
|
||||
- Add `/proc/net/tcp` and `/proc/net/tcp6` file parser
|
||||
- Add `find` command parser
|
||||
- Add `ip route` command parser
|
||||
- Fix `certbot` command parser to be more robust with different line endings
|
||||
|
||||
20230621 v1.23.3
|
||||
- Add `lsattr` command parser
|
||||
- Add `srt` file parser
|
||||
- Add `veracrypt` command parser
|
||||
- Add X509 Certificate Request file parser
|
||||
- Enhance X509 Certificate parser to allow non-compliant email addresses with a warning
|
||||
- Enhance `dig` command parser to support the `+nsid` option
|
||||
- Enhance `last` and `lastb` command parser to support the `-x` option
|
||||
- Enhance `route` command parser to add Windows support
|
||||
- Enhnace `netstat` command parser to add Windows support
|
||||
- Enhance `ss` command parser to support extended options
|
||||
- Enhance the compatibility warning message
|
||||
- Fix `bluetoothctl` command parser for some mouse devices
|
||||
- Fix `ping` command parsers for output with missing hostname
|
||||
- Fix `stat` command parser for older versions that may not contain all fields
|
||||
- Fix deprecated option in `setup.cfg`
|
||||
|
||||
20230429 v1.23.2
|
||||
- Add `bluetoothctl` command parser
|
||||
- Add `certbot` command parser for `certificates` and `show_account` options
|
||||
- Fix `acpi` command parser for "Not charging" battery status lines
|
||||
- Fix `iwconfig` command parser for SSIDs with dashes in the name
|
||||
- Fix `crontab` command parsers for incorrect variable parsing in some cases
|
||||
- Fix `git-log` and `git-log-s` command parsers for incorrect insertion/deletion parsing
|
||||
- Fix `ufw-appinfo` command parser for parsing errors on multiline description fields
|
||||
- Fix pytest warnings
|
||||
|
||||
20230323 v1.23.1
|
||||
- Fix `zpool-status` command parser for lines that start with tab
|
||||
- Fix `timedatectl` command parser when RTC set to local
|
||||
- Fix to ensure `py.typed` file is included in the package wheel
|
||||
- Fix `lsusb` command parser to support CDC MBIM and CDC MBIM Extended fields
|
||||
- Add support for the `timesync-status` for the `timedatectl` command parser
|
||||
- Fix to ignore non-parser-plugins in the parser plugin directory
|
||||
|
||||
20230227 v1.23.0
|
||||
- Add input slicing as a `jc` command-line option
|
||||
- Add `ssh` configuration file parser
|
||||
- Add `ver` Version string parser
|
||||
- Add `zpool iostat` command parser
|
||||
- Add `zpool status` command parser
|
||||
- Fix `acpi` command parser for "will never fully discharge" battery state
|
||||
- Fix `crontab` and `crontab-u` command and file parsers for cases where only
|
||||
shortcut schedule items exist
|
||||
- Fix `ifconfig` command parser for older-style linux output
|
||||
- Fix `xrandr` command parser for proper `is_current` output
|
||||
- Fix `xrandr` command parser for infinite loop with some device configurations
|
||||
- Add `reflection` key to `xrandr` parser schema
|
||||
- Add display model info from EDID to `xrandr` parser
|
||||
- Add `MPX-specific VMA` support for VM Flags in `/proc/<pid>/smaps` parser
|
||||
|
||||
20230111 v1.22.5
|
||||
- Add TOML file parser
|
||||
- Add INI with duplicate key support file parser
|
||||
- Add AIX support for the `arp` command parser
|
||||
- Add AIX support for the `mount` command parser
|
||||
- Fix `lsusb` command parser when extra hub port status information is output
|
||||
- Refactor `lsusb` command parser for more code reuse
|
||||
- Fix INI file parser to include top-level values with no section header
|
||||
- Fix INI file parser to not specially handle the [DEFAULT] section
|
||||
- Fix INI file and Key/Value parsers to only remove one quotation mark from the
|
||||
beginning and end of values.
|
||||
- Update copyright dates
|
||||
|
||||
20221230 v1.22.4
|
||||
- Add `iwconfig` command parser
|
||||
- Add NeXTSTEP format support to the PLIST file parser
|
||||
- Fix `proc` parser magic signature detection for `/proc/pid/stat` hacks
|
||||
- Fix `x509-cert` parser for string serial numbers
|
||||
- Add category tags to parser metadata: generic, standard, file, string, binary, command
|
||||
- Add "list parsers by category" view to help
|
||||
- Fix python 3.6-related issues
|
||||
- Add python 3.6 to automated tests
|
||||
|
||||
20221216 v1.22.3
|
||||
- Add Common Log Format and Combined Log Format file parser (standard and streaming)
|
||||
- Add PostgreSQL password file parser
|
||||
- Add openvpn-status.log file parser
|
||||
- Add `cbt` command parser (Google Big Table)
|
||||
- Enhance `ifconfig` parser with interface lane information on BSD
|
||||
- Enhance `ifconfig` parser with additional IPv6 `scope_id` info for BSD
|
||||
- Fix `ifconfig` parser to capture some IPv6 addresses missed on BSD
|
||||
- Fix `git-log` and `git-log-s` parsers for failure on empty author name
|
||||
- Update `os-prober` parser with split EFI partition fields
|
||||
- Add ISO string attribute (`.iso`) to `jc.utils.timestamp()`
|
||||
- Fix several documentation typos
|
||||
|
||||
20221107 v1.22.2
|
||||
- add `sshd_conf` parser for `sshd` configuration files and `sshd -T` output
|
||||
- add `findmnt` command parser
|
||||
- add `git ls-remote` command parser
|
||||
- add `os-prober` command parser
|
||||
- add SemVer string parser
|
||||
- enhance the `ifconfig` parser so it can output multiple IPv4 and IPv6 addresses
|
||||
- enhance the `ifconfig` parser so it can output additional fields common on BSD
|
||||
- enhance `xml` parser with optional `_` prefix for attributes instead of
|
||||
`@` by using the `--raw` option. This can make it easier to filter the
|
||||
JSON output in some tools.
|
||||
- fix the `xml` parser to output a normal Dictionary instead of OrderdDict.
|
||||
This cleans up YAML output. (No `!!omap` comments)
|
||||
- fix `csv` and `csv-s` parsers for UTF-8 encoded CSV files with leading BOM bytes
|
||||
- fix exit code to be non-zero on interrupt
|
||||
- allow parser module objects to be used as arguments to `jc.get_help()` and `jc.parser_info()`
|
||||
- catch unexpected exceptions in the CLI
|
||||
- add error message on interrupt to STDERR
|
||||
- add python 3.11 tests to github actions
|
||||
|
||||
20221024 v1.22.1
|
||||
- add `udevadm` command parser
|
||||
- add `lspci` command parser
|
||||
- add `pci.ids` file parser
|
||||
- fix `proc-pid-stat` parser for command names with spaces and newlines
|
||||
- enhance `ip-address` parser to add `ip_split` field
|
||||
- rename `iso-datetime` parser to `datetime-iso`. A deprecation warning will
|
||||
display until `iso-datetime` is removed in a future version.
|
||||
- refactor cli module
|
||||
- optimize performance of calculated timestamps
|
||||
- add more type annotations
|
||||
- add support for deprecating parsers
|
||||
- move jc-web demo site from heroku to render.com
|
||||
|
||||
20220926 v1.22.0
|
||||
- Add /proc file parsers for linux. Support for the following files:
|
||||
`/proc/buddyinfo`
|
||||
`/proc/consoles`
|
||||
`/proc/cpuinfo`
|
||||
`/proc/crypto`
|
||||
`/proc/devices`
|
||||
`/proc/diskstats`
|
||||
`/proc/filesystems`
|
||||
`/proc/interrupts`
|
||||
`/proc/iomem`
|
||||
`/proc/ioports`
|
||||
`/proc/loadavg`
|
||||
`/proc/locks`
|
||||
`/proc/meminfo`
|
||||
`/proc/modules`
|
||||
`/proc/mtrr`
|
||||
`/proc/pagetypeinfo`
|
||||
`/proc/partitions`
|
||||
`/proc/slabinfo`
|
||||
`/proc/softirqs`
|
||||
`/proc/stat`
|
||||
`/proc/swaps`
|
||||
`/proc/uptime`
|
||||
`/proc/version`
|
||||
`/proc/vmallocinfo`
|
||||
`/proc/vmstat`
|
||||
`/proc/zoneinfo`
|
||||
`/proc/driver/rtc`
|
||||
`/proc/net/arp`
|
||||
`/proc/net/dev`
|
||||
`/proc/net/dev_mcast`
|
||||
`/proc/net/if_inet6`
|
||||
`/proc/net/igmp`
|
||||
`/proc/net/igmp6`
|
||||
`/proc/net/ipv6_route`
|
||||
`/proc/net/netlink`
|
||||
`/proc/net/netstat`
|
||||
`/proc/net/packet`
|
||||
`/proc/net/protocols`
|
||||
`/proc/net/route`
|
||||
`/proc/net/unix`
|
||||
`/proc/<pid>/fdinfo/<fd>`
|
||||
`/proc/<pid>/io`
|
||||
`/proc/<pid>/maps`
|
||||
`/proc/<pid>/mountinfo`
|
||||
`/proc/<pid>/numa_maps`
|
||||
`/proc/<pid>/smaps`
|
||||
`/proc/<pid>/stat`
|
||||
`/proc/<pid>/statm`
|
||||
`/proc/<pid>/status`
|
||||
- Magic syntax support for `/proc` files
|
||||
- Enhance bash and zsh autocompletions for `/proc` files
|
||||
- Enhance `free` parser to support `-w` option integer conversions
|
||||
- Fix `ini` and `kv` parsers so they don't change keynames to lower case
|
||||
NOTE: This can be a breaking change in your scripts
|
||||
- Fix `id` command parser to allow usernames and groupnames with spaces
|
||||
- Enhance metadata output to output metadata even when results are empty
|
||||
- Optimize tests
|
||||
- Optimize documentation build script
|
||||
|
||||
20220829 v1.21.2
|
||||
- Fix IP Address string parser for older python versions that don't cleanly
|
||||
accept decimal input format - IPv6 fix (e.g. python 3.6)
|
||||
|
||||
20220828 v1.21.1
|
||||
- Fix IP Address string parser for older python versions that don't cleanly
|
||||
accept decimal input format - IPv4 fix (e.g. python 3.6)
|
||||
- Fix `arp -a` parser for cases where incomplete hardware addresses are found
|
||||
in the arp table on linux
|
||||
|
||||
20220821 v1.21.0
|
||||
- Add IP Address string parser
|
||||
- Add Syslog standard and streaming string parsers (RFC 3164 and RFC 5424)
|
||||
@@ -476,7 +675,7 @@ jc changelog
|
||||
|
||||
20200211 v1.7.3
|
||||
- Add alternative 'magic' syntax: e.g. `jc ls -al`
|
||||
- Options can now be condensed (e.g. -prq is equivalant to -p -r -q)
|
||||
- Options can now be condensed (e.g. -prq is equivalent to -p -r -q)
|
||||
|
||||
20200208 v1.7.2
|
||||
- Include test fixtures in wheel and sdist
|
||||
|
||||
79
EXAMPLES.md
79
EXAMPLES.md
@@ -1636,21 +1636,21 @@ cat example.ini | jc --ini -p
|
||||
```
|
||||
```json
|
||||
{
|
||||
"DEFAULT": {
|
||||
"ServerAliveInterval": "45",
|
||||
"Compression": "yes",
|
||||
"CompressionLevel": "9",
|
||||
"ForwardX11": "yes"
|
||||
},
|
||||
"bitbucket.org": {
|
||||
"serveraliveinterval": "45",
|
||||
"compression": "yes",
|
||||
"compressionlevel": "9",
|
||||
"forwardx11": "yes",
|
||||
"user": "hg"
|
||||
"User": "hg"
|
||||
},
|
||||
"topsecret.server.com": {
|
||||
"serveraliveinterval": "45",
|
||||
"compression": "yes",
|
||||
"compressionlevel": "9",
|
||||
"forwardx11": "no",
|
||||
"port": "50022"
|
||||
"Port": "50022",
|
||||
"ForwardX11": "no"
|
||||
}
|
||||
}
|
||||
|
||||
```
|
||||
### iostat
|
||||
```bash
|
||||
@@ -1707,6 +1707,12 @@ echo 192.168.2.10/24 | jc --ip-address -p
|
||||
"ip": "192.168.2.10",
|
||||
"ip_compressed": "192.168.2.10",
|
||||
"ip_exploded": "192.168.2.10",
|
||||
"ip_split": [
|
||||
"192",
|
||||
"168",
|
||||
"2",
|
||||
"10"
|
||||
],
|
||||
"scope_id": null,
|
||||
"ipv4_mapped": null,
|
||||
"six_to_four": null,
|
||||
@@ -1819,7 +1825,7 @@ iptables --line-numbers -v -L -t nat | jc --iptables -p # or: jc -p ip
|
||||
```
|
||||
### ISO Datetime string
|
||||
```bash
|
||||
echo "2022-07-20T14:52:45Z" | jc --iso-datetime -p
|
||||
echo "2022-07-20T14:52:45Z" | jc --datetime-iso -p
|
||||
```
|
||||
```json
|
||||
{
|
||||
@@ -4545,6 +4551,57 @@ cat entrust.pem | jc --x509-cert -p
|
||||
}
|
||||
]
|
||||
```
|
||||
### X.509 PEM and DER certificate request files
|
||||
```bash
|
||||
cat myserver.csr | jc --x509-csr -p
|
||||
```
|
||||
```json
|
||||
[
|
||||
{
|
||||
"certification_request_info": {
|
||||
"version": "v1",
|
||||
"subject": {
|
||||
"common_name": "myserver.for.example"
|
||||
},
|
||||
"subject_pk_info": {
|
||||
"algorithm": {
|
||||
"algorithm": "ec",
|
||||
"parameters": "secp256r1"
|
||||
},
|
||||
"public_key": "04:40:33:c0:91:8f:e9:46:ea:d0:dc:d0:f9:63:2c:a4:35:1f:0f:54:c8:a9:9b:e3:9e:d4:f3:64:b8:60:cc:7f:39:75:dd:a7:61:31:02:7c:9e:89:c6:db:45:15:f2:5f:b0:65:29:0b:42:d2:6e:c2:ea:a6:23:bd:fc:65:e5:7d:4e"
|
||||
},
|
||||
"attributes": [
|
||||
{
|
||||
"type": "extension_request",
|
||||
"values": [
|
||||
[
|
||||
{
|
||||
"extn_id": "extended_key_usage",
|
||||
"critical": false,
|
||||
"extn_value": [
|
||||
"server_auth"
|
||||
]
|
||||
},
|
||||
{
|
||||
"extn_id": "subject_alt_name",
|
||||
"critical": false,
|
||||
"extn_value": [
|
||||
"myserver.for.example"
|
||||
]
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"signature_algorithm": {
|
||||
"algorithm": "sha384_ecdsa",
|
||||
"parameters": null
|
||||
},
|
||||
"signature": "30:45:02:20:77:ac:5b:51:bf:c5:f5:43:02:52:ae:66:8a:fe:95:98:98:98:a9:45:34:31:08:ff:2c:cc:92:d9:1c:70:28:74:02:21:00:97:79:7b:e7:45:18:76:cf:d7:3b:79:34:56:d2:69:b5:73:41:9b:8a:b7:ad:ec:80:23:c1:2f:64:da:e5:28:19"
|
||||
}
|
||||
]
|
||||
```
|
||||
### XML files
|
||||
```bash
|
||||
cat cd_catalog.xml
|
||||
|
||||
@@ -1,2 +1,3 @@
|
||||
include jc/py.typed
|
||||
include man/jc.1
|
||||
include CHANGELOG
|
||||
|
||||
470
README.md
470
README.md
@@ -3,13 +3,15 @@
|
||||
|
||||
> Check out the `jc` Python [package documentation](https://github.com/kellyjonbrazil/jc/tree/master/docs) for developers
|
||||
|
||||
> Try the `jc` [web demo](https://jc-web-demo.herokuapp.com/)
|
||||
> Try the `jc` [web demo](https://jc-web.onrender.com/) and [REST API](https://github.com/kellyjonbrazil/jc-restapi)
|
||||
|
||||
> JC is [now available](https://galaxy.ansible.com/community/general) as an
|
||||
> `jc` is [now available](https://galaxy.ansible.com/community/general) as an
|
||||
Ansible filter plugin in the `community.general` collection. See this
|
||||
[blog post](https://blog.kellybrazil.com/2020/08/30/parsing-command-output-in-ansible-with-jc/)
|
||||
for an example.
|
||||
|
||||
> Looking for something like `jc` but lower-level? Check out [regex2json](https://gitlab.com/tozd/regex2json).
|
||||
|
||||
# JC
|
||||
JSON Convert
|
||||
|
||||
@@ -44,8 +46,8 @@ $ jc dig example.com | jq -r '.[].answer[].data'
|
||||
93.184.216.34
|
||||
```
|
||||
|
||||
`jc` can also be used as a python library. In this case the output will be
|
||||
a python dictionary, a list of dictionaries, or even a
|
||||
`jc` can also be used as a python library. In this case the returned value
|
||||
will be a python dictionary, a list of dictionaries, or even a
|
||||
[lazy iterable of dictionaries](#using-streaming-parsers-as-python-modules)
|
||||
instead of JSON:
|
||||
```python
|
||||
@@ -70,7 +72,7 @@ values are converted, and, in some cases, additional semantic context fields are
|
||||
added.
|
||||
|
||||
To access the raw, pre-processed JSON, use the `-r` cli option or the `raw=True`
|
||||
function parameter in `parse()`.
|
||||
function parameter in `parse()` when using `jc` as a python library.
|
||||
|
||||
Schemas for each parser can be found at the documentation link beside each
|
||||
[**Parser**](#parsers) below.
|
||||
@@ -114,7 +116,7 @@ pip3 install jc
|
||||
| Debian/Ubuntu linux | `apt-get install jc` |
|
||||
| Fedora linux | `dnf install jc` |
|
||||
| openSUSE linux | `zypper install jc` |
|
||||
| Archlinux Community Repository | `paru -S jc` or `aura -S jc` or `yay -S jc` |
|
||||
| Arch linux | `pacman -S jc` |
|
||||
| NixOS linux | `nix-env -iA nixpkgs.jc` or `nix-env -iA nixos.jc` |
|
||||
| Guix System linux | `guix install jc` |
|
||||
| Gentoo Linux | `emerge dev-python/jc` |
|
||||
@@ -133,14 +135,18 @@ on Github.
|
||||
`jc` accepts piped input from `STDIN` and outputs a JSON representation of the
|
||||
previous command's output to `STDOUT`.
|
||||
```bash
|
||||
COMMAND | jc PARSER [OPTIONS]
|
||||
COMMAND | jc [SLICE] [OPTIONS] PARSER
|
||||
cat FILE | jc [SLICE] [OPTIONS] PARSER
|
||||
echo STRING | jc [SLICE] [OPTIONS] PARSER
|
||||
```
|
||||
|
||||
Alternatively, the "magic" syntax can be used by prepending `jc` to the command
|
||||
to be converted. Options can be passed to `jc` immediately before the command is
|
||||
given. (Note: command aliases and shell builtins are not supported)
|
||||
to be converted or in front of the absolute path for Proc files. Options can be
|
||||
passed to `jc` immediately before the command or Proc file path is given.
|
||||
(Note: command aliases and shell builtins are not supported)
|
||||
```bash
|
||||
jc [OPTIONS] COMMAND
|
||||
jc [SLICE] [OPTIONS] COMMAND
|
||||
jc [SLICE] [OPTIONS] /proc/<path-to-procfile>
|
||||
```
|
||||
|
||||
The JSON output can be compact (default) or pretty formatted with the `-p`
|
||||
@@ -150,126 +156,156 @@ option.
|
||||
|
||||
| Argument | Command or Filetype | Documentation |
|
||||
|-------------------|---------------------------------------------------------|----------------------------------------------------------------------------|
|
||||
| ` --acpi` | `acpi` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/acpi) |
|
||||
| ` --airport` | `airport -I` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/airport) |
|
||||
| ` --airport-s` | `airport -s` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/airport_s) |
|
||||
| ` --arp` | `arp` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/arp) |
|
||||
| ` --asciitable` | ASCII and Unicode table parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/asciitable) |
|
||||
| ` --asciitable-m` | multi-line ASCII and Unicode table parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/asciitable_m) |
|
||||
| ` --blkid` | `blkid` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/blkid) |
|
||||
| ` --cef` | CEF string parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/cef) |
|
||||
| ` --cef-s` | CEF string streaming parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/cef_s) |
|
||||
| ` --chage` | `chage --list` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/chage) |
|
||||
| ` --cksum` | `cksum` and `sum` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/cksum) |
|
||||
| ` --crontab` | `crontab` command and file parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/crontab) |
|
||||
| ` --crontab-u` | `crontab` file parser with user support | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/crontab_u) |
|
||||
| ` --csv` | CSV file parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/csv) |
|
||||
| ` --csv-s` | CSV file streaming parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/csv_s) |
|
||||
| ` --date` | `date` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/date) |
|
||||
| ` --df` | `df` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/df) |
|
||||
| ` --dig` | `dig` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/dig) |
|
||||
| ` --dir` | `dir` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/dir) |
|
||||
| ` --dmidecode` | `dmidecode` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/dmidecode) |
|
||||
| ` --dpkg-l` | `dpkg -l` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/dpkg_l) |
|
||||
| ` --du` | `du` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/du) |
|
||||
| `--acpi` | `acpi` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/acpi) |
|
||||
| `--airport` | `airport -I` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/airport) |
|
||||
| `--airport-s` | `airport -s` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/airport_s) |
|
||||
| `--arp` | `arp` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/arp) |
|
||||
| `--asciitable` | ASCII and Unicode table parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/asciitable) |
|
||||
| `--asciitable-m` | multi-line ASCII and Unicode table parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/asciitable_m) |
|
||||
| `--blkid` | `blkid` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/blkid) |
|
||||
| `--bluetoothctl` | `bluetoothctl` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/bluetoothctl) |
|
||||
| `--cbt` | `cbt` (Google Bigtable) command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/cbt) |
|
||||
| `--cef` | CEF string parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/cef) |
|
||||
| `--cef-s` | CEF string streaming parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/cef_s) |
|
||||
| `--certbot` | `certbot` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/certbot) |
|
||||
| `--chage` | `chage --list` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/chage) |
|
||||
| `--cksum` | `cksum` and `sum` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/cksum) |
|
||||
| `--clf` | Common and Combined Log Format file parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/clf) |
|
||||
| `--clf-s` | Common and Combined Log Format file streaming parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/clf_s) |
|
||||
| `--crontab` | `crontab` command and file parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/crontab) |
|
||||
| `--crontab-u` | `crontab` file parser with user support | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/crontab_u) |
|
||||
| `--csv` | CSV file parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/csv) |
|
||||
| `--csv-s` | CSV file streaming parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/csv_s) |
|
||||
| `--date` | `date` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/date) |
|
||||
| `--datetime-iso` | ISO 8601 Datetime string parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/datetime_iso) |
|
||||
| `--df` | `df` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/df) |
|
||||
| `--dig` | `dig` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/dig) |
|
||||
| `--dir` | `dir` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/dir) |
|
||||
| `--dmidecode` | `dmidecode` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/dmidecode) |
|
||||
| `--dpkg-l` | `dpkg -l` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/dpkg_l) |
|
||||
| `--du` | `du` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/du) |
|
||||
| `--email-address` | Email Address string parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/email_address) |
|
||||
| ` --env` | `env` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/env) |
|
||||
| ` --file` | `file` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/file) |
|
||||
| ` --finger` | `finger` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/finger) |
|
||||
| ` --free` | `free` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/free) |
|
||||
| ` --fstab` | `/etc/fstab` file parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/fstab) |
|
||||
| ` --git-log` | `git log` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/git_log) |
|
||||
| ` --git-log-s` | `git log` command streaming parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/git_log_s) |
|
||||
| ` --gpg` | `gpg --with-colons` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/gpg) |
|
||||
| ` --group` | `/etc/group` file parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/group) |
|
||||
| ` --gshadow` | `/etc/gshadow` file parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/gshadow) |
|
||||
| ` --hash` | `hash` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/hash) |
|
||||
| ` --hashsum` | hashsum command parser (`md5sum`, `shasum`, etc.) | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/hashsum) |
|
||||
| ` --hciconfig` | `hciconfig` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/hciconfig) |
|
||||
| ` --history` | `history` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/history) |
|
||||
| ` --hosts` | `/etc/hosts` file parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/hosts) |
|
||||
| ` --id` | `id` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/id) |
|
||||
| ` --ifconfig` | `ifconfig` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/ifconfig) |
|
||||
| ` --ini` | INI file parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/ini) |
|
||||
| ` --iostat` | `iostat` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/iostat) |
|
||||
| ` --iostat-s` | `iostat` command streaming parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/iostat_s) |
|
||||
| ` --ip-address` | IPv4 and IPv6 Address string parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/ip_address) |
|
||||
| ` --iptables` | `iptables` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/iptables) |
|
||||
| ` --iso-datetime` | ISO 8601 Datetime string parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/iso_datetime) |
|
||||
| ` --iw-scan` | `iw dev [device] scan` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/iw_scan) |
|
||||
| ` --jar-manifest` | Java MANIFEST.MF file parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/jar_manifest) |
|
||||
| ` --jobs` | `jobs` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/jobs) |
|
||||
| ` --jwt` | JWT string parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/jwt) |
|
||||
| ` --kv` | Key/Value file parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/kv) |
|
||||
| ` --last` | `last` and `lastb` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/last) |
|
||||
| ` --ls` | `ls` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/ls) |
|
||||
| ` --ls-s` | `ls` command streaming parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/ls_s) |
|
||||
| ` --lsblk` | `lsblk` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/lsblk) |
|
||||
| ` --lsmod` | `lsmod` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/lsmod) |
|
||||
| ` --lsof` | `lsof` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/lsof) |
|
||||
| ` --lsusb` | `lsusb` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/lsusb) |
|
||||
| ` --m3u` | M3U and M3U8 file parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/m3u) |
|
||||
| ` --mdadm` | `mdadm` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/mdadm) |
|
||||
| ` --mount` | `mount` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/mount) |
|
||||
| ` --mpstat` | `mpstat` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/mpstat) |
|
||||
| ` --mpstat-s` | `mpstat` command streaming parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/mpstat_s) |
|
||||
| ` --netstat` | `netstat` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/netstat) |
|
||||
| ` --nmcli` | `nmcli` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/nmcli) |
|
||||
| ` --ntpq` | `ntpq -p` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/ntpq) |
|
||||
| ` --passwd` | `/etc/passwd` file parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/passwd) |
|
||||
| ` --pidstat` | `pidstat -h` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/pidstat) |
|
||||
| ` --pidstat-s` | `pidstat -h` command streaming parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/pidstat_s) |
|
||||
| ` --ping` | `ping` and `ping6` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/ping) |
|
||||
| ` --ping-s` | `ping` and `ping6` command streaming parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/ping_s) |
|
||||
| ` --pip-list` | `pip list` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/pip_list) |
|
||||
| ` --pip-show` | `pip show` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/pip_show) |
|
||||
| ` --plist` | PLIST file parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/plist) |
|
||||
| ` --postconf` | `postconf -M` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/postconf) |
|
||||
| ` --ps` | `ps` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/ps) |
|
||||
| ` --route` | `route` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/route) |
|
||||
| ` --rpm-qi` | `rpm -qi` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/rpm_qi) |
|
||||
| ` --rsync` | `rsync` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/rsync) |
|
||||
| ` --rsync-s` | `rsync` command streaming parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/rsync_s) |
|
||||
| ` --sfdisk` | `sfdisk` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/sfdisk) |
|
||||
| ` --shadow` | `/etc/shadow` file parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/shadow) |
|
||||
| ` --ss` | `ss` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/ss) |
|
||||
| ` --stat` | `stat` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/stat) |
|
||||
| ` --stat-s` | `stat` command streaming parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/stat_s) |
|
||||
| ` --sysctl` | `sysctl` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/sysctl) |
|
||||
| ` --syslog` | Syslog RFC 5424 string parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/syslog) |
|
||||
| ` --syslog-s` | Syslog RFC 5424 string streaming parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/syslog_s) |
|
||||
| ` --syslog-bsd` | Syslog RFC 3164 string parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/syslog_bsd) |
|
||||
| ` --syslog-bsd-s` | Syslog RFC 3164 string streaming parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/syslog_bsd_s) |
|
||||
| ` --systemctl` | `systemctl` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/systemctl) |
|
||||
| ` --systemctl-lj` | `systemctl list-jobs` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/systemctl_lj) |
|
||||
| ` --systemctl-ls` | `systemctl list-sockets` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/systemctl_ls) |
|
||||
| `--env` | `env` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/env) |
|
||||
| `--file` | `file` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/file) |
|
||||
| `--find` | `find` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/find) |
|
||||
| `--findmnt` | `findmnt` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/findmnt) |
|
||||
| `--finger` | `finger` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/finger) |
|
||||
| `--free` | `free` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/free) |
|
||||
| `--fstab` | `/etc/fstab` file parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/fstab) |
|
||||
| `--git-log` | `git log` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/git_log) |
|
||||
| `--git-log-s` | `git log` command streaming parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/git_log_s) |
|
||||
| `--git-ls-remote` | `git ls-remote` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/git_ls_remote) |
|
||||
| `--gpg` | `gpg --with-colons` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/gpg) |
|
||||
| `--group` | `/etc/group` file parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/group) |
|
||||
| `--gshadow` | `/etc/gshadow` file parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/gshadow) |
|
||||
| `--hash` | `hash` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/hash) |
|
||||
| `--hashsum` | hashsum command parser (`md5sum`, `shasum`, etc.) | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/hashsum) |
|
||||
| `--hciconfig` | `hciconfig` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/hciconfig) |
|
||||
| `--history` | `history` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/history) |
|
||||
| `--hosts` | `/etc/hosts` file parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/hosts) |
|
||||
| `--id` | `id` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/id) |
|
||||
| `--ifconfig` | `ifconfig` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/ifconfig) |
|
||||
| `--ini` | INI file parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/ini) |
|
||||
| `--ini-dup` | INI with duplicate key file parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/ini_dup) |
|
||||
| `--iostat` | `iostat` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/iostat) |
|
||||
| `--iostat-s` | `iostat` command streaming parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/iostat_s) |
|
||||
| `--ip-address` | IPv4 and IPv6 Address string parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/ip_address) |
|
||||
| `--iptables` | `iptables` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/iptables) |
|
||||
| `--ip-route` | `ip route` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/ip_route) |
|
||||
| `--iw-scan` | `iw dev [device] scan` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/iw_scan) |
|
||||
| `--iwconfig` | `iwconfig` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/iwconfig) |
|
||||
| `--jar-manifest` | Java MANIFEST.MF file parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/jar_manifest) |
|
||||
| `--jobs` | `jobs` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/jobs) |
|
||||
| `--jwt` | JWT string parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/jwt) |
|
||||
| `--kv` | Key/Value file and string parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/kv) |
|
||||
| `--last` | `last` and `lastb` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/last) |
|
||||
| `--ls` | `ls` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/ls) |
|
||||
| `--ls-s` | `ls` command streaming parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/ls_s) |
|
||||
| `--lsattr` | `lsattr` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/lsattr) |
|
||||
| `--lsblk` | `lsblk` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/lsblk) |
|
||||
| `--lsmod` | `lsmod` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/lsmod) |
|
||||
| `--lsof` | `lsof` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/lsof) |
|
||||
| `--lspci` | `lspci -mmv` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/lspci) |
|
||||
| `--lsusb` | `lsusb` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/lsusb) |
|
||||
| `--m3u` | M3U and M3U8 file parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/m3u) |
|
||||
| `--mdadm` | `mdadm` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/mdadm) |
|
||||
| `--mount` | `mount` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/mount) |
|
||||
| `--mpstat` | `mpstat` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/mpstat) |
|
||||
| `--mpstat-s` | `mpstat` command streaming parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/mpstat_s) |
|
||||
| `--netstat` | `netstat` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/netstat) |
|
||||
| `--nmcli` | `nmcli` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/nmcli) |
|
||||
| `--ntpq` | `ntpq -p` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/ntpq) |
|
||||
| `--openvpn` | openvpn-status.log file parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/openvpn) |
|
||||
| `--os-prober` | `os-prober` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/os_prober) |
|
||||
| `--passwd` | `/etc/passwd` file parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/passwd) |
|
||||
| `--pci-ids` | `pci.ids` file parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/pci_ids) |
|
||||
| `--pgpass` | PostgreSQL password file parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/pgpass) |
|
||||
| `--pidstat` | `pidstat -H` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/pidstat) |
|
||||
| `--pidstat-s` | `pidstat -H` command streaming parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/pidstat_s) |
|
||||
| `--ping` | `ping` and `ping6` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/ping) |
|
||||
| `--ping-s` | `ping` and `ping6` command streaming parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/ping_s) |
|
||||
| `--pip-list` | `pip list` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/pip_list) |
|
||||
| `--pip-show` | `pip show` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/pip_show) |
|
||||
| `--plist` | PLIST file parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/plist) |
|
||||
| `--postconf` | `postconf -M` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/postconf) |
|
||||
| `--proc` | `/proc/` file parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/proc) |
|
||||
| `--ps` | `ps` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/ps) |
|
||||
| `--resolve-conf` | `/etc/resolve.conf` file parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/resolve_conf) |
|
||||
| `--route` | `route` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/route) |
|
||||
| `--rpm-qi` | `rpm -qi` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/rpm_qi) |
|
||||
| `--rsync` | `rsync` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/rsync) |
|
||||
| `--rsync-s` | `rsync` command streaming parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/rsync_s) |
|
||||
| `--semver` | Semantic Version string parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/semver) |
|
||||
| `--sfdisk` | `sfdisk` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/sfdisk) |
|
||||
| `--shadow` | `/etc/shadow` file parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/shadow) |
|
||||
| `--srt` | SRT file parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/srt) |
|
||||
| `--ss` | `ss` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/ss) |
|
||||
| `--ssh-conf` | `ssh` config file and `ssh -G` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/ssh_conf) |
|
||||
| `--sshd-conf` | `sshd` config file and `sshd -T` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/sshd_conf) |
|
||||
| `--stat` | `stat` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/stat) |
|
||||
| `--stat-s` | `stat` command streaming parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/stat_s) |
|
||||
| `--sysctl` | `sysctl` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/sysctl) |
|
||||
| `--syslog` | Syslog RFC 5424 string parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/syslog) |
|
||||
| `--syslog-s` | Syslog RFC 5424 string streaming parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/syslog_s) |
|
||||
| `--syslog-bsd` | Syslog RFC 3164 string parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/syslog_bsd) |
|
||||
| `--syslog-bsd-s` | Syslog RFC 3164 string streaming parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/syslog_bsd_s) |
|
||||
| `--systemctl` | `systemctl` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/systemctl) |
|
||||
| `--systemctl-lj` | `systemctl list-jobs` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/systemctl_lj) |
|
||||
| `--systemctl-ls` | `systemctl list-sockets` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/systemctl_ls) |
|
||||
| `--systemctl-luf` | `systemctl list-unit-files` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/systemctl_luf) |
|
||||
| ` --systeminfo` | `systeminfo` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/systeminfo) |
|
||||
| ` --time` | `/usr/bin/time` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/time) |
|
||||
| ` --timedatectl` | `timedatectl status` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/timedatectl) |
|
||||
| ` --timestamp` | Unix Epoch Timestamp string parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/timestamp) |
|
||||
| ` --top` | `top -b` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/top) |
|
||||
| ` --top-s` | `top -b` command streaming parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/top_s) |
|
||||
| ` --tracepath` | `tracepath` and `tracepath6` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/tracepath) |
|
||||
| ` --traceroute` | `traceroute` and `traceroute6` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/traceroute) |
|
||||
| ` --ufw` | `ufw status` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/ufw) |
|
||||
| ` --ufw-appinfo` | `ufw app info [application]` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/ufw_appinfo) |
|
||||
| ` --uname` | `uname -a` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/uname) |
|
||||
| `--systeminfo` | `systeminfo` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/systeminfo) |
|
||||
| `--time` | `/usr/bin/time` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/time) |
|
||||
| `--timedatectl` | `timedatectl status` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/timedatectl) |
|
||||
| `--timestamp` | Unix Epoch Timestamp string parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/timestamp) |
|
||||
| `--toml` | TOML file parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/toml) |
|
||||
| `--top` | `top -b` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/top) |
|
||||
| `--top-s` | `top -b` command streaming parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/top_s) |
|
||||
| `--tracepath` | `tracepath` and `tracepath6` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/tracepath) |
|
||||
| `--traceroute` | `traceroute` and `traceroute6` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/traceroute) |
|
||||
| `--udevadm` | `udevadm info` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/udevadm) |
|
||||
| `--ufw` | `ufw status` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/ufw) |
|
||||
| `--ufw-appinfo` | `ufw app info [application]` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/ufw_appinfo) |
|
||||
| `--uname` | `uname -a` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/uname) |
|
||||
| `--update-alt-gs` | `update-alternatives --get-selections` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/update_alt_gs) |
|
||||
| ` --update-alt-q` | `update-alternatives --query` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/update_alt_q) |
|
||||
| ` --upower` | `upower` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/upower) |
|
||||
| ` --uptime` | `uptime` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/uptime) |
|
||||
| ` --url` | URL string parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/url) |
|
||||
| ` --vmstat` | `vmstat` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/vmstat) |
|
||||
| ` --vmstat-s` | `vmstat` command streaming parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/vmstat_s) |
|
||||
| ` --w` | `w` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/w) |
|
||||
| ` --wc` | `wc` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/wc) |
|
||||
| ` --who` | `who` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/who) |
|
||||
| ` --x509-cert` | X.509 PEM and DER certificate file parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/x509_cert) |
|
||||
| ` --xml` | XML file parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/xml) |
|
||||
| ` --xrandr` | `xrandr` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/xrandr) |
|
||||
| ` --yaml` | YAML file parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/yaml) |
|
||||
| ` --zipinfo` | `zipinfo` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/zipinfo) |
|
||||
| `--update-alt-q` | `update-alternatives --query` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/update_alt_q) |
|
||||
| `--upower` | `upower` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/upower) |
|
||||
| `--uptime` | `uptime` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/uptime) |
|
||||
| `--url` | URL string parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/url) |
|
||||
| `--ver` | Version string parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/ver) |
|
||||
| `--veracrypt` | `veracrypt` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/veracrypt) |
|
||||
| `--vmstat` | `vmstat` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/vmstat) |
|
||||
| `--vmstat-s` | `vmstat` command streaming parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/vmstat_s) |
|
||||
| `--w` | `w` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/w) |
|
||||
| `--wc` | `wc` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/wc) |
|
||||
| `--who` | `who` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/who) |
|
||||
| `--x509-cert` | X.509 PEM and DER certificate file parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/x509_cert) |
|
||||
| `--x509-csr` | X.509 PEM and DER certificate request file parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/x509_csr) |
|
||||
| `--xml` | XML file parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/xml) |
|
||||
| `--xrandr` | `xrandr` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/xrandr) |
|
||||
| `--yaml` | YAML file parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/yaml) |
|
||||
| `--zipinfo` | `zipinfo` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/zipinfo) |
|
||||
| `--zpool-iostat` | `zpool iostat` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/zpool_iostat) |
|
||||
| `--zpool-status` | `zpool status` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/zpool_status) |
|
||||
|
||||
### Options
|
||||
|
||||
@@ -278,7 +314,7 @@ option.
|
||||
| `-a` | `--about` | About `jc`. Prints information about `jc` and the parsers (in JSON or YAML, of course!) |
|
||||
| `-C` | `--force-color` | Force color output even when using pipes (overrides `-m` and the `NO_COLOR` env variable) |
|
||||
| `-d` | `--debug` | Debug mode. Prints trace messages if parsing issues are encountered (use`-dd` for verbose debugging) |
|
||||
| `-h` | `--help` | Help. Use `jc -h --parser_name` for parser documentation |
|
||||
| `-h` | `--help` | Help. Use `jc -h --parser_name` for parser documentation. Use twice to show hidden parsers (e.g. `-hh`) |
|
||||
| `-m` | `--monochrome` | Monochrome output |
|
||||
| `-M` | `--meta-out` | Add metadata to output including timestamp, parser name, magic command, magic command exit code, etc. | |
|
||||
| `-p` | `--pretty` | Pretty format the JSON output |
|
||||
@@ -290,9 +326,59 @@ option.
|
||||
| `-B` | `--bash-comp` | Generate Bash shell completion script ([more info](https://github.com/kellyjonbrazil/jc/wiki/Shell-Completions)) |
|
||||
| `-Z` | `--zsh-comp` | Generate Zsh shell completion script ([more info](https://github.com/kellyjonbrazil/jc/wiki/Shell-Completions)) |
|
||||
|
||||
### Slice
|
||||
Line slicing is supported using the `START:STOP` syntax similar to Python
|
||||
slicing. This allows you to skip lines at the beginning and/or end of the
|
||||
`STDIN` input you would like `jc` to convert.
|
||||
|
||||
`START` and `STOP` can be positive or negative integers or blank and allow
|
||||
you to specify how many lines to skip and how many lines to process.
|
||||
Positive and blank slices are the most memory efficient. Any negative
|
||||
integers in the slice will use more memory.
|
||||
|
||||
For example, to skip the first and last line of the following text, you
|
||||
could express the slice in a couple ways:
|
||||
|
||||
```bash
|
||||
$ cat table.txt
|
||||
### We want to skip this header ###
|
||||
col1 col2
|
||||
foo 1
|
||||
bar 2
|
||||
### We want to skip this footer ###
|
||||
$ cat table.txt | jc 1:-1 --asciitable
|
||||
[{"col1":"foo","col2":"1"},{"col1":"bar","col2":"2"}]
|
||||
$ cat table.txt | jc 1:4 --asciitable
|
||||
[{"col1":"foo","col2":"1"},{"col1":"bar","col2":"2"}]
|
||||
```
|
||||
In this example `1:-1` and `1:4` line slices provide the same output.
|
||||
|
||||
When using positive integers the index location of `STOP` is non-inclusive.
|
||||
Positive slices count from the first line of the input toward the end
|
||||
starting at `0` as the first line. Negative slices count from the last line
|
||||
toward the beginning starting at `-1` as the last line. This is also the way
|
||||
[Python's slicing](https://stackoverflow.com/questions/509211/understanding-slicing)
|
||||
feature works.
|
||||
|
||||
Here is a breakdown of line slice options:
|
||||
|
||||
| Slice Notation | Input Lines Processed |
|
||||
|----------------|--------------------------------------------------------------|
|
||||
| `START:STOP` | lines `START` through `STOP - 1` |
|
||||
| `START:` | lines `START` through the rest of the output |
|
||||
| `:STOP` | lines from the beginning through `STOP - 1` |
|
||||
| `-START:STOP` | `START` lines from the end through `STOP - 1` |
|
||||
| `START:-STOP` | lines `START` through `STOP` lines from the end |
|
||||
| `-START:-STOP` | `START` lines from the end through `STOP` lines from the end |
|
||||
| `-START:` | `START` lines from the end through the rest of the output |
|
||||
| `:-STOP` | lines from the beginning through `STOP` lines from the end |
|
||||
| `:` | all lines |
|
||||
|
||||
### Exit Codes
|
||||
Any fatal errors within `jc` will generate an exit code of `100`, otherwise the
|
||||
exit code will be `0`. When using the "magic" syntax (e.g. `jc ifconfig eth0`),
|
||||
exit code will be `0`.
|
||||
|
||||
When using the "magic" syntax (e.g. `jc ifconfig eth0`),
|
||||
`jc` will store the exit code of the program being parsed and add it to the `jc`
|
||||
exit code. This way it is easier to determine if an error was from the parsed
|
||||
program or `jc`.
|
||||
@@ -306,6 +392,44 @@ Consider the following examples using `ifconfig`:
|
||||
| `0` | `100` | `100` | Error in `jc` |
|
||||
| `1` | `100` | `101` | Error in both `ifconfig` and `jc` |
|
||||
|
||||
When using the "magic" syntax you can also retrieve the exit code of the called
|
||||
program by using the `--meta-out` or `-M` option. This will append a `_jc_meta`
|
||||
object to the output that will include the magic command information, including
|
||||
the exit code.
|
||||
|
||||
Here is an example with `ping`:
|
||||
```bash
|
||||
$ jc --meta-out -p ping -c2 192.168.1.252
|
||||
{
|
||||
"destination_ip": "192.168.1.252",
|
||||
"data_bytes": 56,
|
||||
"pattern": null,
|
||||
"destination": "192.168.1.252",
|
||||
"packets_transmitted": 2,
|
||||
"packets_received": 0,
|
||||
"packet_loss_percent": 100.0,
|
||||
"duplicates": 0,
|
||||
"responses": [
|
||||
{
|
||||
"type": "timeout",
|
||||
"icmp_seq": 0,
|
||||
"duplicate": false
|
||||
}
|
||||
],
|
||||
"_jc_meta": {
|
||||
"parser": "ping",
|
||||
"timestamp": 1661357115.27949,
|
||||
"magic_command": [
|
||||
"ping",
|
||||
"-c2",
|
||||
"192.168.1.252"
|
||||
],
|
||||
"magic_command_exit": 2
|
||||
}
|
||||
}
|
||||
$ echo $?
|
||||
2
|
||||
```
|
||||
|
||||
### Setting Custom Colors via Environment Variable
|
||||
You can specify custom colors via the `JC_COLORS` environment variable. The
|
||||
@@ -337,7 +461,7 @@ option.
|
||||
### Streaming Parsers
|
||||
Most parsers load all of the data from `STDIN`, parse it, then output the entire
|
||||
JSON document serially. There are some streaming parsers (e.g. `ls-s` and
|
||||
`ping-s`) that immediately start processing and outputing the data line-by-line
|
||||
`ping-s`) that immediately start processing and outputting the data line-by-line
|
||||
as [JSON Lines](https://jsonlines.org/) (aka [NDJSON](http://ndjson.org/)) while
|
||||
it is being received from `STDIN`. This can significantly reduce the amount of
|
||||
memory required to parse large amounts of command output (e.g. `ls -lR /`) and
|
||||
@@ -420,20 +544,22 @@ for item in result:
|
||||
print(item["filename"])
|
||||
```
|
||||
|
||||
### Custom Parsers
|
||||
Custom local parser plugins may be placed in a `jc/jcparsers` folder in your
|
||||
local **"App data directory"**:
|
||||
### Parser Plugins
|
||||
Parser plugins may be placed in a `jc/jcparsers` folder in your local
|
||||
**"App data directory"**:
|
||||
|
||||
- Linux/unix: `$HOME/.local/share/jc/jcparsers`
|
||||
- macOS: `$HOME/Library/Application Support/jc/jcparsers`
|
||||
- Windows: `$LOCALAPPDATA\jc\jc\jcparsers`
|
||||
|
||||
Local parser plugins are standard python module files. Use the
|
||||
Parser plugins are standard python module files. Use the
|
||||
[`jc/parsers/foo.py`](https://github.com/kellyjonbrazil/jc/blob/master/jc/parsers/foo.py)
|
||||
or [`jc/parsers/foo_s.py (streaming)`](https://github.com/kellyjonbrazil/jc/blob/master/jc/parsers/foo_s.py)
|
||||
parser as a template and simply place a `.py` file in the `jcparsers` subfolder.
|
||||
Any dependencies can be placed in the `jc` folder above `jcparsers` and can
|
||||
be imported in the parser code.
|
||||
|
||||
Local plugin filenames must be valid python module names and therefore must
|
||||
Parser plugin filenames must be valid python module names and therefore must
|
||||
start with a letter and consist entirely of alphanumerics and underscores.
|
||||
Local plugins may override default parsers.
|
||||
|
||||
@@ -491,18 +617,18 @@ they are run on an unsupported platform. To see all parser information,
|
||||
including compatibility, run `jc -ap`.
|
||||
|
||||
You may still use a parser on an unsupported platform - for example, you may
|
||||
want to parse a file with linux `lsof` output on an macOS or Windows laptop. In
|
||||
want to parse a file with linux `lsof` output on a macOS or Windows laptop. In
|
||||
that case you can suppress the warning message with the `-q` cli option or the
|
||||
`quiet=True` function parameter in `parse()`:
|
||||
|
||||
macOS:
|
||||
```bash
|
||||
cat lsof.out | jc --lsof -q
|
||||
cat lsof.out | jc -q --lsof
|
||||
```
|
||||
|
||||
or Windows:
|
||||
```bash
|
||||
type lsof.out | jc --lsof -q
|
||||
type lsof.out | jc -q --lsof
|
||||
```
|
||||
|
||||
Tested on:
|
||||
@@ -546,7 +672,7 @@ documentation.
|
||||
|
||||
### arp
|
||||
```bash
|
||||
arp | jc --arp -p # or: jc -p arp
|
||||
arp | jc -p --arp # or: jc -p arp
|
||||
```
|
||||
```json
|
||||
[
|
||||
@@ -585,7 +711,7 @@ cat homes.csv
|
||||
...
|
||||
```
|
||||
```bash
|
||||
cat homes.csv | jc --csv -p
|
||||
cat homes.csv | jc -p --csv
|
||||
```
|
||||
```json
|
||||
[
|
||||
@@ -626,7 +752,7 @@ cat homes.csv | jc --csv -p
|
||||
```
|
||||
### /etc/hosts file
|
||||
```bash
|
||||
cat /etc/hosts | jc --hosts -p
|
||||
cat /etc/hosts | jc -p --hosts
|
||||
```
|
||||
```json
|
||||
[
|
||||
@@ -653,7 +779,7 @@ cat /etc/hosts | jc --hosts -p
|
||||
```
|
||||
### ifconfig
|
||||
```bash
|
||||
ifconfig | jc --ifconfig -p # or: jc -p ifconfig
|
||||
ifconfig | jc -p --ifconfig # or: jc -p ifconfig
|
||||
```
|
||||
```json
|
||||
[
|
||||
@@ -697,43 +823,37 @@ ifconfig | jc --ifconfig -p # or: jc -p ifconfig
|
||||
cat example.ini
|
||||
```
|
||||
```
|
||||
[DEFAULT]
|
||||
ServerAliveInterval = 45
|
||||
Compression = yes
|
||||
CompressionLevel = 9
|
||||
ForwardX11 = yes
|
||||
foo = fiz
|
||||
bar = buz
|
||||
|
||||
[bitbucket.org]
|
||||
User = hg
|
||||
[section1]
|
||||
fruit = apple
|
||||
color = blue
|
||||
|
||||
[topsecret.server.com]
|
||||
Port = 50022
|
||||
ForwardX11 = no
|
||||
[section2]
|
||||
fruit = pear
|
||||
color = green
|
||||
```
|
||||
```bash
|
||||
cat example.ini | jc --ini -p
|
||||
cat example.ini | jc -p --ini
|
||||
```
|
||||
```json
|
||||
{
|
||||
"bitbucket.org": {
|
||||
"serveraliveinterval": "45",
|
||||
"compression": "yes",
|
||||
"compressionlevel": "9",
|
||||
"forwardx11": "yes",
|
||||
"user": "hg"
|
||||
"foo": "fiz",
|
||||
"bar": "buz",
|
||||
"section1": {
|
||||
"fruit": "apple",
|
||||
"color": "blue"
|
||||
},
|
||||
"topsecret.server.com": {
|
||||
"serveraliveinterval": "45",
|
||||
"compression": "yes",
|
||||
"compressionlevel": "9",
|
||||
"forwardx11": "no",
|
||||
"port": "50022"
|
||||
"section2": {
|
||||
"fruit": "pear",
|
||||
"color": "green"
|
||||
}
|
||||
}
|
||||
```
|
||||
### ls
|
||||
```bash
|
||||
$ ls -l /usr/bin | jc --ls -p # or: jc -p ls -l /usr/bin
|
||||
$ ls -l /usr/bin | jc -p --ls # or: jc -p ls -l /usr/bin
|
||||
```
|
||||
```json
|
||||
[
|
||||
@@ -769,7 +889,7 @@ $ ls -l /usr/bin | jc --ls -p # or: jc -p ls -l /usr/bin
|
||||
```
|
||||
### netstat
|
||||
```bash
|
||||
netstat -apee | jc --netstat -p # or: jc -p netstat -apee
|
||||
netstat -apee | jc -p --netstat # or: jc -p netstat -apee
|
||||
```
|
||||
```json
|
||||
[
|
||||
@@ -857,7 +977,7 @@ netstat -apee | jc --netstat -p # or: jc -p netstat -apee
|
||||
```
|
||||
### /etc/passwd file
|
||||
```bash
|
||||
cat /etc/passwd | jc --passwd -p
|
||||
cat /etc/passwd | jc -p --passwd
|
||||
```
|
||||
```json
|
||||
[
|
||||
@@ -883,7 +1003,7 @@ cat /etc/passwd | jc --passwd -p
|
||||
```
|
||||
### ping
|
||||
```bash
|
||||
ping 8.8.8.8 -c 3 | jc --ping -p # or: jc -p ping 8.8.8.8 -c 3
|
||||
ping 8.8.8.8 -c 3 | jc -p --ping # or: jc -p ping 8.8.8.8 -c 3
|
||||
```
|
||||
```json
|
||||
{
|
||||
@@ -936,7 +1056,7 @@ ping 8.8.8.8 -c 3 | jc --ping -p # or: jc -p ping 8.8.8.8 -c 3
|
||||
```
|
||||
### ps
|
||||
```bash
|
||||
ps axu | jc --ps -p # or: jc -p ps axu
|
||||
ps axu | jc -p --ps # or: jc -p ps axu
|
||||
```
|
||||
```json
|
||||
[
|
||||
@@ -983,7 +1103,7 @@ ps axu | jc --ps -p # or: jc -p ps axu
|
||||
```
|
||||
### traceroute
|
||||
```bash
|
||||
traceroute -m 2 8.8.8.8 | jc --traceroute -p
|
||||
traceroute -m 2 8.8.8.8 | jc -p --traceroute
|
||||
# or: jc -p traceroute -m 2 8.8.8.8
|
||||
```
|
||||
```json
|
||||
@@ -1048,7 +1168,7 @@ traceroute -m 2 8.8.8.8 | jc --traceroute -p
|
||||
```
|
||||
### uptime
|
||||
```bash
|
||||
uptime | jc --uptime -p # or: jc -p uptime
|
||||
uptime | jc -p --uptime # or: jc -p uptime
|
||||
```
|
||||
```json
|
||||
{
|
||||
@@ -1093,7 +1213,7 @@ cat cd_catalog.xml
|
||||
...
|
||||
```
|
||||
```bash
|
||||
cat cd_catalog.xml | jc --xml -p
|
||||
cat cd_catalog.xml | jc -p --xml
|
||||
```
|
||||
```json
|
||||
{
|
||||
@@ -1145,7 +1265,7 @@ spec:
|
||||
mode: ISTIO_MUTUAL
|
||||
```
|
||||
```bash
|
||||
cat istio.yaml | jc --yaml -p
|
||||
cat istio.yaml | jc -p --yaml
|
||||
```
|
||||
```json
|
||||
[
|
||||
@@ -1183,4 +1303,4 @@ cat istio.yaml | jc --yaml -p
|
||||
]
|
||||
```
|
||||
|
||||
© 2019-2022 Kelly Brazil
|
||||
© 2019-2023 Kelly Brazil
|
||||
@@ -3,8 +3,8 @@ _jc()
|
||||
local cur prev words cword jc_commands jc_parsers jc_options \
|
||||
jc_about_options jc_about_mod_options jc_help_options jc_special_options
|
||||
|
||||
jc_commands=(acpi airport arp blkid chage cksum crontab date df dig dmidecode dpkg du env file finger free git gpg hciconfig id ifconfig iostat iptables iw jobs last lastb ls lsblk lsmod lsof lsusb md5 md5sum mdadm mount mpstat netstat nmcli ntpq pidstat ping ping6 pip pip3 postconf printenv ps route rpm rsync sfdisk sha1sum sha224sum sha256sum sha384sum sha512sum shasum ss stat sum sysctl systemctl systeminfo timedatectl top tracepath tracepath6 traceroute traceroute6 ufw uname update-alternatives upower uptime vdir vmstat w wc who xrandr zipinfo)
|
||||
jc_parsers=(--acpi --airport --airport-s --arp --asciitable --asciitable-m --blkid --cef --cef-s --chage --cksum --crontab --crontab-u --csv --csv-s --date --df --dig --dir --dmidecode --dpkg-l --du --email-address --env --file --finger --free --fstab --git-log --git-log-s --gpg --group --gshadow --hash --hashsum --hciconfig --history --hosts --id --ifconfig --ini --iostat --iostat-s --ip-address --iptables --iso-datetime --iw-scan --jar-manifest --jobs --jwt --kv --last --ls --ls-s --lsblk --lsmod --lsof --lsusb --m3u --mdadm --mount --mpstat --mpstat-s --netstat --nmcli --ntpq --passwd --pidstat --pidstat-s --ping --ping-s --pip-list --pip-show --plist --postconf --ps --route --rpm-qi --rsync --rsync-s --sfdisk --shadow --ss --stat --stat-s --sysctl --syslog --syslog-s --syslog-bsd --syslog-bsd-s --systemctl --systemctl-lj --systemctl-ls --systemctl-luf --systeminfo --time --timedatectl --timestamp --top --top-s --tracepath --traceroute --ufw --ufw-appinfo --uname --update-alt-gs --update-alt-q --upower --uptime --url --vmstat --vmstat-s --w --wc --who --x509-cert --xml --xrandr --yaml --zipinfo)
|
||||
jc_commands=(acpi airport arp blkid bluetoothctl cbt certbot chage cksum crontab date df dig dmidecode dpkg du env file findmnt finger free git gpg hciconfig id ifconfig iostat ip iptables iw iwconfig jobs last lastb ls lsattr lsblk lsmod lsof lspci lsusb md5 md5sum mdadm mount mpstat netstat nmcli ntpq os-prober pidstat ping ping6 pip pip3 postconf printenv ps route rpm rsync sfdisk sha1sum sha224sum sha256sum sha384sum sha512sum shasum ss ssh sshd stat sum sysctl systemctl systeminfo timedatectl top tracepath tracepath6 traceroute traceroute6 udevadm ufw uname update-alternatives upower uptime vdir veracrypt vmstat w wc who xrandr zipinfo zpool)
|
||||
jc_parsers=(--acpi --airport --airport-s --arp --asciitable --asciitable-m --blkid --bluetoothctl --cbt --cef --cef-s --certbot --chage --cksum --clf --clf-s --crontab --crontab-u --csv --csv-s --date --datetime-iso --df --dig --dir --dmidecode --dpkg-l --du --email-address --env --file --find --findmnt --finger --free --fstab --git-log --git-log-s --git-ls-remote --gpg --group --gshadow --hash --hashsum --hciconfig --history --hosts --id --ifconfig --ini --ini-dup --iostat --iostat-s --ip-address --iptables --ip-route --iw-scan --iwconfig --jar-manifest --jobs --jwt --kv --last --ls --ls-s --lsattr --lsblk --lsmod --lsof --lspci --lsusb --m3u --mdadm --mount --mpstat --mpstat-s --netstat --nmcli --ntpq --openvpn --os-prober --passwd --pci-ids --pgpass --pidstat --pidstat-s --ping --ping-s --pip-list --pip-show --plist --postconf --proc --proc-buddyinfo --proc-consoles --proc-cpuinfo --proc-crypto --proc-devices --proc-diskstats --proc-filesystems --proc-interrupts --proc-iomem --proc-ioports --proc-loadavg --proc-locks --proc-meminfo --proc-modules --proc-mtrr --proc-pagetypeinfo --proc-partitions --proc-slabinfo --proc-softirqs --proc-stat --proc-swaps --proc-uptime --proc-version --proc-vmallocinfo --proc-vmstat --proc-zoneinfo --proc-driver-rtc --proc-net-arp --proc-net-dev --proc-net-dev-mcast --proc-net-if-inet6 --proc-net-igmp --proc-net-igmp6 --proc-net-ipv6-route --proc-net-netlink --proc-net-netstat --proc-net-packet --proc-net-protocols --proc-net-route --proc-net-tcp --proc-net-unix --proc-pid-fdinfo --proc-pid-io --proc-pid-maps --proc-pid-mountinfo --proc-pid-numa-maps --proc-pid-smaps --proc-pid-stat --proc-pid-statm --proc-pid-status --ps --resolve-conf --route --rpm-qi --rsync --rsync-s --semver --sfdisk --shadow --srt --ss --ssh-conf --sshd-conf --stat --stat-s --sysctl --syslog --syslog-s --syslog-bsd --syslog-bsd-s --systemctl --systemctl-lj --systemctl-ls --systemctl-luf --systeminfo --time --timedatectl --timestamp --toml --top --top-s --tracepath --traceroute --udevadm --ufw --ufw-appinfo --uname --update-alt-gs --update-alt-q --upower --uptime --url --ver --veracrypt --vmstat --vmstat-s --w --wc --who --x509-cert --x509-csr --xml --xrandr --yaml --zipinfo --zpool-iostat --zpool-status)
|
||||
jc_options=(--force-color -C --debug -d --monochrome -m --meta-out -M --pretty -p --quiet -q --raw -r --unbuffer -u --yaml-out -y)
|
||||
jc_about_options=(--about -a)
|
||||
jc_about_mod_options=(--pretty -p --yaml-out -y --monochrome -m --force-color -C)
|
||||
@@ -67,6 +67,12 @@ _jc()
|
||||
fi
|
||||
done
|
||||
|
||||
# if "/pr[oc]" (magic for Procfile parsers) is in the current word, complete with files/directories in the path
|
||||
if [[ "${cur}" =~ "/pr" ]]; then
|
||||
_filedir
|
||||
return 0
|
||||
fi
|
||||
|
||||
# if a parser arg is found anywhere in the line, only show options and help options
|
||||
for i in "${words[@]::${#words[@]}-1}"; do
|
||||
if [[ " ${jc_parsers[*]} " =~ " ${i} " ]]; then
|
||||
|
||||
@@ -9,12 +9,15 @@ _jc() {
|
||||
jc_help_options jc_help_options_describe \
|
||||
jc_special_options jc_special_options_describe
|
||||
|
||||
jc_commands=(acpi airport arp blkid chage cksum crontab date df dig dmidecode dpkg du env file finger free git gpg hciconfig id ifconfig iostat iptables iw jobs last lastb ls lsblk lsmod lsof lsusb md5 md5sum mdadm mount mpstat netstat nmcli ntpq pidstat ping ping6 pip pip3 postconf printenv ps route rpm rsync sfdisk sha1sum sha224sum sha256sum sha384sum sha512sum shasum ss stat sum sysctl systemctl systeminfo timedatectl top tracepath tracepath6 traceroute traceroute6 ufw uname update-alternatives upower uptime vdir vmstat w wc who xrandr zipinfo)
|
||||
jc_commands=(acpi airport arp blkid bluetoothctl cbt certbot chage cksum crontab date df dig dmidecode dpkg du env file findmnt finger free git gpg hciconfig id ifconfig iostat ip iptables iw iwconfig jobs last lastb ls lsattr lsblk lsmod lsof lspci lsusb md5 md5sum mdadm mount mpstat netstat nmcli ntpq os-prober pidstat ping ping6 pip pip3 postconf printenv ps route rpm rsync sfdisk sha1sum sha224sum sha256sum sha384sum sha512sum shasum ss ssh sshd stat sum sysctl systemctl systeminfo timedatectl top tracepath tracepath6 traceroute traceroute6 udevadm ufw uname update-alternatives upower uptime vdir veracrypt vmstat w wc who xrandr zipinfo zpool)
|
||||
jc_commands_describe=(
|
||||
'acpi:run "acpi" command with magic syntax.'
|
||||
'airport:run "airport" command with magic syntax.'
|
||||
'arp:run "arp" command with magic syntax.'
|
||||
'blkid:run "blkid" command with magic syntax.'
|
||||
'bluetoothctl:run "bluetoothctl" command with magic syntax.'
|
||||
'cbt:run "cbt" command with magic syntax.'
|
||||
'certbot:run "certbot" command with magic syntax.'
|
||||
'chage:run "chage" command with magic syntax.'
|
||||
'cksum:run "cksum" command with magic syntax.'
|
||||
'crontab:run "crontab" command with magic syntax.'
|
||||
@@ -26,6 +29,7 @@ _jc() {
|
||||
'du:run "du" command with magic syntax.'
|
||||
'env:run "env" command with magic syntax.'
|
||||
'file:run "file" command with magic syntax.'
|
||||
'findmnt:run "findmnt" command with magic syntax.'
|
||||
'finger:run "finger" command with magic syntax.'
|
||||
'free:run "free" command with magic syntax.'
|
||||
'git:run "git" command with magic syntax.'
|
||||
@@ -34,15 +38,19 @@ _jc() {
|
||||
'id:run "id" command with magic syntax.'
|
||||
'ifconfig:run "ifconfig" command with magic syntax.'
|
||||
'iostat:run "iostat" command with magic syntax.'
|
||||
'ip:run "ip" command with magic syntax.'
|
||||
'iptables:run "iptables" command with magic syntax.'
|
||||
'iw:run "iw" command with magic syntax.'
|
||||
'iwconfig:run "iwconfig" command with magic syntax.'
|
||||
'jobs:run "jobs" command with magic syntax.'
|
||||
'last:run "last" command with magic syntax.'
|
||||
'lastb:run "lastb" command with magic syntax.'
|
||||
'ls:run "ls" command with magic syntax.'
|
||||
'lsattr:run "lsattr" command with magic syntax.'
|
||||
'lsblk:run "lsblk" command with magic syntax.'
|
||||
'lsmod:run "lsmod" command with magic syntax.'
|
||||
'lsof:run "lsof" command with magic syntax.'
|
||||
'lspci:run "lspci" command with magic syntax.'
|
||||
'lsusb:run "lsusb" command with magic syntax.'
|
||||
'md5:run "md5" command with magic syntax.'
|
||||
'md5sum:run "md5sum" command with magic syntax.'
|
||||
@@ -52,6 +60,7 @@ _jc() {
|
||||
'netstat:run "netstat" command with magic syntax.'
|
||||
'nmcli:run "nmcli" command with magic syntax.'
|
||||
'ntpq:run "ntpq" command with magic syntax.'
|
||||
'os-prober:run "os-prober" command with magic syntax.'
|
||||
'pidstat:run "pidstat" command with magic syntax.'
|
||||
'ping:run "ping" command with magic syntax.'
|
||||
'ping6:run "ping6" command with magic syntax.'
|
||||
@@ -71,6 +80,8 @@ _jc() {
|
||||
'sha512sum:run "sha512sum" command with magic syntax.'
|
||||
'shasum:run "shasum" command with magic syntax.'
|
||||
'ss:run "ss" command with magic syntax.'
|
||||
'ssh:run "ssh" command with magic syntax.'
|
||||
'sshd:run "sshd" command with magic syntax.'
|
||||
'stat:run "stat" command with magic syntax.'
|
||||
'sum:run "sum" command with magic syntax.'
|
||||
'sysctl:run "sysctl" command with magic syntax.'
|
||||
@@ -82,20 +93,23 @@ _jc() {
|
||||
'tracepath6:run "tracepath6" command with magic syntax.'
|
||||
'traceroute:run "traceroute" command with magic syntax.'
|
||||
'traceroute6:run "traceroute6" command with magic syntax.'
|
||||
'udevadm:run "udevadm" command with magic syntax.'
|
||||
'ufw:run "ufw" command with magic syntax.'
|
||||
'uname:run "uname" command with magic syntax.'
|
||||
'update-alternatives:run "update-alternatives" command with magic syntax.'
|
||||
'upower:run "upower" command with magic syntax.'
|
||||
'uptime:run "uptime" command with magic syntax.'
|
||||
'vdir:run "vdir" command with magic syntax.'
|
||||
'veracrypt:run "veracrypt" command with magic syntax.'
|
||||
'vmstat:run "vmstat" command with magic syntax.'
|
||||
'w:run "w" command with magic syntax.'
|
||||
'wc:run "wc" command with magic syntax.'
|
||||
'who:run "who" command with magic syntax.'
|
||||
'xrandr:run "xrandr" command with magic syntax.'
|
||||
'zipinfo:run "zipinfo" command with magic syntax.'
|
||||
'zpool:run "zpool" command with magic syntax.'
|
||||
)
|
||||
jc_parsers=(--acpi --airport --airport-s --arp --asciitable --asciitable-m --blkid --cef --cef-s --chage --cksum --crontab --crontab-u --csv --csv-s --date --df --dig --dir --dmidecode --dpkg-l --du --email-address --env --file --finger --free --fstab --git-log --git-log-s --gpg --group --gshadow --hash --hashsum --hciconfig --history --hosts --id --ifconfig --ini --iostat --iostat-s --ip-address --iptables --iso-datetime --iw-scan --jar-manifest --jobs --jwt --kv --last --ls --ls-s --lsblk --lsmod --lsof --lsusb --m3u --mdadm --mount --mpstat --mpstat-s --netstat --nmcli --ntpq --passwd --pidstat --pidstat-s --ping --ping-s --pip-list --pip-show --plist --postconf --ps --route --rpm-qi --rsync --rsync-s --sfdisk --shadow --ss --stat --stat-s --sysctl --syslog --syslog-s --syslog-bsd --syslog-bsd-s --systemctl --systemctl-lj --systemctl-ls --systemctl-luf --systeminfo --time --timedatectl --timestamp --top --top-s --tracepath --traceroute --ufw --ufw-appinfo --uname --update-alt-gs --update-alt-q --upower --uptime --url --vmstat --vmstat-s --w --wc --who --x509-cert --xml --xrandr --yaml --zipinfo)
|
||||
jc_parsers=(--acpi --airport --airport-s --arp --asciitable --asciitable-m --blkid --bluetoothctl --cbt --cef --cef-s --certbot --chage --cksum --clf --clf-s --crontab --crontab-u --csv --csv-s --date --datetime-iso --df --dig --dir --dmidecode --dpkg-l --du --email-address --env --file --find --findmnt --finger --free --fstab --git-log --git-log-s --git-ls-remote --gpg --group --gshadow --hash --hashsum --hciconfig --history --hosts --id --ifconfig --ini --ini-dup --iostat --iostat-s --ip-address --iptables --ip-route --iw-scan --iwconfig --jar-manifest --jobs --jwt --kv --last --ls --ls-s --lsattr --lsblk --lsmod --lsof --lspci --lsusb --m3u --mdadm --mount --mpstat --mpstat-s --netstat --nmcli --ntpq --openvpn --os-prober --passwd --pci-ids --pgpass --pidstat --pidstat-s --ping --ping-s --pip-list --pip-show --plist --postconf --proc --proc-buddyinfo --proc-consoles --proc-cpuinfo --proc-crypto --proc-devices --proc-diskstats --proc-filesystems --proc-interrupts --proc-iomem --proc-ioports --proc-loadavg --proc-locks --proc-meminfo --proc-modules --proc-mtrr --proc-pagetypeinfo --proc-partitions --proc-slabinfo --proc-softirqs --proc-stat --proc-swaps --proc-uptime --proc-version --proc-vmallocinfo --proc-vmstat --proc-zoneinfo --proc-driver-rtc --proc-net-arp --proc-net-dev --proc-net-dev-mcast --proc-net-if-inet6 --proc-net-igmp --proc-net-igmp6 --proc-net-ipv6-route --proc-net-netlink --proc-net-netstat --proc-net-packet --proc-net-protocols --proc-net-route --proc-net-tcp --proc-net-unix --proc-pid-fdinfo --proc-pid-io --proc-pid-maps --proc-pid-mountinfo --proc-pid-numa-maps --proc-pid-smaps --proc-pid-stat --proc-pid-statm --proc-pid-status --ps --resolve-conf --route --rpm-qi --rsync --rsync-s --semver --sfdisk --shadow --srt --ss --ssh-conf --sshd-conf --stat --stat-s --sysctl --syslog --syslog-s --syslog-bsd --syslog-bsd-s --systemctl --systemctl-lj --systemctl-ls --systemctl-luf --systeminfo --time --timedatectl --timestamp --toml --top --top-s --tracepath --traceroute --udevadm --ufw --ufw-appinfo --uname --update-alt-gs --update-alt-q --upower --uptime --url --ver --veracrypt --vmstat --vmstat-s --w --wc --who --x509-cert --x509-csr --xml --xrandr --yaml --zipinfo --zpool-iostat --zpool-status)
|
||||
jc_parsers_describe=(
|
||||
'--acpi:`acpi` command parser'
|
||||
'--airport:`airport -I` command parser'
|
||||
@@ -104,15 +118,21 @@ _jc() {
|
||||
'--asciitable:ASCII and Unicode table parser'
|
||||
'--asciitable-m:multi-line ASCII and Unicode table parser'
|
||||
'--blkid:`blkid` command parser'
|
||||
'--bluetoothctl:`bluetoothctl` command parser'
|
||||
'--cbt:`cbt` (Google Bigtable) command parser'
|
||||
'--cef:CEF string parser'
|
||||
'--cef-s:CEF string streaming parser'
|
||||
'--certbot:`certbot` command parser'
|
||||
'--chage:`chage --list` command parser'
|
||||
'--cksum:`cksum` and `sum` command parser'
|
||||
'--clf:Common and Combined Log Format file parser'
|
||||
'--clf-s:Common and Combined Log Format file streaming parser'
|
||||
'--crontab:`crontab` command and file parser'
|
||||
'--crontab-u:`crontab` file parser with user support'
|
||||
'--csv:CSV file parser'
|
||||
'--csv-s:CSV file streaming parser'
|
||||
'--date:`date` command parser'
|
||||
'--datetime-iso:ISO 8601 Datetime string parser'
|
||||
'--df:`df` command parser'
|
||||
'--dig:`dig` command parser'
|
||||
'--dir:`dir` command parser'
|
||||
@@ -122,11 +142,14 @@ _jc() {
|
||||
'--email-address:Email Address string parser'
|
||||
'--env:`env` command parser'
|
||||
'--file:`file` command parser'
|
||||
'--find:`find` command parser'
|
||||
'--findmnt:`findmnt` command parser'
|
||||
'--finger:`finger` command parser'
|
||||
'--free:`free` command parser'
|
||||
'--fstab:`/etc/fstab` file parser'
|
||||
'--git-log:`git log` command parser'
|
||||
'--git-log-s:`git log` command streaming parser'
|
||||
'--git-ls-remote:`git ls-remote` command parser'
|
||||
'--gpg:`gpg --with-colons` command parser'
|
||||
'--group:`/etc/group` file parser'
|
||||
'--gshadow:`/etc/gshadow` file parser'
|
||||
@@ -138,22 +161,26 @@ _jc() {
|
||||
'--id:`id` command parser'
|
||||
'--ifconfig:`ifconfig` command parser'
|
||||
'--ini:INI file parser'
|
||||
'--ini-dup:INI with duplicate key file parser'
|
||||
'--iostat:`iostat` command parser'
|
||||
'--iostat-s:`iostat` command streaming parser'
|
||||
'--ip-address:IPv4 and IPv6 Address string parser'
|
||||
'--iptables:`iptables` command parser'
|
||||
'--iso-datetime:ISO 8601 Datetime string parser'
|
||||
'--ip-route:`ip route` command parser'
|
||||
'--iw-scan:`iw dev [device] scan` command parser'
|
||||
'--iwconfig:`iwconfig` command parser'
|
||||
'--jar-manifest:Java MANIFEST.MF file parser'
|
||||
'--jobs:`jobs` command parser'
|
||||
'--jwt:JWT string parser'
|
||||
'--kv:Key/Value file parser'
|
||||
'--kv:Key/Value file and string parser'
|
||||
'--last:`last` and `lastb` command parser'
|
||||
'--ls:`ls` command parser'
|
||||
'--ls-s:`ls` command streaming parser'
|
||||
'--lsattr:`lsattr` command parser'
|
||||
'--lsblk:`lsblk` command parser'
|
||||
'--lsmod:`lsmod` command parser'
|
||||
'--lsof:`lsof` command parser'
|
||||
'--lspci:`lspci -mmv` command parser'
|
||||
'--lsusb:`lsusb` command parser'
|
||||
'--m3u:M3U and M3U8 file parser'
|
||||
'--mdadm:`mdadm` command parser'
|
||||
@@ -163,23 +190,83 @@ _jc() {
|
||||
'--netstat:`netstat` command parser'
|
||||
'--nmcli:`nmcli` command parser'
|
||||
'--ntpq:`ntpq -p` command parser'
|
||||
'--openvpn:openvpn-status.log file parser'
|
||||
'--os-prober:`os-prober` command parser'
|
||||
'--passwd:`/etc/passwd` file parser'
|
||||
'--pidstat:`pidstat -h` command parser'
|
||||
'--pidstat-s:`pidstat -h` command streaming parser'
|
||||
'--pci-ids:`pci.ids` file parser'
|
||||
'--pgpass:PostgreSQL password file parser'
|
||||
'--pidstat:`pidstat -H` command parser'
|
||||
'--pidstat-s:`pidstat -H` command streaming parser'
|
||||
'--ping:`ping` and `ping6` command parser'
|
||||
'--ping-s:`ping` and `ping6` command streaming parser'
|
||||
'--pip-list:`pip list` command parser'
|
||||
'--pip-show:`pip show` command parser'
|
||||
'--plist:PLIST file parser'
|
||||
'--postconf:`postconf -M` command parser'
|
||||
'--proc:`/proc/` file parser'
|
||||
'--proc-buddyinfo:`/proc/buddyinfo` file parser'
|
||||
'--proc-consoles:`/proc/consoles` file parser'
|
||||
'--proc-cpuinfo:`/proc/cpuinfo` file parser'
|
||||
'--proc-crypto:`/proc/crypto` file parser'
|
||||
'--proc-devices:`/proc/devices` file parser'
|
||||
'--proc-diskstats:`/proc/diskstats` file parser'
|
||||
'--proc-filesystems:`/proc/filesystems` file parser'
|
||||
'--proc-interrupts:`/proc/interrupts` file parser'
|
||||
'--proc-iomem:`/proc/iomem` file parser'
|
||||
'--proc-ioports:`/proc/ioports` file parser'
|
||||
'--proc-loadavg:`/proc/loadavg` file parser'
|
||||
'--proc-locks:`/proc/locks` file parser'
|
||||
'--proc-meminfo:`/proc/meminfo` file parser'
|
||||
'--proc-modules:`/proc/modules` file parser'
|
||||
'--proc-mtrr:`/proc/mtrr` file parser'
|
||||
'--proc-pagetypeinfo:`/proc/pagetypeinfo` file parser'
|
||||
'--proc-partitions:`/proc/partitions` file parser'
|
||||
'--proc-slabinfo:`/proc/slabinfo` file parser'
|
||||
'--proc-softirqs:`/proc/softirqs` file parser'
|
||||
'--proc-stat:`/proc/stat` file parser'
|
||||
'--proc-swaps:`/proc/swaps` file parser'
|
||||
'--proc-uptime:`/proc/uptime` file parser'
|
||||
'--proc-version:`/proc/version` file parser'
|
||||
'--proc-vmallocinfo:`/proc/vmallocinfo` file parser'
|
||||
'--proc-vmstat:`/proc/vmstat` file parser'
|
||||
'--proc-zoneinfo:`/proc/zoneinfo` file parser'
|
||||
'--proc-driver-rtc:`/proc/driver/rtc` file parser'
|
||||
'--proc-net-arp:`/proc/net/arp` file parser'
|
||||
'--proc-net-dev:`/proc/net/dev` file parser'
|
||||
'--proc-net-dev-mcast:`/proc/net/dev_mcast` file parser'
|
||||
'--proc-net-if-inet6:`/proc/net/if_inet6` file parser'
|
||||
'--proc-net-igmp:`/proc/net/igmp` file parser'
|
||||
'--proc-net-igmp6:`/proc/net/igmp6` file parser'
|
||||
'--proc-net-ipv6-route:`/proc/net/ipv6_route` file parser'
|
||||
'--proc-net-netlink:`/proc/net/netlink` file parser'
|
||||
'--proc-net-netstat:`/proc/net/netstat` file parser'
|
||||
'--proc-net-packet:`/proc/net/packet` file parser'
|
||||
'--proc-net-protocols:`/proc/net/protocols` file parser'
|
||||
'--proc-net-route:`/proc/net/route` file parser'
|
||||
'--proc-net-tcp:`/proc/net/tcp` and `/proc/net/tcp6` file parser'
|
||||
'--proc-net-unix:`/proc/net/unix` file parser'
|
||||
'--proc-pid-fdinfo:`/proc/<pid>/fdinfo/<fd>` file parser'
|
||||
'--proc-pid-io:`/proc/<pid>/io` file parser'
|
||||
'--proc-pid-maps:`/proc/<pid>/maps` file parser'
|
||||
'--proc-pid-mountinfo:`/proc/<pid>/mountinfo` file parser'
|
||||
'--proc-pid-numa-maps:`/proc/<pid>/numa_maps` file parser'
|
||||
'--proc-pid-smaps:`/proc/<pid>/smaps` file parser'
|
||||
'--proc-pid-stat:`/proc/<pid>/stat` file parser'
|
||||
'--proc-pid-statm:`/proc/<pid>/statm` file parser'
|
||||
'--proc-pid-status:`/proc/<pid>/status` file parser'
|
||||
'--ps:`ps` command parser'
|
||||
'--resolve-conf:`/etc/resolve.conf` file parser'
|
||||
'--route:`route` command parser'
|
||||
'--rpm-qi:`rpm -qi` command parser'
|
||||
'--rsync:`rsync` command parser'
|
||||
'--rsync-s:`rsync` command streaming parser'
|
||||
'--semver:Semantic Version string parser'
|
||||
'--sfdisk:`sfdisk` command parser'
|
||||
'--shadow:`/etc/shadow` file parser'
|
||||
'--srt:SRT file parser'
|
||||
'--ss:`ss` command parser'
|
||||
'--ssh-conf:`ssh` config file and `ssh -G` command parser'
|
||||
'--sshd-conf:`sshd` config file and `sshd -T` command parser'
|
||||
'--stat:`stat` command parser'
|
||||
'--stat-s:`stat` command streaming parser'
|
||||
'--sysctl:`sysctl` command parser'
|
||||
@@ -195,10 +282,12 @@ _jc() {
|
||||
'--time:`/usr/bin/time` command parser'
|
||||
'--timedatectl:`timedatectl status` command parser'
|
||||
'--timestamp:Unix Epoch Timestamp string parser'
|
||||
'--toml:TOML file parser'
|
||||
'--top:`top -b` command parser'
|
||||
'--top-s:`top -b` command streaming parser'
|
||||
'--tracepath:`tracepath` and `tracepath6` command parser'
|
||||
'--traceroute:`traceroute` and `traceroute6` command parser'
|
||||
'--udevadm:`udevadm info` command parser'
|
||||
'--ufw:`ufw status` command parser'
|
||||
'--ufw-appinfo:`ufw app info [application]` command parser'
|
||||
'--uname:`uname -a` command parser'
|
||||
@@ -207,21 +296,26 @@ _jc() {
|
||||
'--upower:`upower` command parser'
|
||||
'--uptime:`uptime` command parser'
|
||||
'--url:URL string parser'
|
||||
'--ver:Version string parser'
|
||||
'--veracrypt:`veracrypt` command parser'
|
||||
'--vmstat:`vmstat` command parser'
|
||||
'--vmstat-s:`vmstat` command streaming parser'
|
||||
'--w:`w` command parser'
|
||||
'--wc:`wc` command parser'
|
||||
'--who:`who` command parser'
|
||||
'--x509-cert:X.509 PEM and DER certificate file parser'
|
||||
'--x509-csr:X.509 PEM and DER certificate request file parser'
|
||||
'--xml:XML file parser'
|
||||
'--xrandr:`xrandr` command parser'
|
||||
'--yaml:YAML file parser'
|
||||
'--zipinfo:`zipinfo` command parser'
|
||||
'--zpool-iostat:`zpool iostat` command parser'
|
||||
'--zpool-status:`zpool status` command parser'
|
||||
)
|
||||
jc_options=(--force-color -C --debug -d --monochrome -m --meta-out -M --pretty -p --quiet -q --raw -r --unbuffer -u --yaml-out -y)
|
||||
jc_options_describe=(
|
||||
'--force-color:force color output even when using pipes (overrides -m)'
|
||||
'-C:force color output even when using pipes (overrides -m)'
|
||||
'--force-color:force color output (overrides -m)'
|
||||
'-C:force color output (overrides -m)'
|
||||
'--debug:debug (double for verbose debug)'
|
||||
'-d:debug (double for verbose debug)'
|
||||
'--monochrome:monochrome output'
|
||||
@@ -252,8 +346,8 @@ _jc() {
|
||||
'-y:YAML output'
|
||||
'--monochrome:monochrome output'
|
||||
'-m:monochrome output'
|
||||
'--force-color:force color output even when using pipes (overrides -m)'
|
||||
'-C:force color output even when using pipes (overrides -m)'
|
||||
'--force-color:force color output (overrides -m)'
|
||||
'-C:force color output (overrides -m)'
|
||||
)
|
||||
jc_help_options=(--help -h)
|
||||
jc_help_options_describe=(
|
||||
@@ -327,6 +421,13 @@ _jc() {
|
||||
fi
|
||||
done
|
||||
|
||||
# if "/pr[oc]" (magic for Procfile parsers) is in the current word, complete with files/directories in the path
|
||||
if [[ "${words[-1]}" =~ "/pr" ]]; then
|
||||
# run files completion
|
||||
_files
|
||||
return 0
|
||||
fi
|
||||
|
||||
# if a parser arg is found anywhere in the line, only show options and help options
|
||||
for i in ${words:0:-1}; do
|
||||
if (( $jc_parsers[(Ie)${i}] )); then
|
||||
|
||||
35
docgen.sh
35
docgen.sh
@@ -1,6 +1,9 @@
|
||||
#!/bin/bash
|
||||
# Generate docs.md
|
||||
# requires pydoc-markdown 4.6.1
|
||||
|
||||
# use ./docgen all to generate all docs
|
||||
|
||||
readme_config=$(cat <<'EOF'
|
||||
{
|
||||
"processors": [
|
||||
@@ -112,23 +115,25 @@ do
|
||||
parsers+=("$value")
|
||||
done < <(jc -a | jq -c '.parsers[] | select(.plugin != true)')
|
||||
|
||||
for parser in "${parsers[@]}"
|
||||
do (
|
||||
for parser in "${parsers[@]}"; do
|
||||
parser_name=$(jq -r '.name' <<< "$parser")
|
||||
compatible=$(jq -r '.compatible | join(", ")' <<< "$parser")
|
||||
version=$(jq -r '.version' <<< "$parser")
|
||||
author=$(jq -r '.author' <<< "$parser")
|
||||
author_email=$(jq -r '.author_email' <<< "$parser")
|
||||
{
|
||||
if [[ $1 == "all" ]] || ! git diff --quiet --exit-code HEAD~5 -- "parsers/${parser_name}.py"; then
|
||||
compatible=$(jq -r '.compatible | join(", ")' <<< "$parser")
|
||||
version=$(jq -r '.version' <<< "$parser")
|
||||
author=$(jq -r '.author' <<< "$parser")
|
||||
author_email=$(jq -r '.author_email' <<< "$parser")
|
||||
|
||||
echo "Building docs for: ${parser_name}"
|
||||
echo "[Home](https://kellyjonbrazil.github.io/jc/)" > ../docs/parsers/"${parser_name}".md
|
||||
pydoc-markdown -m jc.parsers."${parser_name}" "${parser_config}" >> ../docs/parsers/"${parser_name}".md
|
||||
echo "### Parser Information" >> ../docs/parsers/"${parser_name}".md
|
||||
echo "Compatibility: ${compatible}" >> ../docs/parsers/"${parser_name}".md
|
||||
echo >> ../docs/parsers/"${parser_name}".md
|
||||
echo "Version ${version} by ${author} (${author_email})" >> ../docs/parsers/"${parser_name}".md
|
||||
echo "+++ ${parser_name} docs complete"
|
||||
) &
|
||||
echo "Building docs for: ${parser_name}"
|
||||
echo "[Home](https://kellyjonbrazil.github.io/jc/)" > ../docs/parsers/"${parser_name}".md
|
||||
pydoc-markdown -m jc.parsers."${parser_name}" "${parser_config}" >> ../docs/parsers/"${parser_name}".md
|
||||
echo "### Parser Information" >> ../docs/parsers/"${parser_name}".md
|
||||
echo "Compatibility: ${compatible}" >> ../docs/parsers/"${parser_name}".md
|
||||
echo >> ../docs/parsers/"${parser_name}".md
|
||||
echo "Version ${version} by ${author} (${author_email})" >> ../docs/parsers/"${parser_name}".md
|
||||
echo "+++ ${parser_name} docs complete"
|
||||
fi
|
||||
} &
|
||||
done
|
||||
wait
|
||||
echo "Document Generation Complete"
|
||||
|
||||
87
docs/lib.md
87
docs/lib.md
@@ -21,27 +21,49 @@ jc - JSON Convert lib module
|
||||
### parse
|
||||
|
||||
```python
|
||||
def parse(parser_mod_name: str,
|
||||
data: Union[str, bytes, Iterable[str]],
|
||||
quiet: bool = False,
|
||||
raw: bool = False,
|
||||
ignore_exceptions: bool = None,
|
||||
**kwargs) -> Union[Dict, List[Dict], Iterator[Dict]]
|
||||
def parse(
|
||||
parser_mod_name: Union[str, ModuleType],
|
||||
data: Union[str, bytes, Iterable[str]],
|
||||
quiet: bool = False,
|
||||
raw: bool = False,
|
||||
ignore_exceptions: Optional[bool] = None,
|
||||
**kwargs
|
||||
) -> Union[JSONDictType, List[JSONDictType], Iterator[JSONDictType]]
|
||||
```
|
||||
|
||||
Parse the string data using the supplied parser module.
|
||||
Parse the data (string or bytes) using the supplied parser (string or
|
||||
module object).
|
||||
|
||||
This function provides a high-level API to simplify parser use. This
|
||||
function will call built-in parsers and custom plugin parsers.
|
||||
|
||||
Example:
|
||||
Example (standard parsers):
|
||||
|
||||
>>> import jc
|
||||
>>> jc.parse('date', 'Tue Jan 18 10:23:07 PST 2022')
|
||||
{'year': 2022, 'month': 'Jan', 'month_num': 1, 'day'...}
|
||||
>>> date_obj = jc.parse('date', 'Tue Jan 18 10:23:07 PST 2022')
|
||||
>>> print(f'The year is: {date_obj["year"]}')
|
||||
The year is: 2022
|
||||
|
||||
Example (streaming parsers):
|
||||
|
||||
>>> import jc
|
||||
>>> ping_gen = jc.parse('ping_s', ping_output.splitlines())
|
||||
>>> for item in ping_gen:
|
||||
>>> print(f'Response time: {item["time_ms"]} ms')
|
||||
Response time: 102 ms
|
||||
Response time: 109 ms
|
||||
...
|
||||
|
||||
To get a list of available parser module names, use `parser_mod_list()`.
|
||||
|
||||
Alternatively, a parser module object can be supplied:
|
||||
|
||||
>>> import jc
|
||||
>>> import jc.parsers.date as jc_date
|
||||
>>> date_obj = jc.parse(jc_date, 'Tue Jan 18 10:23:07 PST 2022')
|
||||
>>> print(f'The year is: {date_obj["year"]}')
|
||||
The year is: 2022
|
||||
|
||||
You can also use the lower-level parser modules directly:
|
||||
|
||||
>>> import jc.parsers.date
|
||||
@@ -62,11 +84,14 @@ parsers without this API:
|
||||
|
||||
Parameters:
|
||||
|
||||
parser_mod_name: (string) name of the parser module. This
|
||||
function will accept module_name,
|
||||
parser_mod_name: (string or name of the parser module. This
|
||||
Module) function will accept module_name,
|
||||
cli-name, and --argument-name
|
||||
variants of the module name.
|
||||
|
||||
A Module object can also be passed
|
||||
directly or via _get_parser()
|
||||
|
||||
data: (string or data to parse (string or bytes for
|
||||
bytes or standard parsers, iterable of
|
||||
iterable) strings for streaming parsers)
|
||||
@@ -88,7 +113,8 @@ Returns:
|
||||
### parser\_mod\_list
|
||||
|
||||
```python
|
||||
def parser_mod_list() -> List[str]
|
||||
def parser_mod_list(show_hidden: bool = False,
|
||||
show_deprecated: bool = False) -> List[str]
|
||||
```
|
||||
|
||||
Returns a list of all available parser module names.
|
||||
@@ -98,7 +124,8 @@ Returns a list of all available parser module names.
|
||||
### plugin\_parser\_mod\_list
|
||||
|
||||
```python
|
||||
def plugin_parser_mod_list() -> List[str]
|
||||
def plugin_parser_mod_list(show_hidden: bool = False,
|
||||
show_deprecated: bool = False) -> List[str]
|
||||
```
|
||||
|
||||
Returns a list of plugin parser module names. This function is a
|
||||
@@ -109,7 +136,8 @@ subset of `parser_mod_list()`.
|
||||
### standard\_parser\_mod\_list
|
||||
|
||||
```python
|
||||
def standard_parser_mod_list() -> List[str]
|
||||
def standard_parser_mod_list(show_hidden: bool = False,
|
||||
show_deprecated: bool = False) -> List[str]
|
||||
```
|
||||
|
||||
Returns a list of standard parser module names. This function is a
|
||||
@@ -121,7 +149,8 @@ parsers.
|
||||
### streaming\_parser\_mod\_list
|
||||
|
||||
```python
|
||||
def streaming_parser_mod_list() -> List[str]
|
||||
def streaming_parser_mod_list(show_hidden: bool = False,
|
||||
show_deprecated: bool = False) -> List[str]
|
||||
```
|
||||
|
||||
Returns a list of streaming parser module names. This function is a
|
||||
@@ -132,17 +161,19 @@ subset of `parser_mod_list()`.
|
||||
### parser\_info
|
||||
|
||||
```python
|
||||
def parser_info(parser_mod_name: str, documentation: bool = False) -> Dict
|
||||
def parser_info(parser_mod_name: Union[str, ModuleType],
|
||||
documentation: bool = False) -> ParserInfoType
|
||||
```
|
||||
|
||||
Returns a dictionary that includes the parser module metadata.
|
||||
|
||||
Parameters:
|
||||
|
||||
parser_mod_name: (string) name of the parser module. This
|
||||
function will accept module_name,
|
||||
parser_mod_name: (string or name of the parser module. This
|
||||
Module) function will accept module_name,
|
||||
cli-name, and --argument-name
|
||||
variants of the module name.
|
||||
variants of the module name as well
|
||||
as a parser module object.
|
||||
|
||||
documentation: (boolean) include parser docstring if True
|
||||
|
||||
@@ -151,26 +182,34 @@ Parameters:
|
||||
### all\_parser\_info
|
||||
|
||||
```python
|
||||
def all_parser_info(documentation: bool = False) -> List[Dict]
|
||||
def all_parser_info(documentation: bool = False,
|
||||
show_hidden: bool = False,
|
||||
show_deprecated: bool = False) -> List[ParserInfoType]
|
||||
```
|
||||
|
||||
Returns a list of dictionaries that includes metadata for all parser
|
||||
modules.
|
||||
modules. By default only non-hidden, non-deprecated parsers are
|
||||
returned.
|
||||
|
||||
Parameters:
|
||||
|
||||
documentation: (boolean) include parser docstrings if True
|
||||
show_hidden: (boolean) also show parsers marked as hidden
|
||||
in their info metadata.
|
||||
show_deprecated: (boolean) also show parsers marked as
|
||||
deprecated in their info metadata.
|
||||
|
||||
<a id="jc.lib.get_help"></a>
|
||||
|
||||
### get\_help
|
||||
|
||||
```python
|
||||
def get_help(parser_mod_name: str) -> None
|
||||
def get_help(parser_mod_name: Union[str, ModuleType]) -> None
|
||||
```
|
||||
|
||||
Show help screen for the selected parser.
|
||||
|
||||
This function will accept **module_name**, **cli-name**, and
|
||||
**--argument-name** variants of the module name string.
|
||||
**--argument-name** variants of the module name string as well as a
|
||||
parser module object.
|
||||
|
||||
|
||||
@@ -250,4 +250,4 @@ Returns:
|
||||
### Parser Information
|
||||
Compatibility: linux
|
||||
|
||||
Version 1.4 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
Version 1.6 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
|
||||
@@ -140,4 +140,4 @@ Returns:
|
||||
### Parser Information
|
||||
Compatibility: linux, aix, freebsd, darwin
|
||||
|
||||
Version 1.10 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
Version 1.12 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
|
||||
133
docs/parsers/bluetoothctl.md
Normal file
133
docs/parsers/bluetoothctl.md
Normal file
@@ -0,0 +1,133 @@
|
||||
[Home](https://kellyjonbrazil.github.io/jc/)
|
||||
<a id="jc.parsers.bluetoothctl"></a>
|
||||
|
||||
# jc.parsers.bluetoothctl
|
||||
|
||||
jc - JSON Convert `bluetoothctl` command output parser
|
||||
|
||||
Supports the following `bluetoothctl` subcommands:
|
||||
- `bluetoothctl list`
|
||||
- `bluetoothctl show`
|
||||
- `bluetoothctl show <ctrl>`
|
||||
- `bluetoothctl devices`
|
||||
- `bluetoothctl info <dev>`
|
||||
|
||||
Usage (cli):
|
||||
|
||||
$ bluetoothctl info <dev> | jc --bluetoothctl
|
||||
or
|
||||
|
||||
$ jc bluetoothctl info <dev>
|
||||
|
||||
Usage (module):
|
||||
|
||||
import jc
|
||||
result = jc.parse('bluetoothctl', bluetoothctl_command_output)
|
||||
|
||||
Schema:
|
||||
|
||||
Because bluetoothctl is handling two main entities, controllers and devices,
|
||||
the schema is shared between them. Most of the fields are common between
|
||||
a controller and a device but there might be fields corresponding to one entity.
|
||||
|
||||
Controller:
|
||||
[
|
||||
{
|
||||
"name": string,
|
||||
"is_default": boolean,
|
||||
"is_public": boolean,
|
||||
"is_random": boolean,
|
||||
"address": string,
|
||||
"alias": string,
|
||||
"class": string,
|
||||
"powered": string,
|
||||
"discoverable": string,
|
||||
"discoverable_timeout": string,
|
||||
"pairable": string,
|
||||
"modalias": string,
|
||||
"discovering": string,
|
||||
"uuids": array
|
||||
}
|
||||
]
|
||||
|
||||
Device:
|
||||
[
|
||||
{
|
||||
"name": string,
|
||||
"is_public": boolean,
|
||||
"is_random": boolean,
|
||||
"address": string,
|
||||
"alias": string,
|
||||
"appearance": string,
|
||||
"class": string,
|
||||
"icon": string,
|
||||
"paired": string,
|
||||
"bonded": string,
|
||||
"trusted": string,
|
||||
"blocked": string,
|
||||
"connected": string,
|
||||
"legacy_pairing": string,
|
||||
"rssi": int,
|
||||
"txpower": int,
|
||||
"uuids": array,
|
||||
"modalias": string
|
||||
}
|
||||
]
|
||||
|
||||
Examples:
|
||||
|
||||
$ bluetoothctl info EB:06:EF:62:B3:19 | jc --bluetoothctl -p
|
||||
[
|
||||
{
|
||||
"address": "22:06:33:62:B3:19",
|
||||
"is_public": true,
|
||||
"name": "TaoTronics TT-BH336",
|
||||
"alias": "TaoTronics TT-BH336",
|
||||
"class": "0x00240455",
|
||||
"icon": "audio-headset",
|
||||
"paired": "no",
|
||||
"bonded": "no",
|
||||
"trusted": "no",
|
||||
"blocked": "no",
|
||||
"connected": "no",
|
||||
"legacy_pairing": "no",
|
||||
"uuids": [
|
||||
"Advanced Audio Distribu.. (0000120d-0000-1000-8000-00805f9b34fb)",
|
||||
"Audio Sink (0000130b-0000-1000-8000-00805f9b34fb)",
|
||||
"A/V Remote Control (0000140e-0000-1000-8000-00805f9b34fb)",
|
||||
"A/V Remote Control Cont.. (0000150f-0000-1000-8000-00805f9b34fb)",
|
||||
"Handsfree (0000161e-0000-1000-8000-00805f9b34fb)",
|
||||
"Headset (00001708-0000-1000-8000-00805f9b34fb)",
|
||||
"Headset HS (00001831-0000-1000-8000-00805f9b34fb)"
|
||||
],
|
||||
"rssi": -52,
|
||||
"txpower": 4
|
||||
}
|
||||
]
|
||||
|
||||
<a id="jc.parsers.bluetoothctl.parse"></a>
|
||||
|
||||
### parse
|
||||
|
||||
```python
|
||||
def parse(data: str,
|
||||
raw: bool = False,
|
||||
quiet: bool = False) -> List[JSONDictType]
|
||||
```
|
||||
|
||||
Main text parsing function
|
||||
|
||||
Parameters:
|
||||
|
||||
data: (string) text data to parse
|
||||
raw: (boolean) unprocessed output if True
|
||||
quiet: (boolean) suppress warning messages if True
|
||||
|
||||
Returns:
|
||||
|
||||
List of Dictionaries. Raw or processed structured data.
|
||||
|
||||
### Parser Information
|
||||
Compatibility: linux
|
||||
|
||||
Version 1.1 by Jake Ob (iakopap at gmail.com)
|
||||
125
docs/parsers/cbt.md
Normal file
125
docs/parsers/cbt.md
Normal file
@@ -0,0 +1,125 @@
|
||||
[Home](https://kellyjonbrazil.github.io/jc/)
|
||||
<a id="jc.parsers.cbt"></a>
|
||||
|
||||
# jc.parsers.cbt
|
||||
|
||||
jc - JSON Convert `cbt` command output parser (Google Bigtable)
|
||||
|
||||
Parses the human-, but not machine-, friendly output of the cbt command (for
|
||||
Google's Bigtable).
|
||||
|
||||
No effort is made to convert the data types of the values in the cells.
|
||||
|
||||
The `timestamp_epoch` calculated timestamp field is naive. (i.e. based on
|
||||
the local time of the system the parser is run on)
|
||||
|
||||
The `timestamp_epoch_utc` calculated timestamp field is timezone-aware and
|
||||
is only available if the timestamp has a UTC timezone.
|
||||
|
||||
The `timestamp_iso` calculated timestamp field will only include UTC
|
||||
timezone information if the timestamp has a UTC timezone.
|
||||
|
||||
Raw output contains all cells for each column (including timestamps), while
|
||||
the normal output contains only the latest value for each column.
|
||||
|
||||
Usage (cli):
|
||||
|
||||
$ cbt | jc --cbt
|
||||
|
||||
or
|
||||
|
||||
$ jc cbt
|
||||
|
||||
Usage (module):
|
||||
|
||||
import jc
|
||||
result = jc.parse('cbt', cbt_command_output)
|
||||
|
||||
Schema:
|
||||
|
||||
[
|
||||
{
|
||||
"key": string,
|
||||
"cells": {
|
||||
<string>: { # column family
|
||||
<string>: string # column: value
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
Schema (raw):
|
||||
|
||||
[
|
||||
{
|
||||
"key": string,
|
||||
"cells": [
|
||||
{
|
||||
"column_family": string,
|
||||
"column": string,
|
||||
"value": string,
|
||||
"timestamp_iso": string,
|
||||
"timestamp_epoch": integer,
|
||||
"timestamp_epoch_utc": integer
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
Examples:
|
||||
|
||||
$ cbt -project=$PROJECT -instance=$INSTANCE lookup $TABLE foo | jc --cbt -p
|
||||
[
|
||||
{
|
||||
"key": "foo",
|
||||
"cells": {
|
||||
"foo": {
|
||||
"bar": "baz"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
$ cbt -project=$PROJECT -instance=$INSTANCE lookup $TABLE foo | jc --cbt -p -r
|
||||
[
|
||||
{
|
||||
"key": "foo",
|
||||
"cells": [
|
||||
{
|
||||
"column_family": "foo",
|
||||
"column": "bar",
|
||||
"value": "baz1",
|
||||
"timestamp_iso": "1970-01-01T01:00:00",
|
||||
"timestamp_epoch": 32400,
|
||||
"timestamp_epoch_utc": null
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
<a id="jc.parsers.cbt.parse"></a>
|
||||
|
||||
### parse
|
||||
|
||||
```python
|
||||
def parse(data: str,
|
||||
raw: bool = False,
|
||||
quiet: bool = False) -> List[JSONDictType]
|
||||
```
|
||||
|
||||
Main text parsing function
|
||||
|
||||
Parameters:
|
||||
|
||||
data: (string) text data to parse
|
||||
raw: (boolean) unprocessed output if True
|
||||
quiet: (boolean) suppress warning messages if True
|
||||
|
||||
Returns:
|
||||
|
||||
List of Dictionaries. Raw or processed structured data.
|
||||
|
||||
### Parser Information
|
||||
Compatibility: linux, darwin, cygwin, win32, aix, freebsd
|
||||
|
||||
Version 1.0 by Andreas Weiden (andreas.weiden@gmail.com)
|
||||
161
docs/parsers/certbot.md
Normal file
161
docs/parsers/certbot.md
Normal file
@@ -0,0 +1,161 @@
|
||||
[Home](https://kellyjonbrazil.github.io/jc/)
|
||||
<a id="jc.parsers.certbot"></a>
|
||||
|
||||
# jc.parsers.certbot
|
||||
|
||||
jc - JSON Convert `certbot` command output parser
|
||||
|
||||
Supports the following `certbot` commands:
|
||||
|
||||
- `certbot show_account`
|
||||
- `certbot certificates`
|
||||
|
||||
Verbose options are not supported.
|
||||
|
||||
Usage (cli):
|
||||
|
||||
$ certbot show_account | jc --certbot
|
||||
$ certbot certificates | jc --certbot
|
||||
|
||||
or
|
||||
|
||||
$ jc certbot show_account
|
||||
$ jc certbot certificates
|
||||
|
||||
Usage (module):
|
||||
|
||||
import jc
|
||||
result = jc.parse('certbot', certbot_command_output)
|
||||
|
||||
Schema:
|
||||
|
||||
{
|
||||
"certificates": [
|
||||
{
|
||||
"name": string,
|
||||
"serial_number": string,
|
||||
"key_type": string,
|
||||
"domains": [
|
||||
string
|
||||
],
|
||||
"expiration_date": string,
|
||||
"expiration_date_epoch": integer,
|
||||
"expiration_date_epoch_utc": integer,
|
||||
"expiration_date_iso": string,
|
||||
"validity": string,
|
||||
"certificate_path": string,
|
||||
"private_key_path": string
|
||||
}
|
||||
],
|
||||
"account": {
|
||||
"server": string,
|
||||
"url": string,
|
||||
"email": string
|
||||
}
|
||||
}
|
||||
|
||||
Examples:
|
||||
|
||||
$ certbot certificates | jc --certbot -p
|
||||
{
|
||||
"certificates": [
|
||||
{
|
||||
"name": "example.com",
|
||||
"serial_number": "3f7axxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
|
||||
"key_type": "RSA",
|
||||
"domains": [
|
||||
"example.com",
|
||||
"www.example.com"
|
||||
],
|
||||
"expiration_date": "2023-05-11 01:33:10+00:00",
|
||||
"validity": "63 days",
|
||||
"certificate_path": "/etc/letsencrypt/live/example.com/chain.pem",
|
||||
"private_key_path": "/etc/letsencrypt/live/example.com/priv.pem",
|
||||
"expiration_date_epoch": 1683793990,
|
||||
"expiration_date_epoch_utc": 1683768790,
|
||||
"expiration_date_iso": "2023-05-11T01:33:10+00:00"
|
||||
},
|
||||
{
|
||||
"name": "example.org",
|
||||
"serial_number": "3bcyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy",
|
||||
"key_type": "RSA",
|
||||
"domains": [
|
||||
"example.org",
|
||||
"www.example.org"
|
||||
],
|
||||
"expiration_date": "2023-06-12 01:35:30+00:00",
|
||||
"validity": "63 days",
|
||||
"certificate_path": "/etc/letsencrypt/live/example.org/chain.pem",
|
||||
"private_key_path": "/etc/letsencrypt/live/example.org/key.pem",
|
||||
"expiration_date_epoch": 1686558930,
|
||||
"expiration_date_epoch_utc": 1686533730,
|
||||
"expiration_date_iso": "2023-06-12T01:35:30+00:00"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
$ certbot certificates | jc --certbot -p -r
|
||||
{
|
||||
"certificates": [
|
||||
{
|
||||
"name": "example.com",
|
||||
"serial_number": "3f7axxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
|
||||
"key_type": "RSA",
|
||||
"domains": [
|
||||
"example.com",
|
||||
"www.example.com"
|
||||
],
|
||||
"expiration_date": "2023-05-11 01:33:10+00:00",
|
||||
"validity": "63 days",
|
||||
"certificate_path": "/etc/letsencrypt/live/example.com/chain.pem",
|
||||
"private_key_path": "/etc/letsencrypt/live/example.com/priv.pem"
|
||||
},
|
||||
{
|
||||
"name": "example.org",
|
||||
"serial_number": "3bcyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy",
|
||||
"key_type": "RSA",
|
||||
"domains": [
|
||||
"example.org",
|
||||
"www.example.org"
|
||||
],
|
||||
"expiration_date": "2023-06-12 01:35:30+00:00",
|
||||
"validity": "63 days",
|
||||
"certificate_path": "/etc/letsencrypt/live/example.org/chain.pem",
|
||||
"private_key_path": "/etc/letsencrypt/live/example.org/key.pem"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
$ certbot show_account | jc --certbot -p
|
||||
{
|
||||
"account": {
|
||||
"server": "https://acme-staging-v02.api.letsencrypt.org/directory",
|
||||
"url": "https://acme-staging-v02.api.letsencrypt.org/acme/acct/123",
|
||||
"email": "some@example.com"
|
||||
}
|
||||
}
|
||||
|
||||
<a id="jc.parsers.certbot.parse"></a>
|
||||
|
||||
### parse
|
||||
|
||||
```python
|
||||
def parse(data: str, raw: bool = False, quiet: bool = False) -> JSONDictType
|
||||
```
|
||||
|
||||
Main text parsing function
|
||||
|
||||
Parameters:
|
||||
|
||||
data: (string) text data to parse
|
||||
raw: (boolean) unprocessed output if True
|
||||
quiet: (boolean) suppress warning messages if True
|
||||
|
||||
Returns:
|
||||
|
||||
Dictionary. Raw or processed structured data.
|
||||
|
||||
### Parser Information
|
||||
Compatibility: linux, darwin, cygwin, win32, aix, freebsd
|
||||
|
||||
Version 1.2 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
199
docs/parsers/clf.md
Normal file
199
docs/parsers/clf.md
Normal file
@@ -0,0 +1,199 @@
|
||||
[Home](https://kellyjonbrazil.github.io/jc/)
|
||||
<a id="jc.parsers.clf"></a>
|
||||
|
||||
# jc.parsers.clf
|
||||
|
||||
jc - JSON Convert Common Log Format file parser
|
||||
|
||||
This parser will handle the Common Log Format standard as specified at
|
||||
https://www.w3.org/Daemon/User/Config/Logging.html#common-logfile-format.
|
||||
|
||||
Combined Log Format is also supported. (Referer and User Agent fields added)
|
||||
|
||||
Extra fields may be present and will be enclosed in the `extra` field as
|
||||
a single string.
|
||||
|
||||
If a log line cannot be parsed, an object with an `unparsable` field will
|
||||
be present with a value of the original line.
|
||||
|
||||
The `epoch` calculated timestamp field is naive. (i.e. based on the
|
||||
local time of the system the parser is run on)
|
||||
|
||||
The `epoch_utc` calculated timestamp field is timezone-aware and is
|
||||
only available if the timezone field is UTC.
|
||||
|
||||
Usage (cli):
|
||||
|
||||
$ cat file.log | jc --clf
|
||||
|
||||
Usage (module):
|
||||
|
||||
import jc
|
||||
result = jc.parse('clf', common_log_file_output)
|
||||
|
||||
Schema:
|
||||
|
||||
Empty strings and `-` values are converted to `null`/`None`.
|
||||
|
||||
[
|
||||
{
|
||||
"host": string,
|
||||
"ident": string,
|
||||
"authuser": string,
|
||||
"date": string,
|
||||
"day": integer,
|
||||
"month": string,
|
||||
"year": integer,
|
||||
"hour": integer,
|
||||
"minute": integer,
|
||||
"second": integer,
|
||||
"tz": string,
|
||||
"request": string,
|
||||
"request_method": string,
|
||||
"request_url": string,
|
||||
"request_version": string,
|
||||
"status": integer,
|
||||
"bytes": integer,
|
||||
"referer": string,
|
||||
"user_agent": string,
|
||||
"extra": string,
|
||||
"epoch": integer, # [0]
|
||||
"epoch_utc": integer, # [1]
|
||||
"unparsable": string # [2]
|
||||
}
|
||||
]
|
||||
|
||||
[0] naive timestamp
|
||||
[1] timezone-aware timestamp. Only available if timezone field is UTC
|
||||
[2] exists if the line was not able to be parsed
|
||||
|
||||
Examples:
|
||||
|
||||
$ cat file.log | jc --clf -p
|
||||
[
|
||||
{
|
||||
"host": "127.0.0.1",
|
||||
"ident": "user-identifier",
|
||||
"authuser": "frank",
|
||||
"date": "10/Oct/2000:13:55:36 -0700",
|
||||
"day": 10,
|
||||
"month": "Oct",
|
||||
"year": 2000,
|
||||
"hour": 13,
|
||||
"minute": 55,
|
||||
"second": 36,
|
||||
"tz": "-0700",
|
||||
"request": "GET /apache_pb.gif HTTPS/1.0",
|
||||
"status": 200,
|
||||
"bytes": 2326,
|
||||
"referer": null,
|
||||
"user_agent": null,
|
||||
"extra": null,
|
||||
"request_method": "GET",
|
||||
"request_url": "/apache_pb.gif",
|
||||
"request_version": "HTTPS/1.0",
|
||||
"epoch": 971211336,
|
||||
"epoch_utc": null
|
||||
},
|
||||
{
|
||||
"host": "1.1.1.2",
|
||||
"ident": null,
|
||||
"authuser": null,
|
||||
"date": "11/Nov/2016:03:04:55 +0100",
|
||||
"day": 11,
|
||||
"month": "Nov",
|
||||
"year": 2016,
|
||||
"hour": 3,
|
||||
"minute": 4,
|
||||
"second": 55,
|
||||
"tz": "+0100",
|
||||
"request": "GET /",
|
||||
"status": 200,
|
||||
"bytes": 83,
|
||||
"referer": null,
|
||||
"user_agent": null,
|
||||
"extra": "- 9221 1.1.1.1",
|
||||
"request_method": "GET",
|
||||
"request_url": "/",
|
||||
"request_version": null,
|
||||
"epoch": 1478862295,
|
||||
"epoch_utc": null
|
||||
},
|
||||
...
|
||||
]
|
||||
|
||||
$ cat file.log | jc --clf -p -r
|
||||
[
|
||||
{
|
||||
"host": "127.0.0.1",
|
||||
"ident": "user-identifier",
|
||||
"authuser": "frank",
|
||||
"date": "10/Oct/2000:13:55:36 -0700",
|
||||
"day": "10",
|
||||
"month": "Oct",
|
||||
"year": "2000",
|
||||
"hour": "13",
|
||||
"minute": "55",
|
||||
"second": "36",
|
||||
"tz": "-0700",
|
||||
"request": "GET /apache_pb.gif HTTPS/1.0",
|
||||
"status": "200",
|
||||
"bytes": "2326",
|
||||
"referer": null,
|
||||
"user_agent": null,
|
||||
"extra": "",
|
||||
"request_method": "GET",
|
||||
"request_url": "/apache_pb.gif",
|
||||
"request_version": "HTTPS/1.0"
|
||||
},
|
||||
{
|
||||
"host": "1.1.1.2",
|
||||
"ident": "-",
|
||||
"authuser": "-",
|
||||
"date": "11/Nov/2016:03:04:55 +0100",
|
||||
"day": "11",
|
||||
"month": "Nov",
|
||||
"year": "2016",
|
||||
"hour": "03",
|
||||
"minute": "04",
|
||||
"second": "55",
|
||||
"tz": "+0100",
|
||||
"request": "GET /",
|
||||
"status": "200",
|
||||
"bytes": "83",
|
||||
"referer": "-",
|
||||
"user_agent": "-",
|
||||
"extra": "- 9221 1.1.1.1",
|
||||
"request_method": "GET",
|
||||
"request_url": "/",
|
||||
"request_version": null
|
||||
},
|
||||
...
|
||||
]
|
||||
|
||||
<a id="jc.parsers.clf.parse"></a>
|
||||
|
||||
### parse
|
||||
|
||||
```python
|
||||
def parse(data: str,
|
||||
raw: bool = False,
|
||||
quiet: bool = False) -> List[JSONDictType]
|
||||
```
|
||||
|
||||
Main text parsing function
|
||||
|
||||
Parameters:
|
||||
|
||||
data: (string) text data to parse
|
||||
raw: (boolean) unprocessed output if True
|
||||
quiet: (boolean) suppress warning messages if True
|
||||
|
||||
Returns:
|
||||
|
||||
List of Dictionaries. Raw or processed structured data.
|
||||
|
||||
### Parser Information
|
||||
Compatibility: linux, darwin, cygwin, win32, aix, freebsd
|
||||
|
||||
Version 1.0 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
117
docs/parsers/clf_s.md
Normal file
117
docs/parsers/clf_s.md
Normal file
@@ -0,0 +1,117 @@
|
||||
[Home](https://kellyjonbrazil.github.io/jc/)
|
||||
<a id="jc.parsers.clf_s"></a>
|
||||
|
||||
# jc.parsers.clf\_s
|
||||
|
||||
jc - JSON Convert Common Log Format file streaming parser
|
||||
|
||||
> This streaming parser outputs JSON Lines (cli) or returns an Iterable of
|
||||
> Dictionaries (module)
|
||||
|
||||
This parser will handle the Common Log Format standard as specified at
|
||||
https://www.w3.org/Daemon/User/Config/Logging.html#common-logfile-format.
|
||||
|
||||
Combined Log Format is also supported. (Referer and User Agent fields added)
|
||||
|
||||
Extra fields may be present and will be enclosed in the `extra` field as
|
||||
a single string.
|
||||
|
||||
If a log line cannot be parsed, an object with an `unparsable` field will
|
||||
be present with a value of the original line.
|
||||
|
||||
The `epoch` calculated timestamp field is naive. (i.e. based on the
|
||||
local time of the system the parser is run on)
|
||||
|
||||
The `epoch_utc` calculated timestamp field is timezone-aware and is
|
||||
only available if the timezone field is UTC.
|
||||
|
||||
Usage (cli):
|
||||
|
||||
$ cat file.log | jc --clf-s
|
||||
|
||||
Usage (module):
|
||||
|
||||
import jc
|
||||
|
||||
result = jc.parse('clf_s', common_log_file_output.splitlines())
|
||||
for item in result:
|
||||
# do something
|
||||
|
||||
Schema:
|
||||
|
||||
Empty strings and `-` values are converted to `null`/`None`.
|
||||
|
||||
{
|
||||
"host": string,
|
||||
"ident": string,
|
||||
"authuser": string,
|
||||
"date": string,
|
||||
"day": integer,
|
||||
"month": string,
|
||||
"year": integer,
|
||||
"hour": integer,
|
||||
"minute": integer,
|
||||
"second": integer,
|
||||
"tz": string,
|
||||
"request": string,
|
||||
"request_method": string,
|
||||
"request_url": string,
|
||||
"request_version": string,
|
||||
"status": integer,
|
||||
"bytes": integer,
|
||||
"referer": string,
|
||||
"user_agent": string,
|
||||
"extra": string,
|
||||
"epoch": integer, # [0]
|
||||
"epoch_utc": integer, # [1]
|
||||
"unparsable": string # [2]
|
||||
}
|
||||
|
||||
[0] naive timestamp
|
||||
[1] timezone-aware timestamp. Only available if timezone field is UTC
|
||||
[2] exists if the line was not able to be parsed
|
||||
|
||||
Examples:
|
||||
|
||||
$ cat file.log | jc --clf-s
|
||||
{"host":"127.0.0.1","ident":"user-identifier","authuser":"frank","...}
|
||||
{"host":"1.1.1.2","ident":null,"authuser":null,"date":"11/Nov/2016...}
|
||||
...
|
||||
|
||||
$ cat file.log | jc --clf-s -r
|
||||
{"host":"127.0.0.1","ident":"user-identifier","authuser":"frank","...}
|
||||
{"host":"1.1.1.2","ident":"-","authuser":"-","date":"11/Nov/2016:0...}
|
||||
...
|
||||
|
||||
<a id="jc.parsers.clf_s.parse"></a>
|
||||
|
||||
### parse
|
||||
|
||||
```python
|
||||
@add_jc_meta
|
||||
def parse(data: Iterable[str],
|
||||
raw: bool = False,
|
||||
quiet: bool = False,
|
||||
ignore_exceptions: bool = False) -> StreamingOutputType
|
||||
```
|
||||
|
||||
Main text parsing generator function. Returns an iterable object.
|
||||
|
||||
Parameters:
|
||||
|
||||
data: (iterable) line-based text data to parse
|
||||
(e.g. sys.stdin or str.splitlines())
|
||||
|
||||
raw: (boolean) unprocessed output if True
|
||||
quiet: (boolean) suppress warning messages if True
|
||||
ignore_exceptions: (boolean) ignore parsing exceptions if True
|
||||
|
||||
|
||||
Returns:
|
||||
|
||||
Iterable of Dictionaries
|
||||
|
||||
### Parser Information
|
||||
Compatibility: linux, darwin, cygwin, win32, aix, freebsd
|
||||
|
||||
Version 1.0 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
@@ -196,4 +196,4 @@ Returns:
|
||||
### Parser Information
|
||||
Compatibility: linux, darwin, aix, freebsd
|
||||
|
||||
Version 1.6 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
Version 1.8 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
|
||||
@@ -193,4 +193,4 @@ Returns:
|
||||
### Parser Information
|
||||
Compatibility: linux, darwin, aix, freebsd
|
||||
|
||||
Version 1.7 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
Version 1.9 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
|
||||
@@ -82,7 +82,9 @@ Examples:
|
||||
### parse
|
||||
|
||||
```python
|
||||
def parse(data, raw=False, quiet=False)
|
||||
def parse(data: Union[str, bytes],
|
||||
raw: bool = False,
|
||||
quiet: bool = False) -> List[JSONDictType]
|
||||
```
|
||||
|
||||
Main text parsing function
|
||||
@@ -100,4 +102,4 @@ Returns:
|
||||
### Parser Information
|
||||
Compatibility: linux, darwin, cygwin, win32, aix, freebsd
|
||||
|
||||
Version 1.4 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
Version 1.5 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
|
||||
@@ -86,4 +86,4 @@ Returns:
|
||||
### Parser Information
|
||||
Compatibility: linux, darwin, cygwin, win32, aix, freebsd
|
||||
|
||||
Version 1.3 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
Version 1.4 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
|
||||
91
docs/parsers/datetime_iso.md
Normal file
91
docs/parsers/datetime_iso.md
Normal file
@@ -0,0 +1,91 @@
|
||||
[Home](https://kellyjonbrazil.github.io/jc/)
|
||||
<a id="jc.parsers.datetime_iso"></a>
|
||||
|
||||
# jc.parsers.datetime\_iso
|
||||
|
||||
jc - JSON Convert ISO 8601 Datetime string parser
|
||||
|
||||
This parser supports standard ISO 8601 strings that include both date and
|
||||
time. If no timezone or offset information is available in the string, then
|
||||
UTC timezone is used.
|
||||
|
||||
Usage (cli):
|
||||
|
||||
$ echo "2022-07-20T14:52:45Z" | jc --iso-datetime
|
||||
|
||||
Usage (module):
|
||||
|
||||
import jc
|
||||
result = jc.parse('iso_datetime', iso_8601_string)
|
||||
|
||||
Schema:
|
||||
|
||||
{
|
||||
"year": integer,
|
||||
"month": string,
|
||||
"month_num": integer,
|
||||
"day": integer,
|
||||
"weekday": string,
|
||||
"weekday_num": integer,
|
||||
"hour": integer,
|
||||
"hour_24": integer,
|
||||
"minute": integer,
|
||||
"second": integer,
|
||||
"microsecond": integer,
|
||||
"period": string,
|
||||
"utc_offset": string,
|
||||
"day_of_year": integer,
|
||||
"week_of_year": integer,
|
||||
"iso": string,
|
||||
"timestamp": integer # [0]
|
||||
}
|
||||
|
||||
[0] timezone aware UNIX timestamp expressed in UTC
|
||||
|
||||
Examples:
|
||||
|
||||
$ echo "2022-07-20T14:52:45Z" | jc --iso-datetime -p
|
||||
{
|
||||
"year": 2022,
|
||||
"month": "Jul",
|
||||
"month_num": 7,
|
||||
"day": 20,
|
||||
"weekday": "Wed",
|
||||
"weekday_num": 3,
|
||||
"hour": 2,
|
||||
"hour_24": 14,
|
||||
"minute": 52,
|
||||
"second": 45,
|
||||
"microsecond": 0,
|
||||
"period": "PM",
|
||||
"utc_offset": "+0000",
|
||||
"day_of_year": 201,
|
||||
"week_of_year": 29,
|
||||
"iso": "2022-07-20T14:52:45+00:00",
|
||||
"timestamp": 1658328765
|
||||
}
|
||||
|
||||
<a id="jc.parsers.datetime_iso.parse"></a>
|
||||
|
||||
### parse
|
||||
|
||||
```python
|
||||
def parse(data, raw=False, quiet=False)
|
||||
```
|
||||
|
||||
Main text parsing function
|
||||
|
||||
Parameters:
|
||||
|
||||
data: (string) text data to parse
|
||||
raw: (boolean) unprocessed output if True
|
||||
quiet: (boolean) suppress warning messages if True
|
||||
|
||||
Returns:
|
||||
|
||||
Dictionary. Raw or processed structured data.
|
||||
|
||||
### Parser Information
|
||||
Compatibility: linux, aix, freebsd, darwin, win32, cygwin
|
||||
|
||||
Version 1.0 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
@@ -9,6 +9,7 @@ Options supported:
|
||||
- `+noall +answer` options are supported in cases where only the answer
|
||||
information is desired.
|
||||
- `+axfr` option is supported on its own
|
||||
- `+nsid` option is supported
|
||||
|
||||
The `when_epoch` calculated timestamp field is naive. (i.e. based on the
|
||||
local time of the system the parser is run on)
|
||||
@@ -106,7 +107,7 @@ Schema:
|
||||
]
|
||||
|
||||
[0] naive timestamp if "when" field is parsable, else null
|
||||
[1] timezone aware timestamp availabe for UTC, else null
|
||||
[1] timezone aware timestamp available for UTC, else null
|
||||
|
||||
Examples:
|
||||
|
||||
@@ -345,4 +346,4 @@ Returns:
|
||||
### Parser Information
|
||||
Compatibility: linux, aix, freebsd, darwin, win32, cygwin
|
||||
|
||||
Version 2.4 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
Version 2.5 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
|
||||
@@ -5,6 +5,10 @@
|
||||
|
||||
jc - JSON Convert `du` command output parser
|
||||
|
||||
The `du -h` option is not supported with the default output. If you
|
||||
would like to use `du -h` or other options that change the output, be sure
|
||||
to use `jc --raw` (cli) or `raw=True` (module).
|
||||
|
||||
Usage (cli):
|
||||
|
||||
$ du | jc --du
|
||||
|
||||
82
docs/parsers/find.md
Normal file
82
docs/parsers/find.md
Normal file
@@ -0,0 +1,82 @@
|
||||
[Home](https://kellyjonbrazil.github.io/jc/)
|
||||
<a id="jc.parsers.find"></a>
|
||||
|
||||
# jc.parsers.find
|
||||
|
||||
jc - JSON Convert `find` command output parser
|
||||
|
||||
This parser returns a list of objects by default and a list of strings if
|
||||
the `--raw` option is used.
|
||||
|
||||
Usage (cli):
|
||||
|
||||
$ find | jc --find
|
||||
|
||||
Usage (module):
|
||||
|
||||
import jc
|
||||
result = jc.parse('find', find_command_output)
|
||||
|
||||
Schema:
|
||||
|
||||
[
|
||||
{
|
||||
"path": string,
|
||||
"node": string,
|
||||
"error": string
|
||||
}
|
||||
]
|
||||
|
||||
Examples:
|
||||
|
||||
$ find | jc --find -p
|
||||
[
|
||||
{
|
||||
"path": "./directory"
|
||||
"node": "filename"
|
||||
},
|
||||
{
|
||||
"path": "./anotherdirectory"
|
||||
"node": "anotherfile"
|
||||
},
|
||||
{
|
||||
"path": null
|
||||
"node": null
|
||||
"error": "find: './inaccessible': Permission denied"
|
||||
}
|
||||
...
|
||||
]
|
||||
|
||||
$ find | jc --find -p -r
|
||||
[
|
||||
"./templates/readme_template",
|
||||
"./templates/manpage_template",
|
||||
"./.github/workflows/pythonapp.yml",
|
||||
...
|
||||
]
|
||||
|
||||
<a id="jc.parsers.find.parse"></a>
|
||||
|
||||
### parse
|
||||
|
||||
```python
|
||||
def parse(data, raw=False, quiet=False)
|
||||
```
|
||||
|
||||
Main text parsing function
|
||||
|
||||
Parameters:
|
||||
|
||||
data: (string) text data to parse
|
||||
raw: (boolean) unprocessed output if True
|
||||
quiet: (boolean) suppress warning messages if True
|
||||
|
||||
Returns:
|
||||
|
||||
List of raw strings or
|
||||
List of Dictionaries of processed structured data
|
||||
|
||||
### Parser Information
|
||||
Compatibility: linux
|
||||
|
||||
Version 1.0 by Solomon Leang (solomonleang@gmail.com)
|
||||
117
docs/parsers/findmnt.md
Normal file
117
docs/parsers/findmnt.md
Normal file
@@ -0,0 +1,117 @@
|
||||
[Home](https://kellyjonbrazil.github.io/jc/)
|
||||
<a id="jc.parsers.findmnt"></a>
|
||||
|
||||
# jc.parsers.findmnt
|
||||
|
||||
jc - JSON Convert `findmnt` command output parser
|
||||
|
||||
Supports `-a`, `-l`, or no `findmnt` options.
|
||||
|
||||
> Note: Newer versions of `findmnt` have a JSON output option.
|
||||
|
||||
Usage (cli):
|
||||
|
||||
$ findmnt | jc --findmnt
|
||||
|
||||
or
|
||||
|
||||
$ jc findmnt
|
||||
|
||||
Usage (module):
|
||||
|
||||
import jc
|
||||
result = jc.parse('findmnt', findmnt_command_output)
|
||||
|
||||
Schema:
|
||||
|
||||
[
|
||||
{
|
||||
"target": string,
|
||||
"source": string,
|
||||
"fstype": string,
|
||||
"options": [
|
||||
string
|
||||
],
|
||||
"kv_options": {
|
||||
"<key_name>": string
|
||||
}
|
||||
]
|
||||
|
||||
Examples:
|
||||
|
||||
$ findmnt | jc --findmnt -p
|
||||
[
|
||||
{
|
||||
"target": "/",
|
||||
"source": "/dev/mapper/centos-root",
|
||||
"fstype": "xfs",
|
||||
"options": [
|
||||
"rw",
|
||||
"relatime",
|
||||
"seclabel",
|
||||
"attr2",
|
||||
"inode64",
|
||||
"noquota"
|
||||
]
|
||||
},
|
||||
{
|
||||
"target": "/sys/fs/cgroup",
|
||||
"source": "tmpfs",
|
||||
"fstype": "tmpfs",
|
||||
"options": [
|
||||
"ro",
|
||||
"nosuid",
|
||||
"nodev",
|
||||
"noexec",
|
||||
"seclabel"
|
||||
],
|
||||
"kv_options": {
|
||||
"mode": "755"
|
||||
}
|
||||
},
|
||||
...
|
||||
]
|
||||
|
||||
$ findmnt | jc --findmnt -p -r
|
||||
[
|
||||
{
|
||||
"target": "/",
|
||||
"source": "/dev/mapper/centos-root",
|
||||
"fstype": "xfs",
|
||||
"options": "rw,relatime,seclabel,attr2,inode64,noquota"
|
||||
},
|
||||
{
|
||||
"target": "/sys/fs/cgroup",
|
||||
"source": "tmpfs",
|
||||
"fstype": "tmpfs",
|
||||
"options": "ro,nosuid,nodev,noexec,seclabel,mode=755"
|
||||
},
|
||||
...
|
||||
]
|
||||
|
||||
<a id="jc.parsers.findmnt.parse"></a>
|
||||
|
||||
### parse
|
||||
|
||||
```python
|
||||
def parse(data: str,
|
||||
raw: bool = False,
|
||||
quiet: bool = False) -> List[JSONDictType]
|
||||
```
|
||||
|
||||
Main text parsing function
|
||||
|
||||
Parameters:
|
||||
|
||||
data: (string) text data to parse
|
||||
raw: (boolean) unprocessed output if True
|
||||
quiet: (boolean) suppress warning messages if True
|
||||
|
||||
Returns:
|
||||
|
||||
List of Dictionaries. Raw or processed structured data.
|
||||
|
||||
### Parser Information
|
||||
Compatibility: linux
|
||||
|
||||
Version 1.1 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
@@ -95,4 +95,4 @@ Returns:
|
||||
### Parser Information
|
||||
Compatibility: linux
|
||||
|
||||
Version 1.6 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
Version 1.7 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
|
||||
@@ -40,13 +40,13 @@ Schema:
|
||||
[
|
||||
{
|
||||
"commit": string,
|
||||
"author": string,
|
||||
"author_email": string,
|
||||
"author": string/null,
|
||||
"author_email": string/null,
|
||||
"date": string,
|
||||
"epoch": integer, # [0]
|
||||
"epoch_utc": integer, # [1]
|
||||
"commit_by": string,
|
||||
"commit_by_email": string,
|
||||
"commit_by": string/null,
|
||||
"commit_by_email": string/null,
|
||||
"commit_by_date": string,
|
||||
"message": string,
|
||||
"stats" : {
|
||||
@@ -61,7 +61,7 @@ Schema:
|
||||
]
|
||||
|
||||
[0] naive timestamp if "date" field is parsable, else null
|
||||
[1] timezone aware timestamp availabe for UTC, else null
|
||||
[1] timezone aware timestamp available for UTC, else null
|
||||
|
||||
Examples:
|
||||
|
||||
@@ -172,4 +172,4 @@ Returns:
|
||||
### Parser Information
|
||||
Compatibility: linux, darwin, cygwin, win32, aix, freebsd
|
||||
|
||||
Version 1.2 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
Version 1.4 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
|
||||
@@ -41,13 +41,13 @@ Schema:
|
||||
|
||||
{
|
||||
"commit": string,
|
||||
"author": string,
|
||||
"author_email": string,
|
||||
"author": string/null,
|
||||
"author_email": string/null,
|
||||
"date": string,
|
||||
"epoch": integer, # [0]
|
||||
"epoch_utc": integer, # [1]
|
||||
"commit_by": string,
|
||||
"commit_by_email": string,
|
||||
"commit_by": string/null,
|
||||
"commit_by_email": string/null,
|
||||
"commit_by_date": string,
|
||||
"message": string,
|
||||
"stats" : {
|
||||
@@ -68,7 +68,7 @@ Schema:
|
||||
}
|
||||
|
||||
[0] naive timestamp if "date" field is parsable, else null
|
||||
[1] timezone aware timestamp availabe for UTC, else null
|
||||
[1] timezone aware timestamp available for UTC, else null
|
||||
|
||||
Examples:
|
||||
|
||||
@@ -108,4 +108,4 @@ Returns:
|
||||
### Parser Information
|
||||
Compatibility: linux, darwin, cygwin, win32, aix, freebsd
|
||||
|
||||
Version 1.2 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
Version 1.4 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
|
||||
92
docs/parsers/git_ls_remote.md
Normal file
92
docs/parsers/git_ls_remote.md
Normal file
@@ -0,0 +1,92 @@
|
||||
[Home](https://kellyjonbrazil.github.io/jc/)
|
||||
<a id="jc.parsers.git_ls_remote"></a>
|
||||
|
||||
# jc.parsers.git\_ls\_remote
|
||||
|
||||
jc - JSON Convert `git ls-remote` command output parser
|
||||
|
||||
This parser outputs two schemas:
|
||||
|
||||
- Default: A single object with key/value pairs
|
||||
- Raw: An array of objects (`--raw` (cli) or `raw=True (module))
|
||||
|
||||
See the Schema section for more details
|
||||
|
||||
Usage (cli):
|
||||
|
||||
$ git ls-remote | jc --git-ls-remote
|
||||
|
||||
or
|
||||
|
||||
$ jc git ls-remote
|
||||
|
||||
Usage (module):
|
||||
|
||||
import jc
|
||||
result = jc.parse('git_ls_remote', git_ls_remote_command_output)
|
||||
|
||||
Schema:
|
||||
|
||||
Default:
|
||||
{
|
||||
<reference>: string
|
||||
}
|
||||
|
||||
Raw:
|
||||
[
|
||||
{
|
||||
"reference": string,
|
||||
"commit": string
|
||||
}
|
||||
]
|
||||
|
||||
Examples:
|
||||
|
||||
$ git ls-remote | jc --git-ls-remote -p
|
||||
{
|
||||
"HEAD": "214cd6b9e09603b3c4fa02203b24fb2bc3d4e338",
|
||||
"refs/heads/dev": "b884f6aacca39e05994596d8fdfa7e7c4f1e0389",
|
||||
"refs/heads/master": "214cd6b9e09603b3c4fa02203b24fb2bc3d4e338",
|
||||
"refs/pull/1/head": "e416c77bed1267254da972b0f95b7ff1d43fccef",
|
||||
...
|
||||
}
|
||||
|
||||
$ git ls-remote | jc --git-ls-remote -p -r
|
||||
[
|
||||
{
|
||||
"reference": "HEAD",
|
||||
"commit": "214cd6b9e09603b3c4fa02203b24fb2bc3d4e338"
|
||||
},
|
||||
{
|
||||
"reference": "refs/heads/dev",
|
||||
"commit": "b884f6aacca39e05994596d8fdfa7e7c4f1e0389"
|
||||
},
|
||||
...
|
||||
]
|
||||
|
||||
<a id="jc.parsers.git_ls_remote.parse"></a>
|
||||
|
||||
### parse
|
||||
|
||||
```python
|
||||
def parse(data: str,
|
||||
raw: bool = False,
|
||||
quiet: bool = False) -> Union[JSONDictType, List[JSONDictType]]
|
||||
```
|
||||
|
||||
Main text parsing function
|
||||
|
||||
Parameters:
|
||||
|
||||
data: (string) text data to parse
|
||||
raw: (boolean) unprocessed output if True
|
||||
quiet: (boolean) suppress warning messages if True
|
||||
|
||||
Returns:
|
||||
|
||||
Dictionary (default) or List of Dictionaries (raw)
|
||||
|
||||
### Parser Information
|
||||
Compatibility: linux, darwin, cygwin, win32, aix, freebsd
|
||||
|
||||
Version 1.0 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
@@ -128,4 +128,4 @@ Returns:
|
||||
### Parser Information
|
||||
Compatibility: linux, darwin, aix, freebsd
|
||||
|
||||
Version 1.5 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
Version 1.6 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
|
||||
@@ -5,7 +5,10 @@
|
||||
|
||||
jc - JSON Convert `ifconfig` command output parser
|
||||
|
||||
> Note: No `ifconfig` options are supported.
|
||||
No `ifconfig` options are supported.
|
||||
|
||||
Consider using the `ip` command instead of `ifconfig` as it supports native
|
||||
JSON output.
|
||||
|
||||
Usage (cli):
|
||||
|
||||
@@ -24,40 +27,92 @@ Schema:
|
||||
|
||||
[
|
||||
{
|
||||
"name": string,
|
||||
"flags": integer,
|
||||
"name": string,
|
||||
"type": string,
|
||||
"metric": integer
|
||||
"flags": integer,
|
||||
"state": [
|
||||
string
|
||||
string
|
||||
],
|
||||
"mtu": integer,
|
||||
"ipv4_addr": string,
|
||||
"ipv4_mask": string,
|
||||
"ipv4_bcast": string,
|
||||
"ipv6_addr": string,
|
||||
"ipv6_mask": integer,
|
||||
"ipv6_scope": string,
|
||||
"mac_addr": string,
|
||||
"type": string,
|
||||
"rx_packets": integer,
|
||||
"rx_bytes": integer,
|
||||
"rx_errors": integer,
|
||||
"rx_dropped": integer,
|
||||
"rx_overruns": integer,
|
||||
"rx_frame": integer,
|
||||
"tx_packets": integer,
|
||||
"tx_bytes": integer,
|
||||
"tx_errors": integer,
|
||||
"tx_dropped": integer,
|
||||
"tx_overruns": integer,
|
||||
"tx_carrier": integer,
|
||||
"tx_collisions": integer,
|
||||
"metric": integer
|
||||
"mtu": integer,
|
||||
"mac_addr": string,
|
||||
"ipv4_addr": string, # [0]
|
||||
"ipv4_mask": string, # [0]
|
||||
"ipv4_bcast": string, # [0]
|
||||
"ipv6_addr": string, # [0]
|
||||
"ipv6_mask": integer, # [0]
|
||||
"ipv6_scope": string, # [0]
|
||||
"ipv6_scope_id": string, # [0]
|
||||
"ipv6_type": string, # [0]
|
||||
"rx_packets": integer,
|
||||
"rx_bytes": integer,
|
||||
"rx_errors": integer,
|
||||
"rx_dropped": integer,
|
||||
"rx_overruns": integer,
|
||||
"rx_frame": integer,
|
||||
"tx_packets": integer,
|
||||
"tx_bytes": integer,
|
||||
"tx_errors": integer,
|
||||
"tx_dropped": integer,
|
||||
"tx_overruns": integer,
|
||||
"tx_carrier": integer,
|
||||
"tx_collisions": integer,
|
||||
"options": string,
|
||||
"options_flags": [
|
||||
string
|
||||
],
|
||||
"status": string,
|
||||
"hw_address": string,
|
||||
"media": string,
|
||||
"media_flags": [
|
||||
string
|
||||
],
|
||||
"nd6_options": integer,
|
||||
"nd6_flags": [
|
||||
string
|
||||
],
|
||||
"plugged": string,
|
||||
"vendor": string,
|
||||
"vendor_pn": string,
|
||||
"vendor_sn": string,
|
||||
"vendor_date": string,
|
||||
"module_temperature": string,
|
||||
"module_voltage": string
|
||||
"ipv4": [
|
||||
{
|
||||
"address": string,
|
||||
"mask": string,
|
||||
"broadcast": string
|
||||
}
|
||||
],
|
||||
"ipv6: [
|
||||
{
|
||||
"address": string,
|
||||
"scope_id": string,
|
||||
"mask": integer,
|
||||
"scope": string,
|
||||
"type": string
|
||||
}
|
||||
],
|
||||
"lanes": [
|
||||
{
|
||||
"lane": integer,
|
||||
"rx_power_mw": float,
|
||||
"rx_power_dbm": float,
|
||||
"tx_bias_ma": float
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
[0] these fields only pick up the last IP address in the interface
|
||||
output and are here for backwards compatibility. For information on
|
||||
all IP addresses, use the `ipv4` and `ipv6` objects which contain an
|
||||
array of IP address objects.
|
||||
|
||||
Examples:
|
||||
|
||||
$ ifconfig | jc --ifconfig -p
|
||||
$ ifconfig ens33 | jc --ifconfig -p
|
||||
[
|
||||
{
|
||||
"name": "ens33",
|
||||
@@ -69,120 +124,94 @@ Examples:
|
||||
"MULTICAST"
|
||||
],
|
||||
"mtu": 1500,
|
||||
"type": "Ethernet",
|
||||
"mac_addr": "00:0c:29:3b:58:0e",
|
||||
"ipv4_addr": "192.168.71.137",
|
||||
"ipv4_mask": "255.255.255.0",
|
||||
"ipv4_bcast": "192.168.71.255",
|
||||
"ipv6_addr": "fe80::c1cb:715d:bc3e:b8a0",
|
||||
"ipv6_mask": 64,
|
||||
"ipv6_scope": "0x20",
|
||||
"mac_addr": "00:0c:29:3b:58:0e",
|
||||
"type": "Ethernet",
|
||||
"ipv6_type": "link",
|
||||
"metric": null,
|
||||
"rx_packets": 8061,
|
||||
"rx_bytes": 1514413,
|
||||
"rx_errors": 0,
|
||||
"rx_dropped": 0,
|
||||
"rx_overruns": 0,
|
||||
"rx_frame": 0,
|
||||
"tx_packets": 4502,
|
||||
"tx_errors": 0,
|
||||
"tx_dropped": 0,
|
||||
"tx_overruns": 0,
|
||||
"tx_carrier": 0,
|
||||
"tx_collisions": 0,
|
||||
"rx_bytes": 1514413,
|
||||
"tx_bytes": 866622,
|
||||
"tx_errors": 0,
|
||||
"tx_dropped": 0,
|
||||
"tx_overruns": 0,
|
||||
"tx_carrier": 0,
|
||||
"tx_collisions": 0,
|
||||
"metric": null
|
||||
},
|
||||
{
|
||||
"name": "lo",
|
||||
"flags": 73,
|
||||
"state": [
|
||||
"UP",
|
||||
"LOOPBACK",
|
||||
"RUNNING"
|
||||
"ipv4": [
|
||||
{
|
||||
"address": "192.168.71.137",
|
||||
"mask": "255.255.255.0",
|
||||
"broadcast": "192.168.71.255"
|
||||
}
|
||||
],
|
||||
"mtu": 65536,
|
||||
"ipv4_addr": "127.0.0.1",
|
||||
"ipv4_mask": "255.0.0.0",
|
||||
"ipv4_bcast": null,
|
||||
"ipv6_addr": "::1",
|
||||
"ipv6_mask": 128,
|
||||
"ipv6_scope": "0x10",
|
||||
"mac_addr": null,
|
||||
"type": "Local Loopback",
|
||||
"rx_packets": 73,
|
||||
"rx_bytes": 6009,
|
||||
"rx_errors": 0,
|
||||
"rx_dropped": 0,
|
||||
"rx_overruns": 0,
|
||||
"rx_frame": 0,
|
||||
"tx_packets": 73,
|
||||
"tx_bytes": 6009,
|
||||
"tx_errors": 0,
|
||||
"tx_dropped": 0,
|
||||
"tx_overruns": 0,
|
||||
"tx_carrier": 0,
|
||||
"tx_collisions": 0,
|
||||
"metric": null
|
||||
"ipv6": [
|
||||
{
|
||||
"address": "fe80::c1cb:715d:bc3e:b8a0",
|
||||
"scope_id": null,
|
||||
"mask": 64,
|
||||
"scope": "0x20",
|
||||
"type": "link"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
$ ifconfig | jc --ifconfig -p -r
|
||||
$ ifconfig ens33 | jc --ifconfig -p -r
|
||||
[
|
||||
{
|
||||
"name": "ens33",
|
||||
"flags": "4163",
|
||||
"state": "UP,BROADCAST,RUNNING,MULTICAST",
|
||||
"mtu": "1500",
|
||||
"type": "Ethernet",
|
||||
"mac_addr": "00:0c:29:3b:58:0e",
|
||||
"ipv4_addr": "192.168.71.137",
|
||||
"ipv4_mask": "255.255.255.0",
|
||||
"ipv4_bcast": "192.168.71.255",
|
||||
"ipv6_addr": "fe80::c1cb:715d:bc3e:b8a0",
|
||||
"ipv6_mask": "64",
|
||||
"ipv6_scope": "0x20",
|
||||
"mac_addr": "00:0c:29:3b:58:0e",
|
||||
"type": "Ethernet",
|
||||
"ipv6_type": "link",
|
||||
"metric": null,
|
||||
"rx_packets": "8061",
|
||||
"rx_bytes": "1514413",
|
||||
"rx_errors": "0",
|
||||
"rx_dropped": "0",
|
||||
"rx_overruns": "0",
|
||||
"rx_frame": "0",
|
||||
"tx_packets": "4502",
|
||||
"tx_errors": "0",
|
||||
"tx_dropped": "0",
|
||||
"tx_overruns": "0",
|
||||
"tx_carrier": "0",
|
||||
"tx_collisions": "0",
|
||||
"rx_bytes": "1514413",
|
||||
"tx_bytes": "866622",
|
||||
"tx_errors": "0",
|
||||
"tx_dropped": "0",
|
||||
"tx_overruns": "0",
|
||||
"tx_carrier": "0",
|
||||
"tx_collisions": "0",
|
||||
"metric": null
|
||||
},
|
||||
{
|
||||
"name": "lo",
|
||||
"flags": "73",
|
||||
"state": "UP,LOOPBACK,RUNNING",
|
||||
"mtu": "65536",
|
||||
"ipv4_addr": "127.0.0.1",
|
||||
"ipv4_mask": "255.0.0.0",
|
||||
"ipv4_bcast": null,
|
||||
"ipv6_addr": "::1",
|
||||
"ipv6_mask": "128",
|
||||
"ipv6_scope": "0x10",
|
||||
"mac_addr": null,
|
||||
"type": "Local Loopback",
|
||||
"rx_packets": "73",
|
||||
"rx_bytes": "6009",
|
||||
"rx_errors": "0",
|
||||
"rx_dropped": "0",
|
||||
"rx_overruns": "0",
|
||||
"rx_frame": "0",
|
||||
"tx_packets": "73",
|
||||
"tx_bytes": "6009",
|
||||
"tx_errors": "0",
|
||||
"tx_dropped": "0",
|
||||
"tx_overruns": "0",
|
||||
"tx_carrier": "0",
|
||||
"tx_collisions": "0",
|
||||
"metric": null
|
||||
"ipv4": [
|
||||
{
|
||||
"address": "192.168.71.137",
|
||||
"mask": "255.255.255.0",
|
||||
"broadcast": "192.168.71.255"
|
||||
}
|
||||
],
|
||||
"ipv6": [
|
||||
{
|
||||
"address": "fe80::c1cb:715d:bc3e:b8a0",
|
||||
"scope_id": null,
|
||||
"mask": "64",
|
||||
"scope": "0x20",
|
||||
"type": "link"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
@@ -191,7 +220,9 @@ Examples:
|
||||
### parse
|
||||
|
||||
```python
|
||||
def parse(data, raw=False, quiet=False)
|
||||
def parse(data: str,
|
||||
raw: bool = False,
|
||||
quiet: bool = False) -> List[JSONDictType]
|
||||
```
|
||||
|
||||
Main text parsing function
|
||||
@@ -209,4 +240,4 @@ Returns:
|
||||
### Parser Information
|
||||
Compatibility: linux, aix, freebsd, darwin
|
||||
|
||||
Version 1.12 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
Version 2.3 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
|
||||
@@ -3,13 +3,15 @@
|
||||
|
||||
# jc.parsers.ini
|
||||
|
||||
jc - JSON Convert `INI` file parser
|
||||
jc - JSON Convert INI file parser
|
||||
|
||||
Parses standard `INI` files and files containing simple key/value pairs.
|
||||
Parses standard INI files.
|
||||
|
||||
- Delimiter can be `=` or `:`. Missing values are supported.
|
||||
- Comment prefix can be `#` or `;`. Comments must be on their own line.
|
||||
- If duplicate keys are found, only the last value will be used.
|
||||
- If any section names have the same name as a top-level key, the top-level
|
||||
key will be overwritten by the section data.
|
||||
|
||||
> Note: Values starting and ending with double or single quotation marks
|
||||
> will have the marks removed. If you would like to keep the quotation
|
||||
@@ -27,45 +29,47 @@ Usage (module):
|
||||
|
||||
Schema:
|
||||
|
||||
ini or key/value document converted to a dictionary - see the configparser
|
||||
INI document converted to a dictionary - see the python configparser
|
||||
standard library documentation for more details.
|
||||
|
||||
{
|
||||
"key1": string,
|
||||
"key2": string
|
||||
"<key1>": string,
|
||||
"<key2>": string,
|
||||
"<section1>": {
|
||||
"<key1>": string,
|
||||
"<key2>": string
|
||||
},
|
||||
"<section2>": {
|
||||
"<key1>": string,
|
||||
"<key2>": string
|
||||
}
|
||||
}
|
||||
|
||||
Examples:
|
||||
|
||||
$ cat example.ini
|
||||
[DEFAULT]
|
||||
ServerAliveInterval = 45
|
||||
Compression = yes
|
||||
CompressionLevel = 9
|
||||
ForwardX11 = yes
|
||||
foo = fiz
|
||||
bar = buz
|
||||
|
||||
[bitbucket.org]
|
||||
User = hg
|
||||
[section1]
|
||||
fruit = apple
|
||||
color = blue
|
||||
|
||||
[topsecret.server.com]
|
||||
Port = 50022
|
||||
ForwardX11 = no
|
||||
[section2]
|
||||
fruit = pear
|
||||
color = green
|
||||
|
||||
$ cat example.ini | jc --ini -p
|
||||
{
|
||||
"bitbucket.org": {
|
||||
"serveraliveinterval": "45",
|
||||
"compression": "yes",
|
||||
"compressionlevel": "9",
|
||||
"forwardx11": "yes",
|
||||
"user": "hg"
|
||||
"foo": "fiz",
|
||||
"bar": "buz",
|
||||
"section1": {
|
||||
"fruit": "apple",
|
||||
"color": "blue"
|
||||
},
|
||||
"topsecret.server.com": {
|
||||
"serveraliveinterval": "45",
|
||||
"compression": "yes",
|
||||
"compressionlevel": "9",
|
||||
"forwardx11": "no",
|
||||
"port": "50022"
|
||||
"section2": {
|
||||
"fruit": "pear",
|
||||
"color": "green"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -87,9 +91,9 @@ Parameters:
|
||||
|
||||
Returns:
|
||||
|
||||
Dictionary representing the ini file
|
||||
Dictionary representing the INI file.
|
||||
|
||||
### Parser Information
|
||||
Compatibility: linux, darwin, cygwin, win32, aix, freebsd
|
||||
|
||||
Version 1.7 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
Version 2.0 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
|
||||
121
docs/parsers/ini_dup.md
Normal file
121
docs/parsers/ini_dup.md
Normal file
@@ -0,0 +1,121 @@
|
||||
[Home](https://kellyjonbrazil.github.io/jc/)
|
||||
<a id="jc.parsers.ini_dup"></a>
|
||||
|
||||
# jc.parsers.ini\_dup
|
||||
|
||||
jc - JSON Convert INI with duplicate key file parser
|
||||
|
||||
Parses standard INI files and preserves duplicate values. All values are
|
||||
contained in lists/arrays.
|
||||
|
||||
- Delimiter can be `=` or `:`. Missing values are supported.
|
||||
- Comment prefix can be `#` or `;`. Comments must be on their own line.
|
||||
- If any section names have the same name as a top-level key, the top-level
|
||||
key will be overwritten by the section data.
|
||||
- If multi-line values are used, each line will be a separate item in the
|
||||
value list. Blank lines in multi-line values are not supported.
|
||||
|
||||
> Note: Values starting and ending with double or single quotation marks
|
||||
> will have the marks removed. If you would like to keep the quotation
|
||||
> marks, use the `-r` command-line argument or the `raw=True` argument in
|
||||
> `parse()`.
|
||||
|
||||
Usage (cli):
|
||||
|
||||
$ cat foo.ini | jc --ini
|
||||
|
||||
Usage (module):
|
||||
|
||||
import jc
|
||||
result = jc.parse('ini', ini_file_output)
|
||||
|
||||
Schema:
|
||||
|
||||
INI document converted to a dictionary - see the python configparser
|
||||
standard library documentation for more details.
|
||||
|
||||
{
|
||||
"<key1>": [
|
||||
string
|
||||
],
|
||||
"<key2>": [
|
||||
string
|
||||
],
|
||||
"<section1>": {
|
||||
"<key1>": [
|
||||
string
|
||||
],
|
||||
"<key2>": [
|
||||
string
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
Examples:
|
||||
|
||||
$ cat example.ini
|
||||
foo = fiz
|
||||
bar = buz
|
||||
|
||||
[section1]
|
||||
fruit = apple
|
||||
color = blue
|
||||
color = red
|
||||
|
||||
[section2]
|
||||
fruit = pear
|
||||
fruit = peach
|
||||
color = green
|
||||
|
||||
$ cat example.ini | jc --ini -p
|
||||
{
|
||||
"foo": [
|
||||
"fiz"
|
||||
],
|
||||
"bar": [
|
||||
"buz"
|
||||
],
|
||||
"section1": {
|
||||
"fruit": [
|
||||
"apple"
|
||||
],
|
||||
"color": [
|
||||
"blue",
|
||||
"red"
|
||||
]
|
||||
},
|
||||
"section2": {
|
||||
"fruit": [
|
||||
"pear",
|
||||
"peach"
|
||||
],
|
||||
"color": [
|
||||
"green"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
<a id="jc.parsers.ini_dup.parse"></a>
|
||||
|
||||
### parse
|
||||
|
||||
```python
|
||||
def parse(data, raw=False, quiet=False)
|
||||
```
|
||||
|
||||
Main text parsing function
|
||||
|
||||
Parameters:
|
||||
|
||||
data: (string) text data to parse
|
||||
raw: (boolean) unprocessed output if True
|
||||
quiet: (boolean) suppress warning messages if True
|
||||
|
||||
Returns:
|
||||
|
||||
Dictionary representing the INI file.
|
||||
|
||||
### Parser Information
|
||||
Compatibility: linux, darwin, cygwin, win32, aix, freebsd
|
||||
|
||||
Version 1.0 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
@@ -130,4 +130,4 @@ Returns:
|
||||
### Parser Information
|
||||
Compatibility: linux
|
||||
|
||||
Version 1.2 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
Version 1.3 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
|
||||
@@ -26,6 +26,9 @@ Schema:
|
||||
"ip": string,
|
||||
"ip_compressed": string,
|
||||
"ip_exploded": string,
|
||||
"ip_split": [
|
||||
string
|
||||
],
|
||||
"scope_id": string/null,
|
||||
"ipv4_mapped": string/null,
|
||||
"six_to_four": string/null,
|
||||
@@ -83,6 +86,12 @@ Examples:
|
||||
"ip": "192.168.2.10",
|
||||
"ip_compressed": "192.168.2.10",
|
||||
"ip_exploded": "192.168.2.10",
|
||||
"ip_split": [
|
||||
"192",
|
||||
"168",
|
||||
"2",
|
||||
"10"
|
||||
],
|
||||
"scope_id": null,
|
||||
"ipv4_mapped": null,
|
||||
"six_to_four": null,
|
||||
@@ -138,6 +147,12 @@ Examples:
|
||||
"ip": "192.168.2.10",
|
||||
"ip_compressed": "192.168.2.10",
|
||||
"ip_exploded": "192.168.2.10",
|
||||
"ip_split": [
|
||||
"192",
|
||||
"168",
|
||||
"2",
|
||||
"10"
|
||||
],
|
||||
"scope_id": null,
|
||||
"ipv4_mapped": null,
|
||||
"six_to_four": null,
|
||||
@@ -191,14 +206,24 @@ Examples:
|
||||
"version": 6,
|
||||
"max_prefix_length": 128,
|
||||
"ip": "127:0:de::1",
|
||||
"ip_compressed": "127:0:de::1%128",
|
||||
"ip_compressed": "127:0:de::1",
|
||||
"ip_exploded": "0127:0000:00de:0000:0000:0000:0000:0001",
|
||||
"ip_split": [
|
||||
"0127",
|
||||
"0000",
|
||||
"00de",
|
||||
"0000",
|
||||
"0000",
|
||||
"0000",
|
||||
"0000",
|
||||
"0001"
|
||||
],
|
||||
"scope_id": "128",
|
||||
"ipv4_mapped": null,
|
||||
"six_to_four": null,
|
||||
"teredo_client": null,
|
||||
"teredo_server": null,
|
||||
"dns_ptr": "1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.....0.7.2.1.0.ip6.arpa",
|
||||
"dns_ptr": "1.0.0.0.0.0...0.0.0.e.d.0.0.0.0.0.0.7.2.1.0.ip6.arpa",
|
||||
"network": "127:0:de::",
|
||||
"broadcast": "127:0:de::ffff:ffff",
|
||||
"hostmask": "::ffff:ffff",
|
||||
@@ -231,13 +256,13 @@ Examples:
|
||||
"last_host": "01:27:00:00:00:de:00:00:00:00:00:00:ff:ff:ff:fe"
|
||||
},
|
||||
"bin": {
|
||||
"ip": "000000010010011100000000000000000000000011011110000000...",
|
||||
"network": "0000000100100111000000000000000000000000110111100...",
|
||||
"broadcast": "00000001001001110000000000000000000000001101111...",
|
||||
"hostmask": "000000000000000000000000000000000000000000000000...",
|
||||
"netmask": "1111111111111111111111111111111111111111111111111...",
|
||||
"first_host": "0000000100100111000000000000000000000000110111...",
|
||||
"last_host": "00000001001001110000000000000000000000001101111..."
|
||||
"ip": "0000000100100111000000000000000000000000110...000000000001",
|
||||
"network": "00000001001001110000000000000000000000...000000000000",
|
||||
"broadcast": "000000010010011100000000000000000000...111111111111",
|
||||
"hostmask": "0000000000000000000000000000000000000...111111111111",
|
||||
"netmask": "11111111111111111111111111111111111111...000000000000",
|
||||
"first_host": "00000001001001110000000000000000000...000000000001",
|
||||
"last_host": "000000010010011100000000000000000000...1111111111110"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -248,12 +273,22 @@ Examples:
|
||||
"ip": "127:0:de::1",
|
||||
"ip_compressed": "127:0:de::1",
|
||||
"ip_exploded": "0127:0000:00de:0000:0000:0000:0000:0001",
|
||||
"ip_split": [
|
||||
"0127",
|
||||
"0000",
|
||||
"00de",
|
||||
"0000",
|
||||
"0000",
|
||||
"0000",
|
||||
"0000",
|
||||
"0001"
|
||||
],
|
||||
"scope_id": null,
|
||||
"ipv4_mapped": null,
|
||||
"six_to_four": null,
|
||||
"teredo_client": null,
|
||||
"teredo_server": null,
|
||||
"dns_ptr": "1.0.0.0.0.0.0....0.0.0.e.d.0.0.0.0.0.0.7.2.1.0.ip6.arpa",
|
||||
"dns_ptr": "1.0.0.0.0.0....0.0.0.0.e.d.0.0.0.0.0.0.7.2.1.0.ip6.arpa",
|
||||
"network": "127:0:de::1",
|
||||
"broadcast": "127:0:de::1",
|
||||
"hostmask": "::",
|
||||
@@ -286,13 +321,13 @@ Examples:
|
||||
"last_host": "01:27:00:00:00:de:00:00:00:00:00:00:00:00:00:01"
|
||||
},
|
||||
"bin": {
|
||||
"ip": "0000000100100111000000000000000000000000110111100000000...",
|
||||
"network": "00000001001001110000000000000000000000001101111000...",
|
||||
"broadcast": "000000010010011100000000000000000000000011011110...",
|
||||
"hostmask": "0000000000000000000000000000000000000000000000000...",
|
||||
"netmask": "11111111111111111111111111111111111111111111111111...",
|
||||
"first_host": "00000001001001110000000000000000000000001101111...",
|
||||
"last_host": "000000010010011100000000000000000000000011011110..."
|
||||
"ip": "0000000100100111000000000000000000000000110111100...000001",
|
||||
"network": "00000001001001110000000000000000000000001101...000001",
|
||||
"broadcast": "000000010010011100000000000000000000000011...000001",
|
||||
"hostmask": "0000000000000000000000000000000000000000000...000000",
|
||||
"netmask": "11111111111111111111111111111111111111111111...111111",
|
||||
"first_host": "00000001001001110000000000000000000000001...000001",
|
||||
"last_host": "000000010010011100000000000000000000000011...0000001"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -304,12 +339,22 @@ Examples:
|
||||
"ip": "::ffff:c0a8:123",
|
||||
"ip_compressed": "::ffff:c0a8:123",
|
||||
"ip_exploded": "0000:0000:0000:0000:0000:ffff:c0a8:0123",
|
||||
"ip_split": [
|
||||
"0000",
|
||||
"0000",
|
||||
"0000",
|
||||
"0000",
|
||||
"0000",
|
||||
"ffff",
|
||||
"c0a8",
|
||||
"0123"
|
||||
],
|
||||
"scope_id": null,
|
||||
"ipv4_mapped": "192.168.1.35",
|
||||
"six_to_four": null,
|
||||
"teredo_client": null,
|
||||
"teredo_server": null,
|
||||
"dns_ptr": "3.2.1.0.8.a.0.c.f.f.f.f.0.0.0....0.0.0.0.0.0.0.ip6.arpa",
|
||||
"dns_ptr": "3.2.1.0.8.a.0.c.f.f.f.f.0.0....0.0.0.0.0.0.ip6.arpa",
|
||||
"network": "::ffff:c0a8:123",
|
||||
"broadcast": "::ffff:c0a8:123",
|
||||
"hostmask": "::",
|
||||
@@ -342,13 +387,13 @@ Examples:
|
||||
"last_host": "00:00:00:00:00:00:00:00:00:00:ff:ff:c0:a8:01:23"
|
||||
},
|
||||
"bin": {
|
||||
"ip": "0000000000000000000000000000000000000000000000000000000...",
|
||||
"network": "00000000000000000000000000000000000000000000000000...",
|
||||
"broadcast": "000000000000000000000000000000000000000000000000...",
|
||||
"hostmask": "0000000000000000000000000000000000000000000000000...",
|
||||
"netmask": "11111111111111111111111111111111111111111111111111...",
|
||||
"first_host": "00000000000000000000000000000000000000000000000...",
|
||||
"last_host": "000000000000000000000000000000000000000000000000..."
|
||||
"ip": "000000000000000000000000000000000000000000000...100100011",
|
||||
"network": "0000000000000000000000000000000000000000...000100011",
|
||||
"broadcast": "00000000000000000000000000000000000000...000100011",
|
||||
"hostmask": "000000000000000000000000000000000000000...000000000",
|
||||
"netmask": "1111111111111111111111111111111111111111...111111111",
|
||||
"first_host": "0000000000000000000000000000000000000...100100011",
|
||||
"last_host": "00000000000000000000000000000000000000...0100100011"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -360,12 +405,22 @@ Examples:
|
||||
"ip": "2002:c000:204::",
|
||||
"ip_compressed": "2002:c000:204::",
|
||||
"ip_exploded": "2002:c000:0204:0000:0000:0000:0000:0000",
|
||||
"ip_split": [
|
||||
"2002",
|
||||
"c000",
|
||||
"0204",
|
||||
"0000",
|
||||
"0000",
|
||||
"0000",
|
||||
"0000",
|
||||
"0000"
|
||||
],
|
||||
"scope_id": null,
|
||||
"ipv4_mapped": null,
|
||||
"six_to_four": "192.0.2.4",
|
||||
"teredo_client": null,
|
||||
"teredo_server": null,
|
||||
"dns_ptr": "0.0.0.0.0.0.0.0......0.4.0.2.0.0.0.0.c.2.0.0.2.ip6.arpa",
|
||||
"dns_ptr": "0.0.0.0.0.0.0...0.0.0.4.0.2.0.0.0.0.c.2.0.0.2.ip6.arpa",
|
||||
"network": "2002:c000:204::",
|
||||
"broadcast": "2002:c000:204:ffff:ffff:ffff:ffff:ffff",
|
||||
"hostmask": "::ffff:ffff:ffff:ffff:ffff",
|
||||
@@ -398,13 +453,13 @@ Examples:
|
||||
"last_host": "20:02:c0:00:02:04:ff:ff:ff:ff:ff:ff:ff:ff:ff:fe"
|
||||
},
|
||||
"bin": {
|
||||
"ip": "0010000000000010110000000000000000000010000001000000000...",
|
||||
"network": "00100000000000101100000000000000000000100000010000...",
|
||||
"broadcast": "001000000000001011000000000000000000001000000100...",
|
||||
"hostmask": "0000000000000000000000000000000000000000000000001...",
|
||||
"netmask": "11111111111111111111111111111111111111111111111100...",
|
||||
"first_host": "00100000000000101100000000000000000000100000010...",
|
||||
"last_host": "001000000000001011000000000000000000001000000100..."
|
||||
"ip": "00100000000000101100000000000000000000100000010...00000000",
|
||||
"network": "001000000000001011000000000000000000001000...00000000",
|
||||
"broadcast": "0010000000000010110000000000000000000010...11111111",
|
||||
"hostmask": "00000000000000000000000000000000000000000...11111111",
|
||||
"netmask": "111111111111111111111111111111111111111111...00000000",
|
||||
"first_host": "001000000000001011000000000000000000001...00000001",
|
||||
"last_host": "0010000000000010110000000000000000000010...111111110"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -416,12 +471,22 @@ Examples:
|
||||
"ip": "2001:0:4136:e378:8000:63bf:3fff:fdd2",
|
||||
"ip_compressed": "2001:0:4136:e378:8000:63bf:3fff:fdd2",
|
||||
"ip_exploded": "2001:0000:4136:e378:8000:63bf:3fff:fdd2",
|
||||
"ip_split": [
|
||||
"2001",
|
||||
"0000",
|
||||
"4136",
|
||||
"e378",
|
||||
"8000",
|
||||
"63bf",
|
||||
"3fff",
|
||||
"fdd2"
|
||||
],
|
||||
"scope_id": null,
|
||||
"ipv4_mapped": null,
|
||||
"six_to_four": null,
|
||||
"teredo_client": "192.0.2.45",
|
||||
"teredo_server": "65.54.227.120",
|
||||
"dns_ptr": "2.d.d.f.f.f.f.3.f.b.3.6.0.0.0....0.0.0.1.0.0.2.ip6.arpa",
|
||||
"dns_ptr": "2.d.d.f.f.f.f.3.f.b.3.6.0.0.0.8.8....0.1.0.0.2.ip6.arpa",
|
||||
"network": "2001:0:4136:e378:8000:63bf:3fff:fdd2",
|
||||
"broadcast": "2001:0:4136:e378:8000:63bf:3fff:fdd2",
|
||||
"hostmask": "::",
|
||||
@@ -454,13 +519,13 @@ Examples:
|
||||
"last_host": "20:01:00:00:41:36:e3:78:80:00:63:bf:3f:ff:fd:d2"
|
||||
},
|
||||
"bin": {
|
||||
"ip": "001000000000000100000000000000000100000100110110111000...",
|
||||
"network": "0010000000000001000000000000000001000001001101101...",
|
||||
"broadcast": "00100000000000010000000000000000010000010011011...",
|
||||
"hostmask": "000000000000000000000000000000000000000000000000...",
|
||||
"netmask": "1111111111111111111111111111111111111111111111111...",
|
||||
"first_host": "0010000000000001000000000000000001000001001101...",
|
||||
"last_host": "00100000000000010000000000000000010000010011011..."
|
||||
"ip": "0010000000000001000000000000000001000001001...110111010010",
|
||||
"network": "00100000000000010000000000000000010000...110111010010",
|
||||
"broadcast": "001000000000000100000000000000000100...110111010010",
|
||||
"hostmask": "0000000000000000000000000000000000000...000000000000",
|
||||
"netmask": "11111111111111111111111111111111111111...111111111111",
|
||||
"first_host": "00100000000000010000000000000000010...110111010010",
|
||||
"last_host": "001000000000000100000000000000000100...110111010010"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -487,4 +552,4 @@ Returns:
|
||||
### Parser Information
|
||||
Compatibility: linux, darwin, cygwin, win32, aix, freebsd
|
||||
|
||||
Version 1.0 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
Version 1.3 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
|
||||
74
docs/parsers/ip_route.md
Normal file
74
docs/parsers/ip_route.md
Normal file
@@ -0,0 +1,74 @@
|
||||
[Home](https://kellyjonbrazil.github.io/jc/)
|
||||
<a id="jc.parsers.ip_route"></a>
|
||||
|
||||
# jc.parsers.ip\_route
|
||||
|
||||
jc - JSON Convert `ip route` command output parser
|
||||
|
||||
Usage (cli):
|
||||
|
||||
$ ip route | jc --ip-route
|
||||
|
||||
or
|
||||
|
||||
$ jc ip-route
|
||||
|
||||
Usage (module):
|
||||
|
||||
import jc
|
||||
result = jc.parse('ip_route', ip_route_command_output)
|
||||
|
||||
Schema:
|
||||
|
||||
[
|
||||
{
|
||||
"ip": string,
|
||||
"via": string,
|
||||
"dev": string,
|
||||
"metric": integer,
|
||||
"proto": string,
|
||||
"scope": string,
|
||||
"src": string,
|
||||
"via": string,
|
||||
"status": string
|
||||
}
|
||||
]
|
||||
|
||||
Examples:
|
||||
|
||||
$ ip route | jc --ip-route -p
|
||||
[
|
||||
{
|
||||
"ip": "10.0.2.0/24",
|
||||
"dev": "enp0s3",
|
||||
"proto": "kernel",
|
||||
"scope": "link",
|
||||
"src": "10.0.2.15",
|
||||
"metric": 100
|
||||
}
|
||||
]
|
||||
|
||||
<a id="jc.parsers.ip_route.parse"></a>
|
||||
|
||||
### parse
|
||||
|
||||
```python
|
||||
def parse(data, raw=False, quiet=False)
|
||||
```
|
||||
|
||||
Main text parsing function
|
||||
|
||||
Parameters:
|
||||
|
||||
data: (string) text data to parse
|
||||
raw: (boolean) unprocessed output if True
|
||||
quiet: (boolean) suppress warning messages if True
|
||||
|
||||
Returns:
|
||||
|
||||
List of Json objects if data is processed and Raw data if raw = true.
|
||||
|
||||
### Parser Information
|
||||
Compatibility: linux
|
||||
|
||||
Version 1.0 by Julian Jackson (jackson.julian55@yahoo.com)
|
||||
@@ -5,65 +5,10 @@
|
||||
|
||||
jc - JSON Convert ISO 8601 Datetime string parser
|
||||
|
||||
This parser supports standard ISO 8601 strings that include both date and
|
||||
time. If no timezone or offset information is available in the sring, then
|
||||
UTC timezone is used.
|
||||
This parser has been renamed to datetime-iso (cli) or datetime_iso (module).
|
||||
|
||||
Usage (cli):
|
||||
|
||||
$ echo "2022-07-20T14:52:45Z" | jc --iso-datetime
|
||||
|
||||
Usage (module):
|
||||
|
||||
import jc
|
||||
result = jc.parse('iso_datetime', iso_8601_string)
|
||||
|
||||
Schema:
|
||||
|
||||
{
|
||||
"year": integer,
|
||||
"month": string,
|
||||
"month_num": integer,
|
||||
"day": integer,
|
||||
"weekday": string,
|
||||
"weekday_num": integer,
|
||||
"hour": integer,
|
||||
"hour_24": integer,
|
||||
"minute": integer,
|
||||
"second": integer,
|
||||
"microsecond": integer,
|
||||
"period": string,
|
||||
"utc_offset": string,
|
||||
"day_of_year": integer,
|
||||
"week_of_year": integer,
|
||||
"iso": string,
|
||||
"timestamp": integer # [0]
|
||||
}
|
||||
|
||||
[0] timezone aware UNIX timestamp expressed in UTC
|
||||
|
||||
Examples:
|
||||
|
||||
$ echo "2022-07-20T14:52:45Z" | jc --iso-datetime -p
|
||||
{
|
||||
"year": 2022,
|
||||
"month": "Jul",
|
||||
"month_num": 7,
|
||||
"day": 20,
|
||||
"weekday": "Wed",
|
||||
"weekday_num": 3,
|
||||
"hour": 2,
|
||||
"hour_24": 14,
|
||||
"minute": 52,
|
||||
"second": 45,
|
||||
"microsecond": 0,
|
||||
"period": "PM",
|
||||
"utc_offset": "+0000",
|
||||
"day_of_year": 201,
|
||||
"week_of_year": 29,
|
||||
"iso": "2022-07-20T14:52:45+00:00",
|
||||
"timestamp": 1658328765
|
||||
}
|
||||
This parser will be removed in a future version, so please start using
|
||||
the new parser name.
|
||||
|
||||
<a id="jc.parsers.iso_datetime.parse"></a>
|
||||
|
||||
@@ -73,7 +18,8 @@ Examples:
|
||||
def parse(data, raw=False, quiet=False)
|
||||
```
|
||||
|
||||
Main text parsing function
|
||||
This parser is deprecated and calls datetime_iso. Please use datetime_iso
|
||||
directly. This parser will be removed in the future.
|
||||
|
||||
Parameters:
|
||||
|
||||
@@ -88,4 +34,4 @@ Returns:
|
||||
### Parser Information
|
||||
Compatibility: linux, aix, freebsd, darwin, win32, cygwin
|
||||
|
||||
Version 1.0 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
Version 1.1 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
|
||||
111
docs/parsers/iwconfig.md
Normal file
111
docs/parsers/iwconfig.md
Normal file
@@ -0,0 +1,111 @@
|
||||
[Home](https://kellyjonbrazil.github.io/jc/)
|
||||
<a id="jc.parsers.iwconfig"></a>
|
||||
|
||||
# jc.parsers.iwconfig
|
||||
|
||||
jc - JSON Convert `iwconfig` command output parser
|
||||
|
||||
No `iwconfig` options are supported.
|
||||
|
||||
Usage (cli):
|
||||
|
||||
$ iwconfig | jc --iwconfig
|
||||
|
||||
or
|
||||
|
||||
$ jc iwconfig
|
||||
|
||||
Usage (module):
|
||||
|
||||
import jc
|
||||
result = jc.parse('iwconfig', iwconfig_command_output)
|
||||
|
||||
Schema:
|
||||
|
||||
[
|
||||
{
|
||||
"name": string,
|
||||
"protocol": string,
|
||||
"essid": string,
|
||||
"mode": string,
|
||||
"frequency": float,
|
||||
"frequency_unit": string,
|
||||
"access_point": string,
|
||||
"bit_rate": float,
|
||||
"bit_rate_unit": string,
|
||||
"tx_power": integer,
|
||||
"tx_power_unit": string,
|
||||
"retry_short_limit": integer,
|
||||
"rts_threshold": boolean,
|
||||
"fragment_threshold": boolean,
|
||||
"power_management": boolean,
|
||||
"link_quality": string,
|
||||
"signal_level": integer,
|
||||
"signal_level_unit": string,
|
||||
"rx_invalid_nwid": integer,
|
||||
"rx_invalid_crypt": integer,
|
||||
"rx_invalid_frag": integer,
|
||||
"tx_excessive_retries": integer,
|
||||
"invalid_misc": integer,
|
||||
"missed_beacon": integer
|
||||
}
|
||||
]
|
||||
|
||||
Examples:
|
||||
|
||||
$ iwconfig | jc --iwconfig -p
|
||||
[
|
||||
{
|
||||
"name": "wlp5s0",
|
||||
"protocol": "IEEE 802.11",
|
||||
"essid": "BLABLABLA",
|
||||
"mode": "Managed",
|
||||
"frequency": 5.18,
|
||||
"frequency_unit": "GHz",
|
||||
"access_point": "E6:64:DA:16:51:BF",
|
||||
"bit_rate": 6.0,
|
||||
"bit_rate_unit": "Mb/s",
|
||||
"tx_power": 30,
|
||||
"tx_power_unit": "dBm",
|
||||
"retry_short_limit": 7,
|
||||
"rts_threshold": false,
|
||||
"fragment_threshold": false,
|
||||
"power_management": true,
|
||||
"link_quality": "61/70",
|
||||
"signal_level": -49,
|
||||
"signal_level_unit": "dBm",
|
||||
"rx_invalid_nwid": 0,
|
||||
"rx_invalid_crypt": 0,
|
||||
"rx_invalid_frag": 0,
|
||||
"tx_excessive_retries": 0,
|
||||
"invalid_misc": 2095,
|
||||
"missed_beacon": 0
|
||||
}
|
||||
]
|
||||
|
||||
<a id="jc.parsers.iwconfig.parse"></a>
|
||||
|
||||
### parse
|
||||
|
||||
```python
|
||||
def parse(data: str,
|
||||
raw: bool = False,
|
||||
quiet: bool = False) -> List[JSONDictType]
|
||||
```
|
||||
|
||||
Main text parsing function
|
||||
|
||||
Parameters:
|
||||
|
||||
data: (string) text data to parse
|
||||
raw: (boolean) unprocessed output if True
|
||||
quiet: (boolean) suppress warning messages if True
|
||||
|
||||
Returns:
|
||||
|
||||
List of Dictionaries. Raw or processed structured data.
|
||||
|
||||
### Parser Information
|
||||
Compatibility: linux
|
||||
|
||||
Version 1.1 by Thomas Vincent (vrince@gmail.com)
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
# jc.parsers.kv
|
||||
|
||||
jc - JSON Convert `Key/Value` file parser
|
||||
jc - JSON Convert `Key/Value` file and string parser
|
||||
|
||||
Supports files containing simple key/value pairs.
|
||||
|
||||
@@ -26,8 +26,8 @@ Usage (module):
|
||||
|
||||
Schema:
|
||||
|
||||
key/value document converted to a dictionary - see the configparser standard
|
||||
library documentation for more details.
|
||||
Key/Value document converted to a dictionary - see the python configparser
|
||||
standard library documentation for more details.
|
||||
|
||||
{
|
||||
"key1": string,
|
||||
@@ -41,6 +41,7 @@ Examples:
|
||||
name = John Doe
|
||||
address=555 California Drive
|
||||
age: 34
|
||||
|
||||
; comments can include # or ;
|
||||
# delimiter can be = or :
|
||||
# quoted values have quotation marks stripped by default
|
||||
@@ -65,8 +66,6 @@ def parse(data, raw=False, quiet=False)
|
||||
|
||||
Main text parsing function
|
||||
|
||||
Note: this is just a wrapper for jc.parsers.ini
|
||||
|
||||
Parameters:
|
||||
|
||||
data: (string) text data to parse
|
||||
@@ -75,9 +74,9 @@ Parameters:
|
||||
|
||||
Returns:
|
||||
|
||||
Dictionary representing the key/value file
|
||||
Dictionary representing a Key/Value pair document.
|
||||
|
||||
### Parser Information
|
||||
Compatibility: linux, darwin, cygwin, win32, aix, freebsd
|
||||
|
||||
Version 1.2 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
Version 2.0 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
jc - JSON Convert `last` and `lastb` command output parser
|
||||
|
||||
Supports `-w` and `-F` options.
|
||||
Supports `-w`, `-F`, and `-x` options.
|
||||
|
||||
Calculated epoch time fields are naive (i.e. based on the local time of the
|
||||
system the parser is run on) since there is no timezone information in the
|
||||
@@ -127,4 +127,4 @@ Returns:
|
||||
### Parser Information
|
||||
Compatibility: linux, darwin, aix, freebsd
|
||||
|
||||
Version 1.8 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
Version 1.9 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
|
||||
@@ -99,4 +99,4 @@ Returns:
|
||||
### Parser Information
|
||||
Compatibility: linux, darwin, cygwin, aix, freebsd
|
||||
|
||||
Version 1.1 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
Version 1.2 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
|
||||
89
docs/parsers/lsattr.md
Normal file
89
docs/parsers/lsattr.md
Normal file
@@ -0,0 +1,89 @@
|
||||
[Home](https://kellyjonbrazil.github.io/jc/)
|
||||
<a id="jc.parsers.lsattr"></a>
|
||||
|
||||
# jc.parsers.lsattr
|
||||
|
||||
jc - JSON Convert `lsattr` command output parser
|
||||
|
||||
Usage (cli):
|
||||
|
||||
$ lsattr | jc --lsattr
|
||||
|
||||
or
|
||||
|
||||
$ jc lsattr
|
||||
|
||||
Usage (module):
|
||||
|
||||
import jc
|
||||
result = jc.parse('lsattr', lsattr_command_output)
|
||||
|
||||
Schema:
|
||||
|
||||
Information from https://github.com/mirror/busybox/blob/2d4a3d9e6c1493a9520b907e07a41aca90cdfd94/e2fsprogs/e2fs_lib.c#L40
|
||||
used to define field names
|
||||
|
||||
[
|
||||
{
|
||||
"file": string,
|
||||
"compressed_file": Optional[boolean],
|
||||
"compressed_dirty_file": Optional[boolean],
|
||||
"compression_raw_access": Optional[boolean],
|
||||
"secure_deletion": Optional[boolean],
|
||||
"undelete": Optional[boolean],
|
||||
"synchronous_updates": Optional[boolean],
|
||||
"synchronous_directory_updates": Optional[boolean],
|
||||
"immutable": Optional[boolean],
|
||||
"append_only": Optional[boolean],
|
||||
"no_dump": Optional[boolean],
|
||||
"no_atime": Optional[boolean],
|
||||
"compression_requested": Optional[boolean],
|
||||
"encrypted": Optional[boolean],
|
||||
"journaled_data": Optional[boolean],
|
||||
"indexed_directory": Optional[boolean],
|
||||
"no_tailmerging": Optional[boolean],
|
||||
"top_of_directory_hierarchies": Optional[boolean],
|
||||
"extents": Optional[boolean],
|
||||
"no_cow": Optional[boolean],
|
||||
"casefold": Optional[boolean],
|
||||
"inline_data": Optional[boolean],
|
||||
"project_hierarchy": Optional[boolean],
|
||||
"verity": Optional[boolean],
|
||||
}
|
||||
]
|
||||
|
||||
Examples:
|
||||
|
||||
$ sudo lsattr /etc/passwd | jc --lsattr
|
||||
[
|
||||
{
|
||||
"file": "/etc/passwd",
|
||||
"extents": true
|
||||
}
|
||||
]
|
||||
|
||||
<a id="jc.parsers.lsattr.parse"></a>
|
||||
|
||||
### parse
|
||||
|
||||
```python
|
||||
def parse(data: str,
|
||||
raw: bool = False,
|
||||
quiet: bool = False) -> List[JSONDictType]
|
||||
```
|
||||
|
||||
Main text parsing function
|
||||
|
||||
Parameters:
|
||||
|
||||
data: (string) text data to parse
|
||||
quiet: (boolean) suppress warning messages if True
|
||||
|
||||
Returns:
|
||||
|
||||
List of Dictionaries. Raw or processed structured data.
|
||||
|
||||
### Parser Information
|
||||
Compatibility: linux
|
||||
|
||||
Version 1.0 by Mark Rotner (rotner.mr@gmail.com)
|
||||
@@ -140,6 +140,6 @@ Returns:
|
||||
List of Dictionaries. Raw or processed structured data.
|
||||
|
||||
### Parser Information
|
||||
Compatibility: linux
|
||||
Compatibility: linux, darwin, aix, freebsd
|
||||
|
||||
Version 1.6 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
|
||||
148
docs/parsers/lspci.md
Normal file
148
docs/parsers/lspci.md
Normal file
@@ -0,0 +1,148 @@
|
||||
[Home](https://kellyjonbrazil.github.io/jc/)
|
||||
<a id="jc.parsers.lspci"></a>
|
||||
|
||||
# jc.parsers.lspci
|
||||
|
||||
jc - JSON Convert `lspci -mmv` command output parser
|
||||
|
||||
This parser supports the following `lspci` options:
|
||||
- `-mmv`
|
||||
- `-nmmv`
|
||||
- `-nnmmv`
|
||||
|
||||
Usage (cli):
|
||||
|
||||
$ lspci -nnmmv | jc --lspci
|
||||
|
||||
or
|
||||
|
||||
$ jc lspci -nnmmv
|
||||
|
||||
Usage (module):
|
||||
|
||||
import jc
|
||||
result = jc.parse('lspci', lspci_command_output)
|
||||
|
||||
Schema:
|
||||
|
||||
[
|
||||
{
|
||||
"slot": string,
|
||||
"domain": string,
|
||||
"domain_int": integer,
|
||||
"bus": string,
|
||||
"bus_int": integer,
|
||||
"dev": string,
|
||||
"dev_int": integer,
|
||||
"function": string,
|
||||
"function_int": integer,
|
||||
"class": string,
|
||||
"class_id": string,
|
||||
"class_id_int": integer,
|
||||
"vendor": string,
|
||||
"vendor_id": string,
|
||||
"vendor_id_int": integer,
|
||||
"device": string,
|
||||
"device_id": string,
|
||||
"device_id_int": integer,
|
||||
"svendor": string,
|
||||
"svendor_id": string,
|
||||
"svendor_id_int": integer,
|
||||
"sdevice": string,
|
||||
"sdevice_id": string,
|
||||
"sdevice_id_int": integer,
|
||||
"rev": string,
|
||||
"physlot": string,
|
||||
"physlot_int": integer,
|
||||
"progif": string,
|
||||
"progif_int": integer
|
||||
}
|
||||
]
|
||||
|
||||
Examples:
|
||||
|
||||
$ lspci -nnmmv | jc --lspci -p
|
||||
[
|
||||
{
|
||||
"slot": "ff:02:05.0",
|
||||
"domain": "ff",
|
||||
"domain_int": 255,
|
||||
"bus": "02",
|
||||
"bus_int": 2,
|
||||
"dev": "05",
|
||||
"dev_int": 5,
|
||||
"function": "0",
|
||||
"function_int": 0,
|
||||
"class": "SATA controller",
|
||||
"class_id": "0106",
|
||||
"class_id_int": 262,
|
||||
"vendor": "VMware",
|
||||
"vendor_id": "15ad",
|
||||
"vendor_id_int": 5549,
|
||||
"device": "SATA AHCI controller",
|
||||
"device_id": "07e0",
|
||||
"device_id_int": 2016,
|
||||
"svendor": "VMware",
|
||||
"svendor_id": "15ad",
|
||||
"svendor_id_int": 5549,
|
||||
"sdevice": "SATA AHCI controller",
|
||||
"sdevice_id": "07e0",
|
||||
"sdevice_id_int": 2016,
|
||||
"physlot": "37",
|
||||
"physlot_int": 55,
|
||||
"progif": "01",
|
||||
"progif_int": 1
|
||||
},
|
||||
...
|
||||
]
|
||||
|
||||
$ lspci -nnmmv | jc --lspci -p -r
|
||||
[
|
||||
{
|
||||
"slot": "ff:02:05.0",
|
||||
"domain": "ff",
|
||||
"bus": "02",
|
||||
"dev": "05",
|
||||
"function": "0",
|
||||
"class": "SATA controller",
|
||||
"class_id": "0106",
|
||||
"vendor": "VMware",
|
||||
"vendor_id": "15ad",
|
||||
"device": "SATA AHCI controller",
|
||||
"device_id": "07e0",
|
||||
"svendor": "VMware",
|
||||
"svendor_id": "15ad",
|
||||
"sdevice": "SATA AHCI controller",
|
||||
"sdevice_id": "07e0",
|
||||
"physlot": "37",
|
||||
"progif": "01"
|
||||
},
|
||||
...
|
||||
]
|
||||
|
||||
<a id="jc.parsers.lspci.parse"></a>
|
||||
|
||||
### parse
|
||||
|
||||
```python
|
||||
def parse(data: str,
|
||||
raw: bool = False,
|
||||
quiet: bool = False) -> List[JSONDictType]
|
||||
```
|
||||
|
||||
Main text parsing function
|
||||
|
||||
Parameters:
|
||||
|
||||
data: (string) text data to parse
|
||||
raw: (boolean) unprocessed output if True
|
||||
quiet: (boolean) suppress warning messages if True
|
||||
|
||||
Returns:
|
||||
|
||||
List of Dictionaries. Raw or processed structured data.
|
||||
|
||||
### Parser Information
|
||||
Compatibility: linux
|
||||
|
||||
Version 1.0 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
@@ -102,6 +102,46 @@ Schema:
|
||||
]
|
||||
}
|
||||
},
|
||||
"cdc_mbim": {
|
||||
"<item>": {
|
||||
"value": string,
|
||||
"description": string,
|
||||
"attributes": [
|
||||
string
|
||||
]
|
||||
}
|
||||
},
|
||||
"cdc_mbim_extended": {
|
||||
"<item>": {
|
||||
"value": string,
|
||||
"description": string,
|
||||
"attributes": [
|
||||
string
|
||||
]
|
||||
}
|
||||
},
|
||||
"videocontrol_descriptors": [
|
||||
{
|
||||
"<item>": {
|
||||
"value": string,
|
||||
"description": string,
|
||||
"attributes": [
|
||||
string
|
||||
]
|
||||
}
|
||||
}
|
||||
],
|
||||
"videostreaming_descriptors": [
|
||||
{
|
||||
"<item>": {
|
||||
"value": string,
|
||||
"description": string,
|
||||
"attributes": [
|
||||
string
|
||||
]
|
||||
}
|
||||
}
|
||||
],
|
||||
"endpoint_descriptors": [
|
||||
{
|
||||
"<item>": {
|
||||
@@ -290,4 +330,4 @@ Returns:
|
||||
### Parser Information
|
||||
Compatibility: linux
|
||||
|
||||
Version 1.2 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
Version 1.4 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
|
||||
@@ -25,7 +25,7 @@ Schema:
|
||||
"filesystem": string,
|
||||
"mount_point": string,
|
||||
"type": string,
|
||||
"access": [
|
||||
"options": [
|
||||
string
|
||||
]
|
||||
}
|
||||
@@ -39,7 +39,7 @@ Example:
|
||||
"filesystem": "sysfs",
|
||||
"mount_point": "/sys",
|
||||
"type": "sysfs",
|
||||
"access": [
|
||||
"options": [
|
||||
"rw",
|
||||
"nosuid",
|
||||
"nodev",
|
||||
@@ -51,7 +51,7 @@ Example:
|
||||
"filesystem": "proc",
|
||||
"mount_point": "/proc",
|
||||
"type": "proc",
|
||||
"access": [
|
||||
"options": [
|
||||
"rw",
|
||||
"nosuid",
|
||||
"nodev",
|
||||
@@ -63,7 +63,7 @@ Example:
|
||||
"filesystem": "udev",
|
||||
"mount_point": "/dev",
|
||||
"type": "devtmpfs",
|
||||
"access": [
|
||||
"options": [
|
||||
"rw",
|
||||
"nosuid",
|
||||
"relatime",
|
||||
@@ -96,6 +96,6 @@ Returns:
|
||||
List of Dictionaries. Raw or processed structured data.
|
||||
|
||||
### Parser Information
|
||||
Compatibility: linux, darwin, freebsd
|
||||
Compatibility: linux, darwin, freebsd, aix
|
||||
|
||||
Version 1.7 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
Version 1.8 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
|
||||
@@ -376,6 +376,6 @@ Returns:
|
||||
List of Dictionaries. Raw or processed structured data.
|
||||
|
||||
### Parser Information
|
||||
Compatibility: linux, darwin, freebsd
|
||||
Compatibility: linux, darwin, freebsd, win32
|
||||
|
||||
Version 1.13 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
Version 1.14 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
|
||||
178
docs/parsers/openvpn.md
Normal file
178
docs/parsers/openvpn.md
Normal file
@@ -0,0 +1,178 @@
|
||||
[Home](https://kellyjonbrazil.github.io/jc/)
|
||||
<a id="jc.parsers.openvpn"></a>
|
||||
|
||||
# jc.parsers.openvpn
|
||||
|
||||
jc - JSON Convert openvpn-status.log file parser
|
||||
|
||||
The `*_epoch` calculated timestamp fields are naive. (i.e. based on
|
||||
the local time of the system the parser is run on)
|
||||
|
||||
Usage (cli):
|
||||
|
||||
$ cat openvpn-status.log | jc --openvpn
|
||||
|
||||
Usage (module):
|
||||
|
||||
import jc
|
||||
result = jc.parse('openvpn', openvpn_status_log_file_output)
|
||||
|
||||
Schema:
|
||||
|
||||
{
|
||||
"clients": [
|
||||
{
|
||||
"common_name": string,
|
||||
"real_address": string,
|
||||
"real_address_prefix": integer, # [0]
|
||||
"real_address_port": integer, # [0]
|
||||
"bytes_received": integer,
|
||||
"bytes_sent": integer,
|
||||
"connected_since": string,
|
||||
"connected_since_epoch": integer,
|
||||
"updated": string,
|
||||
"updated_epoch": integer,
|
||||
}
|
||||
],
|
||||
"routing_table": [
|
||||
{
|
||||
"virtual_address": string,
|
||||
"virtual_address_prefix": integer, # [0]
|
||||
"virtual_address_port": integer, # [0]
|
||||
"common_name": string,
|
||||
"real_address": string,
|
||||
"real_address_prefix": integer, # [0]
|
||||
"real_address_port": integer, # [0]
|
||||
"last_reference": string,
|
||||
"last_reference_epoch": integer,
|
||||
}
|
||||
],
|
||||
"global_stats": {
|
||||
"max_bcast_mcast_queue_len": integer
|
||||
}
|
||||
}
|
||||
|
||||
[0] null/None if not found
|
||||
|
||||
Examples:
|
||||
|
||||
$ cat openvpn-status.log | jc --openvpn -p
|
||||
{
|
||||
"clients": [
|
||||
{
|
||||
"common_name": "foo@example.com",
|
||||
"real_address": "10.10.10.10",
|
||||
"bytes_received": 334948,
|
||||
"bytes_sent": 1973012,
|
||||
"connected_since": "Thu Jun 18 04:23:03 2015",
|
||||
"updated": "Thu Jun 18 08:12:15 2015",
|
||||
"real_address_prefix": null,
|
||||
"real_address_port": 49502,
|
||||
"connected_since_epoch": 1434626583,
|
||||
"updated_epoch": 1434640335
|
||||
},
|
||||
{
|
||||
"common_name": "foo@example.com",
|
||||
"real_address": "10.10.10.10",
|
||||
"bytes_received": 334948,
|
||||
"bytes_sent": 1973012,
|
||||
"connected_since": "Thu Jun 18 04:23:03 2015",
|
||||
"updated": "Thu Jun 18 08:12:15 2015",
|
||||
"real_address_prefix": null,
|
||||
"real_address_port": 49503,
|
||||
"connected_since_epoch": 1434626583,
|
||||
"updated_epoch": 1434640335
|
||||
}
|
||||
],
|
||||
"routing_table": [
|
||||
{
|
||||
"virtual_address": "192.168.255.118",
|
||||
"common_name": "baz@example.com",
|
||||
"real_address": "10.10.10.10",
|
||||
"last_reference": "Thu Jun 18 08:12:09 2015",
|
||||
"virtual_address_prefix": null,
|
||||
"virtual_address_port": null,
|
||||
"real_address_prefix": null,
|
||||
"real_address_port": 63414,
|
||||
"last_reference_epoch": 1434640329
|
||||
},
|
||||
{
|
||||
"virtual_address": "10.200.0.0",
|
||||
"common_name": "baz@example.com",
|
||||
"real_address": "10.10.10.10",
|
||||
"last_reference": "Thu Jun 18 08:12:09 2015",
|
||||
"virtual_address_prefix": 16,
|
||||
"virtual_address_port": null,
|
||||
"real_address_prefix": null,
|
||||
"real_address_port": 63414,
|
||||
"last_reference_epoch": 1434640329
|
||||
}
|
||||
],
|
||||
"global_stats": {
|
||||
"max_bcast_mcast_queue_len": 0
|
||||
}
|
||||
}
|
||||
|
||||
$ cat openvpn-status.log | jc --openvpn -p -r
|
||||
{
|
||||
"clients": [
|
||||
{
|
||||
"common_name": "foo@example.com",
|
||||
"real_address": "10.10.10.10:49502",
|
||||
"bytes_received": "334948",
|
||||
"bytes_sent": "1973012",
|
||||
"connected_since": "Thu Jun 18 04:23:03 2015",
|
||||
"updated": "Thu Jun 18 08:12:15 2015"
|
||||
},
|
||||
{
|
||||
"common_name": "foo@example.com",
|
||||
"real_address": "10.10.10.10:49503",
|
||||
"bytes_received": "334948",
|
||||
"bytes_sent": "1973012",
|
||||
"connected_since": "Thu Jun 18 04:23:03 2015",
|
||||
"updated": "Thu Jun 18 08:12:15 2015"
|
||||
}
|
||||
],
|
||||
"routing_table": [
|
||||
{
|
||||
"virtual_address": "192.168.255.118",
|
||||
"common_name": "baz@example.com",
|
||||
"real_address": "10.10.10.10:63414",
|
||||
"last_reference": "Thu Jun 18 08:12:09 2015"
|
||||
},
|
||||
{
|
||||
"virtual_address": "10.200.0.0/16",
|
||||
"common_name": "baz@example.com",
|
||||
"real_address": "10.10.10.10:63414",
|
||||
"last_reference": "Thu Jun 18 08:12:09 2015"
|
||||
}
|
||||
],
|
||||
"global_stats": {
|
||||
"max_bcast_mcast_queue_len": "0"
|
||||
}
|
||||
}
|
||||
|
||||
<a id="jc.parsers.openvpn.parse"></a>
|
||||
|
||||
### parse
|
||||
|
||||
```python
|
||||
def parse(data: str, raw: bool = False, quiet: bool = False) -> JSONDictType
|
||||
```
|
||||
|
||||
Main text parsing function
|
||||
|
||||
Parameters:
|
||||
|
||||
data: (string) text data to parse
|
||||
raw: (boolean) unprocessed output if True
|
||||
quiet: (boolean) suppress warning messages if True
|
||||
|
||||
Returns:
|
||||
|
||||
Dictionary. Raw or processed structured data.
|
||||
|
||||
### Parser Information
|
||||
Compatibility: linux, darwin, cygwin, win32, aix, freebsd
|
||||
|
||||
Version 1.0 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
66
docs/parsers/os_prober.md
Normal file
66
docs/parsers/os_prober.md
Normal file
@@ -0,0 +1,66 @@
|
||||
[Home](https://kellyjonbrazil.github.io/jc/)
|
||||
<a id="jc.parsers.os_prober"></a>
|
||||
|
||||
# jc.parsers.os\_prober
|
||||
|
||||
jc - JSON Convert `os-prober` command output parser
|
||||
|
||||
Usage (cli):
|
||||
|
||||
$ os-prober | jc --os-prober
|
||||
|
||||
or
|
||||
|
||||
$ jc os-prober
|
||||
|
||||
Usage (module):
|
||||
|
||||
import jc
|
||||
result = jc.parse('os_prober', os_prober_command_output)
|
||||
|
||||
Schema:
|
||||
|
||||
{
|
||||
"partition": string,
|
||||
"efi_bootmgr": string, # [0]
|
||||
"name": string,
|
||||
"short_name": string,
|
||||
"type": string
|
||||
}
|
||||
|
||||
[0] only exists if an EFI boot manager is detected
|
||||
|
||||
Examples:
|
||||
|
||||
$ os-prober | jc --os-prober -p
|
||||
{
|
||||
"partition": "/dev/sda1",
|
||||
"name": "Windows 10",
|
||||
"short_name": "Windows",
|
||||
"type": "chain"
|
||||
}
|
||||
|
||||
<a id="jc.parsers.os_prober.parse"></a>
|
||||
|
||||
### parse
|
||||
|
||||
```python
|
||||
def parse(data: str, raw: bool = False, quiet: bool = False) -> JSONDictType
|
||||
```
|
||||
|
||||
Main text parsing function
|
||||
|
||||
Parameters:
|
||||
|
||||
data: (string) text data to parse
|
||||
raw: (boolean) unprocessed output if True
|
||||
quiet: (boolean) suppress warning messages if True
|
||||
|
||||
Returns:
|
||||
|
||||
Dictionary. Raw or processed structured data.
|
||||
|
||||
### Parser Information
|
||||
Compatibility: linux
|
||||
|
||||
Version 1.1 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
99
docs/parsers/pci_ids.md
Normal file
99
docs/parsers/pci_ids.md
Normal file
@@ -0,0 +1,99 @@
|
||||
[Home](https://kellyjonbrazil.github.io/jc/)
|
||||
<a id="jc.parsers.pci_ids"></a>
|
||||
|
||||
# jc.parsers.pci\_ids
|
||||
|
||||
jc - JSON Convert `pci.ids` file parser
|
||||
|
||||
This parser converts the pci.ids database file.
|
||||
|
||||
https://raw.githubusercontent.com/pciutils/pciids/master/pci.ids
|
||||
|
||||
A nested schema allows straightforward queries with tools like `jq`. Hex id
|
||||
numbers are prefixed with an underscore (`_`) so bracket notation is not
|
||||
necessary when referencing. For example:
|
||||
|
||||
$ cat pci.ids | jc --pci-ids | jq '.vendors._9005._0053._9005._ffff.subsystem_name'
|
||||
"AIC-7896 SCSI Controller mainboard implementation"
|
||||
|
||||
Here are the vendor and class mappings:
|
||||
|
||||
jq '.vendors._001c._0001._001c._0005.subsystem_name'
|
||||
| | | |
|
||||
| | | subdevice
|
||||
| | subvendor
|
||||
| device
|
||||
vendor
|
||||
|
||||
jq '.classes._0c._03._40'
|
||||
| | |
|
||||
| | prog_if
|
||||
| subclass
|
||||
class
|
||||
|
||||
Usage (cli):
|
||||
|
||||
$ cat pci.ids | jc --pci-ids
|
||||
|
||||
Usage (module):
|
||||
|
||||
import jc
|
||||
result = jc.parse('pci_ids', pci_ids_file_output)
|
||||
|
||||
Schema:
|
||||
|
||||
{
|
||||
"vendors": {
|
||||
"_<vendor_id>": {
|
||||
"vendor_name": string,
|
||||
"_<device_id>": {
|
||||
"device_name": string,
|
||||
"_<subvendor_id>": {
|
||||
"_<subdevice_id": string
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"classes": {
|
||||
"_<class_id>": {
|
||||
"class_name": string,
|
||||
"_<subclass_id>": {
|
||||
"subclass_name": string,
|
||||
"_<prog_if>": string
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Examples:
|
||||
|
||||
$ cat pci.ids | jc --pci-ids | jq '.vendors._001c._0001._001c._0005.subsystem_name'
|
||||
"2 Channel CAN Bus SJC1000 (Optically Isolated)"
|
||||
|
||||
$ cat pci.ids | jc --pci-ids | jq '.classes._0c._03._40'
|
||||
"USB4 Host Interface"
|
||||
|
||||
<a id="jc.parsers.pci_ids.parse"></a>
|
||||
|
||||
### parse
|
||||
|
||||
```python
|
||||
def parse(data: str, raw: bool = False, quiet: bool = False) -> JSONDictType
|
||||
```
|
||||
|
||||
Main text parsing function
|
||||
|
||||
Parameters:
|
||||
|
||||
data: (string) text data to parse
|
||||
raw: (boolean) unprocessed output if True
|
||||
quiet: (boolean) suppress warning messages if True
|
||||
|
||||
Returns:
|
||||
|
||||
Dictionary. Raw or processed structured data.
|
||||
|
||||
### Parser Information
|
||||
Compatibility: linux, darwin, cygwin, win32, aix, freebsd
|
||||
|
||||
Version 1.0 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
75
docs/parsers/pgpass.md
Normal file
75
docs/parsers/pgpass.md
Normal file
@@ -0,0 +1,75 @@
|
||||
[Home](https://kellyjonbrazil.github.io/jc/)
|
||||
<a id="jc.parsers.pgpass"></a>
|
||||
|
||||
# jc.parsers.pgpass
|
||||
|
||||
jc - JSON Convert PostgreSQL password file parser
|
||||
|
||||
Usage (cli):
|
||||
|
||||
$ cat /var/lib/postgresql/.pgpass | jc --pgpass
|
||||
|
||||
Usage (module):
|
||||
|
||||
import jc
|
||||
result = jc.parse('pgpass', postgres_password_file)
|
||||
|
||||
Schema:
|
||||
|
||||
[
|
||||
{
|
||||
"hostname": string,
|
||||
"port": string,
|
||||
"database": string,
|
||||
"username": string,
|
||||
"password": string
|
||||
}
|
||||
]
|
||||
|
||||
Examples:
|
||||
|
||||
$ cat /var/lib/postgresql/.pgpass | jc --pgpass -p
|
||||
[
|
||||
{
|
||||
"hostname": "dbserver",
|
||||
"port": "*",
|
||||
"database": "db1",
|
||||
"username": "dbuser",
|
||||
"password": "pwd123"
|
||||
},
|
||||
{
|
||||
"hostname": "dbserver2",
|
||||
"port": "8888",
|
||||
"database": "inventory",
|
||||
"username": "joe:user",
|
||||
"password": "abc123"
|
||||
},
|
||||
...
|
||||
]
|
||||
|
||||
<a id="jc.parsers.pgpass.parse"></a>
|
||||
|
||||
### parse
|
||||
|
||||
```python
|
||||
def parse(data: str,
|
||||
raw: bool = False,
|
||||
quiet: bool = False) -> List[JSONDictType]
|
||||
```
|
||||
|
||||
Main text parsing function
|
||||
|
||||
Parameters:
|
||||
|
||||
data: (string) text data to parse
|
||||
raw: (boolean) unprocessed output if True
|
||||
quiet: (boolean) suppress warning messages if True
|
||||
|
||||
Returns:
|
||||
|
||||
List of Dictionaries. Raw or processed structured data.
|
||||
|
||||
### Parser Information
|
||||
Compatibility: linux, darwin, cygwin, win32, aix, freebsd
|
||||
|
||||
Version 1.0 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
@@ -3,18 +3,18 @@
|
||||
|
||||
# jc.parsers.pidstat
|
||||
|
||||
jc - JSON Convert `pidstat -h` command output parser
|
||||
jc - JSON Convert `pidstat -H` command output parser
|
||||
|
||||
Must use the `-h` option in `pidstat`. All other `pidstat` options are
|
||||
supported in combination with `-h`.
|
||||
Must use the `-H` (or `-h`, if `-H` is not available) option in `pidstat`.
|
||||
All other `pidstat` options are supported in combination with this option.
|
||||
|
||||
Usage (cli):
|
||||
|
||||
$ pidstat -h | jc --pidstat
|
||||
$ pidstat -H | jc --pidstat
|
||||
|
||||
or
|
||||
|
||||
$ jc pidstat -h
|
||||
$ jc pidstat -H
|
||||
|
||||
Usage (module):
|
||||
|
||||
@@ -51,7 +51,7 @@ Schema:
|
||||
|
||||
Examples:
|
||||
|
||||
$ pidstat -hl | jc --pidstat -p
|
||||
$ pidstat -Hl | jc --pidstat -p
|
||||
[
|
||||
{
|
||||
"time": 1646859134,
|
||||
@@ -88,7 +88,7 @@ Examples:
|
||||
}
|
||||
]
|
||||
|
||||
$ pidstat -hl | jc --pidstat -p -r
|
||||
$ pidstat -Hl | jc --pidstat -p -r
|
||||
[
|
||||
{
|
||||
"time": "1646859134",
|
||||
|
||||
@@ -3,17 +3,17 @@
|
||||
|
||||
# jc.parsers.pidstat\_s
|
||||
|
||||
jc - JSON Convert `pidstat -h` command output streaming parser
|
||||
jc - JSON Convert `pidstat -H` command output streaming parser
|
||||
|
||||
> This streaming parser outputs JSON Lines (cli) or returns an Iterable of
|
||||
> Dictionaries (module)
|
||||
|
||||
Must use the `-h` option in `pidstat`. All other `pidstat` options are
|
||||
supported in combination with `-h`.
|
||||
Must use the `-H` (or `-h`, if `-H` is not available) option in `pidstat`.
|
||||
All other `pidstat` options are supported in combination with this option.
|
||||
|
||||
Usage (cli):
|
||||
|
||||
$ pidstat | jc --pidstat-s
|
||||
$ pidstat -H | jc --pidstat-s
|
||||
|
||||
> Note: When piping `jc` converted `pidstat` output to other processes it
|
||||
> may appear the output is hanging due to the OS pipe buffers. This is
|
||||
@@ -65,13 +65,13 @@ Schema:
|
||||
|
||||
Examples:
|
||||
|
||||
$ pidstat -hl | jc --pidstat-s
|
||||
$ pidstat -Hl | jc --pidstat-s
|
||||
{"time":1646859134,"uid":0,"pid":1,"percent_usr":0.0,"percent_syste...}
|
||||
{"time":1646859134,"uid":0,"pid":6,"percent_usr":0.0,"percent_syste...}
|
||||
{"time":1646859134,"uid":0,"pid":9,"percent_usr":0.0,"percent_syste...}
|
||||
...
|
||||
|
||||
$ pidstat -hl | jc --pidstat-s -r
|
||||
$ pidstat -Hl | jc --pidstat-s -r
|
||||
{"time":"1646859134","uid":"0","pid":"1","percent_usr":"0.00","perc...}
|
||||
{"time":"1646859134","uid":"0","pid":"6","percent_usr":"0.00","perc...}
|
||||
{"time":"1646859134","uid":"0","pid":"9","percent_usr":"0.00","perc...}
|
||||
|
||||
@@ -185,4 +185,4 @@ Returns:
|
||||
### Parser Information
|
||||
Compatibility: linux, darwin, freebsd
|
||||
|
||||
Version 1.8 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
Version 1.9 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
|
||||
@@ -106,4 +106,4 @@ Returns:
|
||||
### Parser Information
|
||||
Compatibility: linux, darwin, freebsd
|
||||
|
||||
Version 1.1 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
Version 1.3 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
jc - JSON Convert PLIST file parser
|
||||
|
||||
Converts binary and XML PLIST files.
|
||||
Converts binary, XML, and NeXTSTEP PLIST files.
|
||||
|
||||
Binary values are converted into an ASCII hex representation.
|
||||
|
||||
@@ -69,9 +69,9 @@ Parameters:
|
||||
|
||||
Returns:
|
||||
|
||||
List of Dictionaries. Raw or processed structured data.
|
||||
Dictionary. Raw or processed structured data.
|
||||
|
||||
### Parser Information
|
||||
Compatibility: linux, darwin, cygwin, win32, aix, freebsd
|
||||
|
||||
Version 1.0 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
Version 1.1 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
|
||||
142
docs/parsers/proc.md
Normal file
142
docs/parsers/proc.md
Normal file
@@ -0,0 +1,142 @@
|
||||
[Home](https://kellyjonbrazil.github.io/jc/)
|
||||
<a id="jc.parsers.proc"></a>
|
||||
|
||||
# jc.parsers.proc
|
||||
|
||||
jc - JSON Convert Proc file output parser
|
||||
|
||||
This parser automatically identifies the Proc file and calls the
|
||||
corresponding parser to perform the parsing.
|
||||
|
||||
Magic syntax for converting `/proc` files is also supported by running
|
||||
`jc /proc/<path to file>`. Any `jc` options must be specified before the
|
||||
`/proc` path.
|
||||
|
||||
specific Proc file parsers can also be called directly, if desired and have
|
||||
a naming convention of `proc-<name>` (cli) or `proc_<name>` (module).
|
||||
|
||||
Usage (cli):
|
||||
|
||||
$ cat /proc/meminfo | jc --proc
|
||||
|
||||
or
|
||||
|
||||
$ jc /proc/meminfo
|
||||
|
||||
or
|
||||
|
||||
$ cat /proc/meminfo | jc --proc-memifno
|
||||
|
||||
Usage (module):
|
||||
|
||||
import jc
|
||||
result = jc.parse('proc', proc_file)
|
||||
|
||||
Schema:
|
||||
|
||||
See the specific Proc parser for the schema:
|
||||
|
||||
$ jc --help --proc-<name>
|
||||
|
||||
For example:
|
||||
|
||||
$ jc --help --proc-meminfo
|
||||
|
||||
Specific Proc file parser names can be found with `jc -hh` or `jc -a`.
|
||||
|
||||
Schemas can also be found online at:
|
||||
|
||||
https://kellyjonbrazil.github.io/jc/docs/parsers/proc_<name>
|
||||
|
||||
For example:
|
||||
|
||||
https://kellyjonbrazil.github.io/jc/docs/parsers/proc_meminfo
|
||||
|
||||
Examples:
|
||||
|
||||
$ cat /proc/modules | jc --proc -p
|
||||
[
|
||||
{
|
||||
"module": "binfmt_misc",
|
||||
"size": 24576,
|
||||
"used": 1,
|
||||
"used_by": [],
|
||||
"status": "Live",
|
||||
"location": "0xffffffffc0ab4000"
|
||||
},
|
||||
{
|
||||
"module": "vsock_loopback",
|
||||
"size": 16384,
|
||||
"used": 0,
|
||||
"used_by": [],
|
||||
"status": "Live",
|
||||
"location": "0xffffffffc0a14000"
|
||||
},
|
||||
{
|
||||
"module": "vmw_vsock_virtio_transport_common",
|
||||
"size": 36864,
|
||||
"used": 1,
|
||||
"used_by": [
|
||||
"vsock_loopback"
|
||||
],
|
||||
"status": "Live",
|
||||
"location": "0xffffffffc0a03000"
|
||||
},
|
||||
...
|
||||
]
|
||||
|
||||
$ cat /proc/modules | jc --proc-modules -p -r
|
||||
[
|
||||
{
|
||||
"module": "binfmt_misc",
|
||||
"size": "24576",
|
||||
"used": "1",
|
||||
"used_by": [],
|
||||
"status": "Live",
|
||||
"location": "0xffffffffc0ab4000"
|
||||
},
|
||||
{
|
||||
"module": "vsock_loopback",
|
||||
"size": "16384",
|
||||
"used": "0",
|
||||
"used_by": [],
|
||||
"status": "Live",
|
||||
"location": "0xffffffffc0a14000"
|
||||
},
|
||||
{
|
||||
"module": "vmw_vsock_virtio_transport_common",
|
||||
"size": "36864",
|
||||
"used": "1",
|
||||
"used_by": [
|
||||
"vsock_loopback"
|
||||
],
|
||||
"status": "Live",
|
||||
"location": "0xffffffffc0a03000"
|
||||
},
|
||||
...
|
||||
]
|
||||
|
||||
<a id="jc.parsers.proc.parse"></a>
|
||||
|
||||
### parse
|
||||
|
||||
```python
|
||||
def parse(data: str, raw: bool = False, quiet: bool = False) -> List[Dict]
|
||||
```
|
||||
|
||||
Main text parsing function
|
||||
|
||||
Parameters:
|
||||
|
||||
data: (string) text data to parse
|
||||
raw: (boolean) unprocessed output if True
|
||||
quiet: (boolean) suppress warning messages if True
|
||||
|
||||
Returns:
|
||||
|
||||
List of Dictionaries. Raw or processed structured data.
|
||||
|
||||
### Parser Information
|
||||
Compatibility: linux
|
||||
|
||||
Version 1.1 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
128
docs/parsers/proc_buddyinfo.md
Normal file
128
docs/parsers/proc_buddyinfo.md
Normal file
@@ -0,0 +1,128 @@
|
||||
[Home](https://kellyjonbrazil.github.io/jc/)
|
||||
<a id="jc.parsers.proc_buddyinfo"></a>
|
||||
|
||||
# jc.parsers.proc\_buddyinfo
|
||||
|
||||
jc - JSON Convert `/proc/buddyinfo` file parser
|
||||
|
||||
Usage (cli):
|
||||
|
||||
$ cat /proc/buddyinfo | jc --proc
|
||||
|
||||
or
|
||||
|
||||
$ jc /proc/buddyinfo
|
||||
|
||||
or
|
||||
|
||||
$ cat /proc/buddyinfo | jc --proc-buddyinfo
|
||||
|
||||
Usage (module):
|
||||
|
||||
import jc
|
||||
result = jc.parse('proc', proc_buddyinfo_file)
|
||||
|
||||
or
|
||||
|
||||
import jc
|
||||
result = jc.parse('proc_buddyinfo', proc_buddyinfo_file)
|
||||
|
||||
Schema:
|
||||
|
||||
All values are integers.
|
||||
|
||||
[
|
||||
{
|
||||
"node": integer,
|
||||
"zone": string,
|
||||
"free_chunks": [
|
||||
integer # [0]
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
[0] array index correlates to the Order number.
|
||||
E.g. free_chunks[0] is the value for Order 0
|
||||
|
||||
|
||||
Examples:
|
||||
|
||||
$ cat /proc/buddyinfo | jc --proc -p
|
||||
[
|
||||
{
|
||||
"node": 0,
|
||||
"zone": "DMA",
|
||||
"free_chunks": [
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
0,
|
||||
1,
|
||||
3
|
||||
]
|
||||
},
|
||||
{
|
||||
"node": 0,
|
||||
"zone": "DMA32",
|
||||
"free_chunks": [
|
||||
78,
|
||||
114,
|
||||
82,
|
||||
52,
|
||||
38,
|
||||
25,
|
||||
13,
|
||||
9,
|
||||
3,
|
||||
4,
|
||||
629
|
||||
]
|
||||
},
|
||||
{
|
||||
"node": 0,
|
||||
"zone": "Normal",
|
||||
"free_chunks": [
|
||||
0,
|
||||
22,
|
||||
8,
|
||||
10,
|
||||
1,
|
||||
1,
|
||||
2,
|
||||
11,
|
||||
13,
|
||||
0,
|
||||
0
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
<a id="jc.parsers.proc_buddyinfo.parse"></a>
|
||||
|
||||
### parse
|
||||
|
||||
```python
|
||||
def parse(data: str, raw: bool = False, quiet: bool = False) -> List[Dict]
|
||||
```
|
||||
|
||||
Main text parsing function
|
||||
|
||||
Parameters:
|
||||
|
||||
data: (string) text data to parse
|
||||
raw: (boolean) unprocessed output if True
|
||||
quiet: (boolean) suppress warning messages if True
|
||||
|
||||
Returns:
|
||||
|
||||
List of Dictionaries. Raw or processed structured data.
|
||||
|
||||
### Parser Information
|
||||
Compatibility: linux
|
||||
|
||||
Version 1.0 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
111
docs/parsers/proc_consoles.md
Normal file
111
docs/parsers/proc_consoles.md
Normal file
@@ -0,0 +1,111 @@
|
||||
[Home](https://kellyjonbrazil.github.io/jc/)
|
||||
<a id="jc.parsers.proc_consoles"></a>
|
||||
|
||||
# jc.parsers.proc\_consoles
|
||||
|
||||
jc - JSON Convert `/proc/consoles` file parser
|
||||
|
||||
Usage (cli):
|
||||
|
||||
$ cat /proc/consoles | jc --proc
|
||||
|
||||
or
|
||||
|
||||
$ jc /proc/consoles
|
||||
|
||||
or
|
||||
|
||||
$ cat /proc/consoles | jc --proc-consoles
|
||||
|
||||
Usage (module):
|
||||
|
||||
import jc
|
||||
result = jc.parse('proc', proc_consoles_file)
|
||||
|
||||
or
|
||||
|
||||
import jc
|
||||
result = jc.parse('proc_consoles', proc_consoles_file)
|
||||
|
||||
Schema:
|
||||
|
||||
[
|
||||
{
|
||||
"device": string,
|
||||
"operations": string,
|
||||
"operations_list": [
|
||||
string # [0]
|
||||
],
|
||||
"flags": string,
|
||||
"flags_list": [
|
||||
string # [1]
|
||||
],
|
||||
"major": integer,
|
||||
"minor": integer
|
||||
}
|
||||
]
|
||||
|
||||
[0] Values: read, write, unblank
|
||||
[1] Values: enabled, preferred, primary boot, prink buffer,
|
||||
braille device, safe when CPU offline
|
||||
|
||||
Examples:
|
||||
|
||||
$ cat /proc/consoles | jc --proc -p
|
||||
[
|
||||
{
|
||||
"device": "tty0",
|
||||
"operations": "-WU",
|
||||
"operations_list": [
|
||||
"write",
|
||||
"unblank"
|
||||
],
|
||||
"flags": "ECp",
|
||||
"flags_list": [
|
||||
"enabled",
|
||||
"preferred",
|
||||
"printk buffer"
|
||||
],
|
||||
"major": 4,
|
||||
"minor": 7
|
||||
},
|
||||
{
|
||||
"device": "ttyS0",
|
||||
"operations": "-W-",
|
||||
"operations_list": [
|
||||
"write"
|
||||
],
|
||||
"flags": "Ep",
|
||||
"flags_list": [
|
||||
"enabled",
|
||||
"printk buffer"
|
||||
],
|
||||
"major": 4,
|
||||
"minor": 64
|
||||
}
|
||||
]
|
||||
|
||||
<a id="jc.parsers.proc_consoles.parse"></a>
|
||||
|
||||
### parse
|
||||
|
||||
```python
|
||||
def parse(data: str, raw: bool = False, quiet: bool = False) -> List[Dict]
|
||||
```
|
||||
|
||||
Main text parsing function
|
||||
|
||||
Parameters:
|
||||
|
||||
data: (string) text data to parse
|
||||
raw: (boolean) unprocessed output if True
|
||||
quiet: (boolean) suppress warning messages if True
|
||||
|
||||
Returns:
|
||||
|
||||
List of Dictionaries. Raw or processed structured data.
|
||||
|
||||
### Parser Information
|
||||
Compatibility: linux
|
||||
|
||||
Version 1.0 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
247
docs/parsers/proc_cpuinfo.md
Normal file
247
docs/parsers/proc_cpuinfo.md
Normal file
@@ -0,0 +1,247 @@
|
||||
[Home](https://kellyjonbrazil.github.io/jc/)
|
||||
<a id="jc.parsers.proc_cpuinfo"></a>
|
||||
|
||||
# jc.parsers.proc\_cpuinfo
|
||||
|
||||
jc - JSON Convert `/proc/cpuinfo` file parser
|
||||
|
||||
Usage (cli):
|
||||
|
||||
$ cat /proc/cpuinfo | jc --proc
|
||||
|
||||
or
|
||||
|
||||
$ jc /proc/cpuinfo
|
||||
|
||||
or
|
||||
|
||||
$ cat /proc/cpuinfo | jc --proc-cpuinfo
|
||||
|
||||
Usage (module):
|
||||
|
||||
import jc
|
||||
result = jc.parse('proc', proc_cpuinfo_file)
|
||||
|
||||
or
|
||||
|
||||
import jc
|
||||
result = jc.parse('proc_cpuinfo', proc_cpuinfo_file)
|
||||
|
||||
Schema:
|
||||
|
||||
Integer, float, and boolean ("yes"/"no") conversions are attempted. Blank
|
||||
strings are converted to `null`.
|
||||
|
||||
"Well-known" keys like `cache size`, `address types`, `bugs`, and `flags`
|
||||
are processed into sensible data types. (see below)
|
||||
|
||||
If this is not desired, then use the `--raw` (CLI) or `raw=True` (Module)
|
||||
option.
|
||||
|
||||
[
|
||||
{
|
||||
"processor": integer,
|
||||
"address sizes": string,
|
||||
"address_size_physical": integer, # in bits
|
||||
"address_size_virtual": integer, # in bits
|
||||
"cache size": string,
|
||||
"cache_size_num": integer,
|
||||
"cache_size_unit": string,
|
||||
"flags": [
|
||||
string
|
||||
],
|
||||
"bugs": [
|
||||
string
|
||||
],
|
||||
"bogomips": float,
|
||||
<key>: string/int/float/boolean/null
|
||||
}
|
||||
]
|
||||
|
||||
Examples:
|
||||
|
||||
$ cat /proc/cpuinfo | jc --proc -p
|
||||
[
|
||||
{
|
||||
"processor": 0,
|
||||
"vendor_id": "GenuineIntel",
|
||||
"cpu family": 6,
|
||||
"model": 142,
|
||||
"model name": "Intel(R) Core(TM) i5-8279U CPU @ 2.40GHz",
|
||||
"stepping": 10,
|
||||
"cpu MHz": 2400.0,
|
||||
"cache size": "6144 KB",
|
||||
"physical id": 0,
|
||||
"siblings": 1,
|
||||
"core id": 0,
|
||||
"cpu cores": 1,
|
||||
"apicid": 0,
|
||||
"initial apicid": 0,
|
||||
"fpu": true,
|
||||
"fpu_exception": true,
|
||||
"cpuid level": 22,
|
||||
"wp": true,
|
||||
"bogomips": 4800.0,
|
||||
"clflush size": 64,
|
||||
"cache_alignment": 64,
|
||||
"address sizes": "45 bits physical, 48 bits virtual",
|
||||
"power management": null,
|
||||
"address_size_physical": 45,
|
||||
"address_size_virtual": 48,
|
||||
"cache_size_num": 6144,
|
||||
"cache_size_unit": "KB",
|
||||
"flags": [
|
||||
"fpu",
|
||||
"vme",
|
||||
"de",
|
||||
"pse",
|
||||
"tsc",
|
||||
"msr",
|
||||
"pae",
|
||||
"mce",
|
||||
"cx8",
|
||||
"apic",
|
||||
"sep",
|
||||
"mtrr",
|
||||
"pge",
|
||||
"mca",
|
||||
"cmov",
|
||||
"pat",
|
||||
"pse36",
|
||||
"clflush",
|
||||
"mmx",
|
||||
"fxsr",
|
||||
"sse",
|
||||
"sse2",
|
||||
"ss",
|
||||
"syscall",
|
||||
"nx",
|
||||
"pdpe1gb",
|
||||
"rdtscp",
|
||||
"lm",
|
||||
"constant_tsc",
|
||||
"arch_perfmon",
|
||||
"nopl",
|
||||
"xtopology",
|
||||
"tsc_reliable",
|
||||
"nonstop_tsc",
|
||||
"cpuid",
|
||||
"pni",
|
||||
"pclmulqdq",
|
||||
"ssse3",
|
||||
"fma",
|
||||
"cx16",
|
||||
"pcid",
|
||||
"sse4_1",
|
||||
"sse4_2",
|
||||
"x2apic",
|
||||
"movbe",
|
||||
"popcnt",
|
||||
"tsc_deadline_timer",
|
||||
"aes",
|
||||
"xsave",
|
||||
"avx",
|
||||
"f16c",
|
||||
"rdrand",
|
||||
"hypervisor",
|
||||
"lahf_lm",
|
||||
"abm",
|
||||
"3dnowprefetch",
|
||||
"cpuid_fault",
|
||||
"invpcid_single",
|
||||
"pti",
|
||||
"ssbd",
|
||||
"ibrs",
|
||||
"ibpb",
|
||||
"stibp",
|
||||
"fsgsbase",
|
||||
"tsc_adjust",
|
||||
"bmi1",
|
||||
"avx2",
|
||||
"smep",
|
||||
"bmi2",
|
||||
"invpcid",
|
||||
"rdseed",
|
||||
"adx",
|
||||
"smap",
|
||||
"clflushopt",
|
||||
"xsaveopt",
|
||||
"xsavec",
|
||||
"xgetbv1",
|
||||
"xsaves",
|
||||
"arat",
|
||||
"md_clear",
|
||||
"flush_l1d",
|
||||
"arch_capabilities"
|
||||
],
|
||||
"bugs": [
|
||||
"cpu_meltdown",
|
||||
"spectre_v1",
|
||||
"spectre_v2",
|
||||
"spec_store_bypass",
|
||||
"l1tf",
|
||||
"mds",
|
||||
"swapgs",
|
||||
"itlb_multihit",
|
||||
"srbds"
|
||||
]
|
||||
},
|
||||
...
|
||||
]
|
||||
|
||||
$ cat /proc/cpuinfo | jc --proc_cpuinfo -p -r
|
||||
[
|
||||
{
|
||||
"processor": "0",
|
||||
"vendor_id": "GenuineIntel",
|
||||
"cpu family": "6",
|
||||
"model": "142",
|
||||
"model name": "Intel(R) Core(TM) i5-8279U CPU @ 2.40GHz",
|
||||
"stepping": "10",
|
||||
"cpu MHz": "2400.000",
|
||||
"cache size": "6144 KB",
|
||||
"physical id": "0",
|
||||
"siblings": "1",
|
||||
"core id": "0",
|
||||
"cpu cores": "1",
|
||||
"apicid": "0",
|
||||
"initial apicid": "0",
|
||||
"fpu": "yes",
|
||||
"fpu_exception": "yes",
|
||||
"cpuid level": "22",
|
||||
"wp": "yes",
|
||||
"flags": "fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge ...",
|
||||
"bugs": "cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass ...",
|
||||
"bogomips": "4800.00",
|
||||
"clflush size": "64",
|
||||
"cache_alignment": "64",
|
||||
"address sizes": "45 bits physical, 48 bits virtual",
|
||||
"power management": ""
|
||||
},
|
||||
...
|
||||
]
|
||||
|
||||
<a id="jc.parsers.proc_cpuinfo.parse"></a>
|
||||
|
||||
### parse
|
||||
|
||||
```python
|
||||
def parse(data: str, raw: bool = False, quiet: bool = False) -> List[Dict]
|
||||
```
|
||||
|
||||
Main text parsing function
|
||||
|
||||
Parameters:
|
||||
|
||||
data: (string) text data to parse
|
||||
raw: (boolean) unprocessed output if True
|
||||
quiet: (boolean) suppress warning messages if True
|
||||
|
||||
Returns:
|
||||
|
||||
List of Dictionaries. Raw or processed structured data.
|
||||
|
||||
### Parser Information
|
||||
Compatibility: linux
|
||||
|
||||
Version 1.0 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
143
docs/parsers/proc_crypto.md
Normal file
143
docs/parsers/proc_crypto.md
Normal file
@@ -0,0 +1,143 @@
|
||||
[Home](https://kellyjonbrazil.github.io/jc/)
|
||||
<a id="jc.parsers.proc_crypto"></a>
|
||||
|
||||
# jc.parsers.proc\_crypto
|
||||
|
||||
jc - JSON Convert `/proc/crypto` file parser
|
||||
|
||||
Usage (cli):
|
||||
|
||||
$ cat /proc/crypto | jc --proc
|
||||
|
||||
or
|
||||
|
||||
$ jc /proc/crypto
|
||||
|
||||
or
|
||||
|
||||
$ cat /proc/crypto | jc --proc-crypto
|
||||
|
||||
Usage (module):
|
||||
|
||||
import jc
|
||||
result = jc.parse('proc', proc_crypto_file)
|
||||
|
||||
or
|
||||
|
||||
import jc
|
||||
result = jc.parse('proc_crypto', proc_crypto_file)
|
||||
|
||||
Schema:
|
||||
|
||||
"Well-known" keys like `priority` and `refcnt` are converted to integers.
|
||||
Also, keynames ending in "size" are converted to integers.
|
||||
|
||||
If this is not desired, then use the `--raw` (CLI) or `raw=True` (Module)
|
||||
option.
|
||||
|
||||
[
|
||||
{
|
||||
"name": string,
|
||||
"driver": string,
|
||||
"module": string,
|
||||
"priority": integer,
|
||||
"refcnt": integer,
|
||||
"selftest": string,
|
||||
"internal": string,
|
||||
"type": string,
|
||||
"*size": integer
|
||||
}
|
||||
]
|
||||
|
||||
Examples:
|
||||
|
||||
$ cat /proc/crypto | jc --proc -p
|
||||
[
|
||||
{
|
||||
"name": "ecdh",
|
||||
"driver": "ecdh-generic",
|
||||
"module": "ecdh_generic",
|
||||
"priority": 100,
|
||||
"refcnt": 1,
|
||||
"selftest": "passed",
|
||||
"internal": "no",
|
||||
"type": "kpp"
|
||||
},
|
||||
{
|
||||
"name": "blake2b-512",
|
||||
"driver": "blake2b-512-generic",
|
||||
"module": "blake2b_generic",
|
||||
"priority": 100,
|
||||
"refcnt": 1,
|
||||
"selftest": "passed",
|
||||
"internal": "no",
|
||||
"type": "shash",
|
||||
"blocksize": 128,
|
||||
"digestsize": 64
|
||||
},
|
||||
...
|
||||
]
|
||||
|
||||
$ cat /proc/crypto | jc --proc_crypto -p -r
|
||||
[
|
||||
{
|
||||
"name": "ecdh",
|
||||
"driver": "ecdh-generic",
|
||||
"module": "ecdh_generic",
|
||||
"priority": "100",
|
||||
"refcnt": "1",
|
||||
"selftest": "passed",
|
||||
"internal": "no",
|
||||
"type": "kpp"
|
||||
},
|
||||
{
|
||||
"name": "blake2b-512",
|
||||
"driver": "blake2b-512-generic",
|
||||
"module": "blake2b_generic",
|
||||
"priority": "100",
|
||||
"refcnt": "1",
|
||||
"selftest": "passed",
|
||||
"internal": "no",
|
||||
"type": "shash",
|
||||
"blocksize": "128",
|
||||
"digestsize": "64"
|
||||
},
|
||||
{
|
||||
"name": "blake2b-384",
|
||||
"driver": "blake2b-384-generic",
|
||||
"module": "blake2b_generic",
|
||||
"priority": "100",
|
||||
"refcnt": "1",
|
||||
"selftest": "passed",
|
||||
"internal": "no",
|
||||
"type": "shash",
|
||||
"blocksize": "128",
|
||||
"digestsize": "48"
|
||||
},
|
||||
...
|
||||
]
|
||||
|
||||
<a id="jc.parsers.proc_crypto.parse"></a>
|
||||
|
||||
### parse
|
||||
|
||||
```python
|
||||
def parse(data: str, raw: bool = False, quiet: bool = False) -> List[Dict]
|
||||
```
|
||||
|
||||
Main text parsing function
|
||||
|
||||
Parameters:
|
||||
|
||||
data: (string) text data to parse
|
||||
raw: (boolean) unprocessed output if True
|
||||
quiet: (boolean) suppress warning messages if True
|
||||
|
||||
Returns:
|
||||
|
||||
List of Dictionaries. Raw or processed structured data.
|
||||
|
||||
### Parser Information
|
||||
Compatibility: linux
|
||||
|
||||
Version 1.0 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
103
docs/parsers/proc_devices.md
Normal file
103
docs/parsers/proc_devices.md
Normal file
@@ -0,0 +1,103 @@
|
||||
[Home](https://kellyjonbrazil.github.io/jc/)
|
||||
<a id="jc.parsers.proc_devices"></a>
|
||||
|
||||
# jc.parsers.proc\_devices
|
||||
|
||||
jc - JSON Convert `/proc/devices` file parser
|
||||
|
||||
Usage (cli):
|
||||
|
||||
$ cat /proc/devices | jc --proc
|
||||
|
||||
or
|
||||
|
||||
$ jc /proc/devices
|
||||
|
||||
or
|
||||
|
||||
$ cat /proc/devices | jc --proc-devices
|
||||
|
||||
Usage (module):
|
||||
|
||||
import jc
|
||||
result = jc.parse('proc', proc_devices_file)
|
||||
|
||||
or
|
||||
|
||||
import jc
|
||||
result = jc.parse('proc_devices', proc_devices_file)
|
||||
|
||||
Schema:
|
||||
|
||||
Since devices can be members of multiple groups, the value for each device
|
||||
is a list.
|
||||
|
||||
{
|
||||
"character": {
|
||||
"<device number>": [
|
||||
string
|
||||
]
|
||||
},
|
||||
"block": {
|
||||
"<device number>": [
|
||||
string
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
Examples:
|
||||
|
||||
$ cat /proc/devices | jc --proc -p
|
||||
{
|
||||
"character": {
|
||||
"1": [
|
||||
"mem"
|
||||
],
|
||||
"4": [
|
||||
"/dev/vc/0",
|
||||
"tty",
|
||||
"ttyS"
|
||||
],
|
||||
"5": [
|
||||
"/dev/tty",
|
||||
"/dev/console",
|
||||
"/dev/ptmx",
|
||||
"ttyprintk"
|
||||
],
|
||||
"block": {
|
||||
"7": [
|
||||
"loop"
|
||||
],
|
||||
"8": [
|
||||
"sd"
|
||||
],
|
||||
"9": [
|
||||
"md"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
<a id="jc.parsers.proc_devices.parse"></a>
|
||||
|
||||
### parse
|
||||
|
||||
```python
|
||||
def parse(data: str, raw: bool = False, quiet: bool = False) -> Dict
|
||||
```
|
||||
|
||||
Main text parsing function
|
||||
|
||||
Parameters:
|
||||
|
||||
data: (string) text data to parse
|
||||
raw: (boolean) unprocessed output if True
|
||||
quiet: (boolean) suppress warning messages if True
|
||||
|
||||
Returns:
|
||||
|
||||
Dictionary. Raw or processed structured data.
|
||||
|
||||
### Parser Information
|
||||
Compatibility: linux
|
||||
|
||||
Version 1.0 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
202
docs/parsers/proc_diskstats.md
Normal file
202
docs/parsers/proc_diskstats.md
Normal file
@@ -0,0 +1,202 @@
|
||||
[Home](https://kellyjonbrazil.github.io/jc/)
|
||||
<a id="jc.parsers.proc_diskstats"></a>
|
||||
|
||||
# jc.parsers.proc\_diskstats
|
||||
|
||||
jc - JSON Convert `/proc/diskstats` file parser
|
||||
|
||||
Usage (cli):
|
||||
|
||||
$ cat /proc/diskstats | jc --proc
|
||||
|
||||
or
|
||||
|
||||
$ jc /proc/diskstats
|
||||
|
||||
or
|
||||
|
||||
$ cat /proc/diskstats | jc --proc-diskstats
|
||||
|
||||
Usage (module):
|
||||
|
||||
import jc
|
||||
result = jc.parse('proc', proc_diskstats_file)
|
||||
|
||||
or
|
||||
|
||||
import jc
|
||||
result = jc.parse('proc_diskstats', proc_diskstats_file)
|
||||
|
||||
Schema:
|
||||
|
||||
[
|
||||
{
|
||||
"maj": integer,
|
||||
"min": integer,
|
||||
"device": string,
|
||||
"reads_completed": integer,
|
||||
"reads_merged": integer,
|
||||
"sectors_read": integer,
|
||||
"read_time_ms": integer,
|
||||
"writes_completed": integer,
|
||||
"writes_merged": integer,
|
||||
"sectors_written": integer,
|
||||
"write_time_ms": integer,
|
||||
"io_in_progress": integer,
|
||||
"io_time_ms": integer,
|
||||
"weighted_io_time_ms": integer,
|
||||
"discards_completed_successfully": integer,
|
||||
"discards_merged": integer,
|
||||
"sectors_discarded": integer,
|
||||
"discarding_time_ms": integer,
|
||||
"flush_requests_completed_successfully": integer,
|
||||
"flushing_time_ms": integer
|
||||
}
|
||||
]
|
||||
|
||||
Examples:
|
||||
|
||||
$ cat /proc/diskstats | jc --proc -p
|
||||
[
|
||||
{
|
||||
"maj": 7,
|
||||
"min": 0,
|
||||
"device": "loop0",
|
||||
"reads_completed": 48,
|
||||
"reads_merged": 0,
|
||||
"sectors_read": 718,
|
||||
"read_time_ms": 19,
|
||||
"writes_completed": 0,
|
||||
"writes_merged": 0,
|
||||
"sectors_written": 0,
|
||||
"write_time_ms": 0,
|
||||
"io_in_progress": 0,
|
||||
"io_time_ms": 36,
|
||||
"weighted_io_time_ms": 19,
|
||||
"discards_completed_successfully": 0,
|
||||
"discards_merged": 0,
|
||||
"sectors_discarded": 0,
|
||||
"discarding_time_ms": 0,
|
||||
"flush_requests_completed_successfully": 0,
|
||||
"flushing_time_ms": 0
|
||||
},
|
||||
{
|
||||
"maj": 7,
|
||||
"min": 1,
|
||||
"device": "loop1",
|
||||
"reads_completed": 41,
|
||||
"reads_merged": 0,
|
||||
"sectors_read": 688,
|
||||
"read_time_ms": 17,
|
||||
"writes_completed": 0,
|
||||
"writes_merged": 0,
|
||||
"sectors_written": 0,
|
||||
"write_time_ms": 0,
|
||||
"io_in_progress": 0,
|
||||
"io_time_ms": 28,
|
||||
"weighted_io_time_ms": 17,
|
||||
"discards_completed_successfully": 0,
|
||||
"discards_merged": 0,
|
||||
"sectors_discarded": 0,
|
||||
"discarding_time_ms": 0,
|
||||
"flush_requests_completed_successfully": 0,
|
||||
"flushing_time_ms": 0
|
||||
},
|
||||
...
|
||||
]
|
||||
|
||||
$ cat /proc/diskstats | jc --proc_diskstats -p -r
|
||||
[
|
||||
{
|
||||
"maj": "7",
|
||||
"min": "0",
|
||||
"device": "loop0",
|
||||
"reads_completed": "48",
|
||||
"reads_merged": "0",
|
||||
"sectors_read": "718",
|
||||
"read_time_ms": "19",
|
||||
"writes_completed": "0",
|
||||
"writes_merged": "0",
|
||||
"sectors_written": "0",
|
||||
"write_time_ms": "0",
|
||||
"io_in_progress": "0",
|
||||
"io_time_ms": "36",
|
||||
"weighted_io_time_ms": "19",
|
||||
"discards_completed_successfully": "0",
|
||||
"discards_merged": "0",
|
||||
"sectors_discarded": "0",
|
||||
"discarding_time_ms": "0",
|
||||
"flush_requests_completed_successfully": "0",
|
||||
"flushing_time_ms": "0"
|
||||
},
|
||||
{
|
||||
"maj": "7",
|
||||
"min": "1",
|
||||
"device": "loop1",
|
||||
"reads_completed": "41",
|
||||
"reads_merged": "0",
|
||||
"sectors_read": "688",
|
||||
"read_time_ms": "17",
|
||||
"writes_completed": "0",
|
||||
"writes_merged": "0",
|
||||
"sectors_written": "0",
|
||||
"write_time_ms": "0",
|
||||
"io_in_progress": "0",
|
||||
"io_time_ms": "28",
|
||||
"weighted_io_time_ms": "17",
|
||||
"discards_completed_successfully": "0",
|
||||
"discards_merged": "0",
|
||||
"sectors_discarded": "0",
|
||||
"discarding_time_ms": "0",
|
||||
"flush_requests_completed_successfully": "0",
|
||||
"flushing_time_ms": "0"
|
||||
},
|
||||
{
|
||||
"maj": "7",
|
||||
"min": "2",
|
||||
"device": "loop2",
|
||||
"reads_completed": "119",
|
||||
"reads_merged": "0",
|
||||
"sectors_read": "2956",
|
||||
"read_time_ms": "18",
|
||||
"writes_completed": "0",
|
||||
"writes_merged": "0",
|
||||
"sectors_written": "0",
|
||||
"write_time_ms": "0",
|
||||
"io_in_progress": "0",
|
||||
"io_time_ms": "56",
|
||||
"weighted_io_time_ms": "18",
|
||||
"discards_completed_successfully": "0",
|
||||
"discards_merged": "0",
|
||||
"sectors_discarded": "0",
|
||||
"discarding_time_ms": "0",
|
||||
"flush_requests_completed_successfully": "0",
|
||||
"flushing_time_ms": "0"
|
||||
},
|
||||
...
|
||||
]
|
||||
|
||||
<a id="jc.parsers.proc_diskstats.parse"></a>
|
||||
|
||||
### parse
|
||||
|
||||
```python
|
||||
def parse(data: str, raw: bool = False, quiet: bool = False) -> List[Dict]
|
||||
```
|
||||
|
||||
Main text parsing function
|
||||
|
||||
Parameters:
|
||||
|
||||
data: (string) text data to parse
|
||||
raw: (boolean) unprocessed output if True
|
||||
quiet: (boolean) suppress warning messages if True
|
||||
|
||||
Returns:
|
||||
|
||||
List of Dictionaries. Raw or processed structured data.
|
||||
|
||||
### Parser Information
|
||||
Compatibility: linux
|
||||
|
||||
Version 1.0 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
126
docs/parsers/proc_driver_rtc.md
Normal file
126
docs/parsers/proc_driver_rtc.md
Normal file
@@ -0,0 +1,126 @@
|
||||
[Home](https://kellyjonbrazil.github.io/jc/)
|
||||
<a id="jc.parsers.proc_driver_rtc"></a>
|
||||
|
||||
# jc.parsers.proc\_driver\_rtc
|
||||
|
||||
jc - JSON Convert `/proc/driver/rtc` file parser
|
||||
|
||||
Usage (cli):
|
||||
|
||||
$ cat /proc/driver/rtc | jc --proc
|
||||
|
||||
or
|
||||
|
||||
$ jc /proc/driver/rtc
|
||||
|
||||
or
|
||||
|
||||
$ cat /proc/driver/rtc | jc --proc-driver-rtc
|
||||
|
||||
Usage (module):
|
||||
|
||||
import jc
|
||||
result = jc.parse('proc', proc_driver_rtc_file)
|
||||
|
||||
or
|
||||
|
||||
import jc
|
||||
result = jc.parse('proc_driver_rtc', proc_driver_rtc_file)
|
||||
|
||||
Schema:
|
||||
|
||||
"yes" and "no" values are converted to `true`/`false`. Integer conversions
|
||||
are attempted. If you do not want this behavior, then use `--raw` (cli) or
|
||||
`raw=True` (module).
|
||||
|
||||
{
|
||||
"rtc_time": string,
|
||||
"rtc_date": string,
|
||||
"alrm_time": string,
|
||||
"alrm_date": string,
|
||||
"alarm_IRQ": boolean,
|
||||
"alrm_pending": boolean,
|
||||
"update IRQ enabled": boolean,
|
||||
"periodic IRQ enabled": boolean,
|
||||
"periodic IRQ frequency": integer,
|
||||
"max user IRQ frequency": integer,
|
||||
"24hr": boolean,
|
||||
"periodic_IRQ": boolean,
|
||||
"update_IRQ": boolean,
|
||||
"HPET_emulated": boolean,
|
||||
"BCD": boolean,
|
||||
"DST_enable": boolean,
|
||||
"periodic_freq": integer,
|
||||
"batt_status": string
|
||||
}
|
||||
|
||||
Examples:
|
||||
|
||||
$ cat /proc/driver/rtc | jc --proc -p
|
||||
{
|
||||
"rtc_time": "16:09:21",
|
||||
"rtc_date": "2022-09-03",
|
||||
"alrm_time": "00:00:00",
|
||||
"alrm_date": "2022-09-03",
|
||||
"alarm_IRQ": false,
|
||||
"alrm_pending": false,
|
||||
"update IRQ enabled": false,
|
||||
"periodic IRQ enabled": false,
|
||||
"periodic IRQ frequency": 1024,
|
||||
"max user IRQ frequency": 64,
|
||||
"24hr": true,
|
||||
"periodic_IRQ": false,
|
||||
"update_IRQ": false,
|
||||
"HPET_emulated": true,
|
||||
"BCD": true,
|
||||
"DST_enable": false,
|
||||
"periodic_freq": 1024,
|
||||
"batt_status": "okay"
|
||||
}
|
||||
|
||||
$ cat /proc/driver/rtc | jc --proc -p -r
|
||||
{
|
||||
"rtc_time": "16:09:21",
|
||||
"rtc_date": "2022-09-03",
|
||||
"alrm_time": "00:00:00",
|
||||
"alrm_date": "2022-09-03",
|
||||
"alarm_IRQ": "no",
|
||||
"alrm_pending": "no",
|
||||
"update IRQ enabled": "no",
|
||||
"periodic IRQ enabled": "no",
|
||||
"periodic IRQ frequency": "1024",
|
||||
"max user IRQ frequency": "64",
|
||||
"24hr": "yes",
|
||||
"periodic_IRQ": "no",
|
||||
"update_IRQ": "no",
|
||||
"HPET_emulated": "yes",
|
||||
"BCD": "yes",
|
||||
"DST_enable": "no",
|
||||
"periodic_freq": "1024",
|
||||
"batt_status": "okay"
|
||||
}
|
||||
|
||||
<a id="jc.parsers.proc_driver_rtc.parse"></a>
|
||||
|
||||
### parse
|
||||
|
||||
```python
|
||||
def parse(data: str, raw: bool = False, quiet: bool = False) -> Dict
|
||||
```
|
||||
|
||||
Main text parsing function
|
||||
|
||||
Parameters:
|
||||
|
||||
data: (string) text data to parse
|
||||
raw: (boolean) unprocessed output if True
|
||||
quiet: (boolean) suppress warning messages if True
|
||||
|
||||
Returns:
|
||||
|
||||
Dictionary. Raw or processed structured data.
|
||||
|
||||
### Parser Information
|
||||
Compatibility: linux
|
||||
|
||||
Version 1.0 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
81
docs/parsers/proc_filesystems.md
Normal file
81
docs/parsers/proc_filesystems.md
Normal file
@@ -0,0 +1,81 @@
|
||||
[Home](https://kellyjonbrazil.github.io/jc/)
|
||||
<a id="jc.parsers.proc_filesystems"></a>
|
||||
|
||||
# jc.parsers.proc\_filesystems
|
||||
|
||||
jc - JSON Convert `/proc/filesystems` file parser
|
||||
|
||||
Usage (cli):
|
||||
|
||||
$ cat /proc/filesystems | jc --proc
|
||||
|
||||
or
|
||||
|
||||
$ jc /proc/filesystems
|
||||
|
||||
or
|
||||
|
||||
$ cat /proc/filesystems | jc --proc-filesystems
|
||||
|
||||
Usage (module):
|
||||
|
||||
import jc
|
||||
result = jc.parse('proc', proc_filesystems_file)
|
||||
|
||||
or
|
||||
|
||||
import jc
|
||||
result = jc.parse('proc_filesystems', proc_filesystems_file)
|
||||
|
||||
Schema:
|
||||
|
||||
[
|
||||
{
|
||||
"filesystem": string,
|
||||
"nodev": boolean
|
||||
}
|
||||
]
|
||||
|
||||
Examples:
|
||||
|
||||
$ cat /proc/filesystems | jc --proc -p
|
||||
[
|
||||
{
|
||||
"filesystem": "sysfs",
|
||||
"nodev": true
|
||||
},
|
||||
{
|
||||
"filesystem": "tmpfs",
|
||||
"nodev": true
|
||||
},
|
||||
{
|
||||
"filesystem": "bdev",
|
||||
"nodev": true
|
||||
},
|
||||
...
|
||||
]
|
||||
|
||||
<a id="jc.parsers.proc_filesystems.parse"></a>
|
||||
|
||||
### parse
|
||||
|
||||
```python
|
||||
def parse(data: str, raw: bool = False, quiet: bool = False) -> List[Dict]
|
||||
```
|
||||
|
||||
Main text parsing function
|
||||
|
||||
Parameters:
|
||||
|
||||
data: (string) text data to parse
|
||||
raw: (boolean) unprocessed output if True
|
||||
quiet: (boolean) suppress warning messages if True
|
||||
|
||||
Returns:
|
||||
|
||||
List of Dictionaries. Raw or processed structured data.
|
||||
|
||||
### Parser Information
|
||||
Compatibility: linux
|
||||
|
||||
Version 1.0 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
133
docs/parsers/proc_interrupts.md
Normal file
133
docs/parsers/proc_interrupts.md
Normal file
@@ -0,0 +1,133 @@
|
||||
[Home](https://kellyjonbrazil.github.io/jc/)
|
||||
<a id="jc.parsers.proc_interrupts"></a>
|
||||
|
||||
# jc.parsers.proc\_interrupts
|
||||
|
||||
jc - JSON Convert `/proc/interrupts` file parser
|
||||
|
||||
Usage (cli):
|
||||
|
||||
$ cat /proc/interrupts | jc --proc
|
||||
|
||||
or
|
||||
|
||||
$ jc /proc/interrupts
|
||||
|
||||
or
|
||||
|
||||
$ cat /proc/interrupts | jc --proc-interrupts
|
||||
|
||||
Usage (module):
|
||||
|
||||
import jc
|
||||
result = jc.parse('proc', proc_interrupts_file)
|
||||
|
||||
or
|
||||
|
||||
import jc
|
||||
result = jc.parse('proc_interrupts', proc_interrupts_file)
|
||||
|
||||
Schema:
|
||||
|
||||
[
|
||||
{
|
||||
"irq": string,
|
||||
"cpu_num": integer,
|
||||
"interrupts": [
|
||||
integer
|
||||
],
|
||||
"type": string,
|
||||
"device": [
|
||||
string
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
Examples:
|
||||
|
||||
$ cat /proc/interrupts | jc --proc -p
|
||||
[
|
||||
{
|
||||
"irq": "0",
|
||||
"cpu_num": 2,
|
||||
"interrupts": [
|
||||
18,
|
||||
0
|
||||
],
|
||||
"type": "IO-APIC",
|
||||
"device": [
|
||||
"2-edge",
|
||||
"timer"
|
||||
]
|
||||
},
|
||||
{
|
||||
"irq": "1",
|
||||
"cpu_num": 2,
|
||||
"interrupts": [
|
||||
0,
|
||||
73
|
||||
],
|
||||
"type": "IO-APIC",
|
||||
"device": [
|
||||
"1-edge",
|
||||
"i8042"
|
||||
]
|
||||
},
|
||||
...
|
||||
]
|
||||
|
||||
$ cat /proc/interrupts | jc --proc-interrupts -p -r
|
||||
[
|
||||
{
|
||||
"irq": "0",
|
||||
"cpu_num": 2,
|
||||
"interrupts": [
|
||||
"18",
|
||||
"0"
|
||||
],
|
||||
"type": "IO-APIC",
|
||||
"device": [
|
||||
"2-edge",
|
||||
"timer"
|
||||
]
|
||||
},
|
||||
{
|
||||
"irq": "1",
|
||||
"cpu_num": 2,
|
||||
"interrupts": [
|
||||
"0",
|
||||
"73"
|
||||
],
|
||||
"type": "IO-APIC",
|
||||
"device": [
|
||||
"1-edge",
|
||||
"i8042"
|
||||
]
|
||||
},
|
||||
...
|
||||
]
|
||||
|
||||
<a id="jc.parsers.proc_interrupts.parse"></a>
|
||||
|
||||
### parse
|
||||
|
||||
```python
|
||||
def parse(data: str, raw: bool = False, quiet: bool = False) -> List[Dict]
|
||||
```
|
||||
|
||||
Main text parsing function
|
||||
|
||||
Parameters:
|
||||
|
||||
data: (string) text data to parse
|
||||
raw: (boolean) unprocessed output if True
|
||||
quiet: (boolean) suppress warning messages if True
|
||||
|
||||
Returns:
|
||||
|
||||
List of Dictionaries. Raw or processed structured data.
|
||||
|
||||
### Parser Information
|
||||
Compatibility: linux
|
||||
|
||||
Version 1.0 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
85
docs/parsers/proc_iomem.md
Normal file
85
docs/parsers/proc_iomem.md
Normal file
@@ -0,0 +1,85 @@
|
||||
[Home](https://kellyjonbrazil.github.io/jc/)
|
||||
<a id="jc.parsers.proc_iomem"></a>
|
||||
|
||||
# jc.parsers.proc\_iomem
|
||||
|
||||
jc - JSON Convert `/proc/iomem` file parser
|
||||
|
||||
Usage (cli):
|
||||
|
||||
$ cat /proc/iomem | jc --proc
|
||||
|
||||
or
|
||||
|
||||
$ jc /proc/iomem
|
||||
|
||||
or
|
||||
|
||||
$ cat /proc/iomem | jc --proc-iomem
|
||||
|
||||
Usage (module):
|
||||
|
||||
import jc
|
||||
result = jc.parse('proc', proc_iomem_file)
|
||||
|
||||
or
|
||||
|
||||
import jc
|
||||
result = jc.parse('proc_iomem', proc_iomem_file)
|
||||
|
||||
Schema:
|
||||
|
||||
[
|
||||
{
|
||||
"start": string,
|
||||
"end": string,
|
||||
"device": string
|
||||
}
|
||||
]
|
||||
|
||||
Examples:
|
||||
|
||||
$ cat /proc/iomem | jc --proc -p
|
||||
[
|
||||
{
|
||||
"start": "00000000",
|
||||
"end": "00000fff",
|
||||
"device": "Reserved"
|
||||
},
|
||||
{
|
||||
"start": "00001000",
|
||||
"end": "0009e7ff",
|
||||
"device": "System RAM"
|
||||
},
|
||||
{
|
||||
"start": "0009e800",
|
||||
"end": "0009ffff",
|
||||
"device": "Reserved"
|
||||
},
|
||||
...
|
||||
]
|
||||
|
||||
<a id="jc.parsers.proc_iomem.parse"></a>
|
||||
|
||||
### parse
|
||||
|
||||
```python
|
||||
def parse(data: str, raw: bool = False, quiet: bool = False) -> List[Dict]
|
||||
```
|
||||
|
||||
Main text parsing function
|
||||
|
||||
Parameters:
|
||||
|
||||
data: (string) text data to parse
|
||||
raw: (boolean) unprocessed output if True
|
||||
quiet: (boolean) suppress warning messages if True
|
||||
|
||||
Returns:
|
||||
|
||||
List of Dictionaries. Raw or processed structured data.
|
||||
|
||||
### Parser Information
|
||||
Compatibility: linux
|
||||
|
||||
Version 1.0 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
85
docs/parsers/proc_ioports.md
Normal file
85
docs/parsers/proc_ioports.md
Normal file
@@ -0,0 +1,85 @@
|
||||
[Home](https://kellyjonbrazil.github.io/jc/)
|
||||
<a id="jc.parsers.proc_ioports"></a>
|
||||
|
||||
# jc.parsers.proc\_ioports
|
||||
|
||||
jc - JSON Convert `/proc/ioports` file parser
|
||||
|
||||
Usage (cli):
|
||||
|
||||
$ cat /proc/ioports | jc --proc
|
||||
|
||||
or
|
||||
|
||||
$ jc /proc/ioports
|
||||
|
||||
or
|
||||
|
||||
$ cat /proc/ioports | jc --proc-ioports
|
||||
|
||||
Usage (module):
|
||||
|
||||
import jc
|
||||
result = jc.parse('proc', proc_ioports_file)
|
||||
|
||||
or
|
||||
|
||||
import jc
|
||||
result = jc.parse('proc_ioports', proc_ioports_file)
|
||||
|
||||
Schema:
|
||||
|
||||
[
|
||||
{
|
||||
"start": string,
|
||||
"end": string,
|
||||
"device": string
|
||||
}
|
||||
]
|
||||
|
||||
Examples:
|
||||
|
||||
$ cat /proc/ioports | jc --proc -p
|
||||
[
|
||||
{
|
||||
"start": "0000",
|
||||
"end": "0cf7",
|
||||
"device": "PCI Bus 0000:00"
|
||||
},
|
||||
{
|
||||
"start": "0000",
|
||||
"end": "001f",
|
||||
"device": "dma1"
|
||||
},
|
||||
{
|
||||
"start": "0020",
|
||||
"end": "0021",
|
||||
"device": "PNP0001:00"
|
||||
},
|
||||
...
|
||||
]
|
||||
|
||||
<a id="jc.parsers.proc_ioports.parse"></a>
|
||||
|
||||
### parse
|
||||
|
||||
```python
|
||||
def parse(data: str, raw: bool = False, quiet: bool = False) -> List[Dict]
|
||||
```
|
||||
|
||||
Main text parsing function
|
||||
|
||||
Parameters:
|
||||
|
||||
data: (string) text data to parse
|
||||
raw: (boolean) unprocessed output if True
|
||||
quiet: (boolean) suppress warning messages if True
|
||||
|
||||
Returns:
|
||||
|
||||
List of Dictionaries. Raw or processed structured data.
|
||||
|
||||
### Parser Information
|
||||
Compatibility: linux
|
||||
|
||||
Version 1.0 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
88
docs/parsers/proc_loadavg.md
Normal file
88
docs/parsers/proc_loadavg.md
Normal file
@@ -0,0 +1,88 @@
|
||||
[Home](https://kellyjonbrazil.github.io/jc/)
|
||||
<a id="jc.parsers.proc_loadavg"></a>
|
||||
|
||||
# jc.parsers.proc\_loadavg
|
||||
|
||||
jc - JSON Convert `/proc/loadavg` file parser
|
||||
|
||||
Usage (cli):
|
||||
|
||||
$ cat /proc/loadavg | jc --proc
|
||||
|
||||
or
|
||||
|
||||
$ jc /proc/loadavg
|
||||
|
||||
or
|
||||
|
||||
$ cat /proc/loadavg | jc --proc-loadavg
|
||||
|
||||
Usage (module):
|
||||
|
||||
import jc
|
||||
result = jc.parse('proc', proc_loadavg_file)
|
||||
|
||||
or
|
||||
|
||||
import jc
|
||||
result = jc.parse('proc_loadavg', proc_loadavg_file)
|
||||
|
||||
Schema:
|
||||
|
||||
All values are integers.
|
||||
|
||||
{
|
||||
"load_1m": float,
|
||||
"load_5m": float,
|
||||
"load_15m": float,
|
||||
"running": integer,
|
||||
"available": integer,
|
||||
"last_pid": integer
|
||||
}
|
||||
|
||||
Examples:
|
||||
|
||||
$ cat /proc/loadavg | jc --proc -p
|
||||
{
|
||||
"load_1m": 0.0,
|
||||
"load_5m": 0.01,
|
||||
"load_15m": 0.03,
|
||||
"running": 2,
|
||||
"available": 111,
|
||||
"last_pid": 2039
|
||||
}
|
||||
|
||||
$ cat /proc/loadavg | jc --proc -p -r
|
||||
{
|
||||
"load_1m": "0.00",
|
||||
"load_5m": "0.01",
|
||||
"load_15m": "0.03",
|
||||
"running": "2",
|
||||
"available": "111",
|
||||
"last_pid": "2039"
|
||||
}
|
||||
|
||||
<a id="jc.parsers.proc_loadavg.parse"></a>
|
||||
|
||||
### parse
|
||||
|
||||
```python
|
||||
def parse(data: str, raw: bool = False, quiet: bool = False) -> Dict
|
||||
```
|
||||
|
||||
Main text parsing function
|
||||
|
||||
Parameters:
|
||||
|
||||
data: (string) text data to parse
|
||||
raw: (boolean) unprocessed output if True
|
||||
quiet: (boolean) suppress warning messages if True
|
||||
|
||||
Returns:
|
||||
|
||||
Dictionary. Raw or processed structured data.
|
||||
|
||||
### Parser Information
|
||||
Compatibility: linux
|
||||
|
||||
Version 1.0 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
130
docs/parsers/proc_locks.md
Normal file
130
docs/parsers/proc_locks.md
Normal file
@@ -0,0 +1,130 @@
|
||||
[Home](https://kellyjonbrazil.github.io/jc/)
|
||||
<a id="jc.parsers.proc_locks"></a>
|
||||
|
||||
# jc.parsers.proc\_locks
|
||||
|
||||
jc - JSON Convert `/proc/locks` file parser
|
||||
|
||||
Usage (cli):
|
||||
|
||||
$ cat /proc/locks | jc --proc
|
||||
|
||||
or
|
||||
|
||||
$ jc /proc/locks
|
||||
|
||||
or
|
||||
|
||||
$ cat /proc/locks | jc --proc-locks
|
||||
|
||||
Usage (module):
|
||||
|
||||
import jc
|
||||
result = jc.parse('proc', proc_locks_file)
|
||||
|
||||
or
|
||||
|
||||
import jc
|
||||
result = jc.parse('proc_locks', proc_locks_file)
|
||||
|
||||
Schema:
|
||||
|
||||
[
|
||||
{
|
||||
"id": integer,
|
||||
"class": string,
|
||||
"type": string,
|
||||
"access": string,
|
||||
"pid": integer,
|
||||
"maj": string,
|
||||
"min": string,
|
||||
"inode": integer,
|
||||
"start": string,
|
||||
"end": string
|
||||
}
|
||||
]
|
||||
|
||||
Examples:
|
||||
|
||||
$ cat /proc/locks | jc --proc -p
|
||||
[
|
||||
{
|
||||
"id": 1,
|
||||
"class": "POSIX",
|
||||
"type": "ADVISORY",
|
||||
"access": "WRITE",
|
||||
"pid": 877,
|
||||
"maj": "00",
|
||||
"min": "19",
|
||||
"inode": 812,
|
||||
"start": "0",
|
||||
"end": "EOF"
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"class": "FLOCK",
|
||||
"type": "ADVISORY",
|
||||
"access": "WRITE",
|
||||
"pid": 854,
|
||||
"maj": "00",
|
||||
"min": "19",
|
||||
"inode": 805,
|
||||
"start": "0",
|
||||
"end": "EOF"
|
||||
},
|
||||
...
|
||||
]
|
||||
|
||||
$ cat /proc/locks | jc --proc-locks -p -r
|
||||
[
|
||||
{
|
||||
"id": "1",
|
||||
"class": "POSIX",
|
||||
"type": "ADVISORY",
|
||||
"access": "WRITE",
|
||||
"pid": "877",
|
||||
"maj": "00",
|
||||
"min": "19",
|
||||
"inode": "812",
|
||||
"start": "0",
|
||||
"end": "EOF"
|
||||
},
|
||||
{
|
||||
"id": "2",
|
||||
"class": "FLOCK",
|
||||
"type": "ADVISORY",
|
||||
"access": "WRITE",
|
||||
"pid": "854",
|
||||
"maj": "00",
|
||||
"min": "19",
|
||||
"inode": "805",
|
||||
"start": "0",
|
||||
"end": "EOF"
|
||||
},
|
||||
...
|
||||
]
|
||||
|
||||
<a id="jc.parsers.proc_locks.parse"></a>
|
||||
|
||||
### parse
|
||||
|
||||
```python
|
||||
def parse(data: str, raw: bool = False, quiet: bool = False) -> List[Dict]
|
||||
```
|
||||
|
||||
Main text parsing function
|
||||
|
||||
Parameters:
|
||||
|
||||
data: (string) text data to parse
|
||||
raw: (boolean) unprocessed output if True
|
||||
quiet: (boolean) suppress warning messages if True
|
||||
|
||||
Returns:
|
||||
|
||||
List of Dictionaries. Raw or processed structured data.
|
||||
|
||||
### Parser Information
|
||||
Compatibility: linux
|
||||
|
||||
Version 1.0 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
118
docs/parsers/proc_meminfo.md
Normal file
118
docs/parsers/proc_meminfo.md
Normal file
@@ -0,0 +1,118 @@
|
||||
[Home](https://kellyjonbrazil.github.io/jc/)
|
||||
<a id="jc.parsers.proc_meminfo"></a>
|
||||
|
||||
# jc.parsers.proc\_meminfo
|
||||
|
||||
jc - JSON Convert `/proc/meminfo` file parser
|
||||
|
||||
Usage (cli):
|
||||
|
||||
$ cat /proc/meminfo | jc --proc
|
||||
|
||||
or
|
||||
|
||||
$ jc /proc/meminfo
|
||||
|
||||
or
|
||||
|
||||
$ cat /proc/meminfo | jc --proc-meminfo
|
||||
|
||||
Usage (module):
|
||||
|
||||
import jc
|
||||
result = jc.parse('proc', proc_meminfo_file)
|
||||
|
||||
or
|
||||
|
||||
import jc
|
||||
result = jc.parse('proc_meminfo', proc_meminfo_file)
|
||||
|
||||
Schema:
|
||||
|
||||
All values are integers.
|
||||
|
||||
{
|
||||
<keyName> integer
|
||||
}
|
||||
|
||||
Examples:
|
||||
|
||||
$ cat /proc/meminfo | jc --proc -p
|
||||
{
|
||||
"MemTotal": 3997272,
|
||||
"MemFree": 2760316,
|
||||
"MemAvailable": 3386876,
|
||||
"Buffers": 40452,
|
||||
"Cached": 684856,
|
||||
"SwapCached": 0,
|
||||
"Active": 475816,
|
||||
"Inactive": 322064,
|
||||
"Active(anon)": 70216,
|
||||
"Inactive(anon)": 148,
|
||||
"Active(file)": 405600,
|
||||
"Inactive(file)": 321916,
|
||||
"Unevictable": 19476,
|
||||
"Mlocked": 19476,
|
||||
"SwapTotal": 3996668,
|
||||
"SwapFree": 3996668,
|
||||
"Dirty": 152,
|
||||
"Writeback": 0,
|
||||
"AnonPages": 92064,
|
||||
"Mapped": 79464,
|
||||
"Shmem": 1568,
|
||||
"KReclaimable": 188216,
|
||||
"Slab": 288096,
|
||||
"SReclaimable": 188216,
|
||||
"SUnreclaim": 99880,
|
||||
"KernelStack": 5872,
|
||||
"PageTables": 1812,
|
||||
"NFS_Unstable": 0,
|
||||
"Bounce": 0,
|
||||
"WritebackTmp": 0,
|
||||
"CommitLimit": 5995304,
|
||||
"Committed_AS": 445240,
|
||||
"VmallocTotal": 34359738367,
|
||||
"VmallocUsed": 21932,
|
||||
"VmallocChunk": 0,
|
||||
"Percpu": 107520,
|
||||
"HardwareCorrupted": 0,
|
||||
"AnonHugePages": 0,
|
||||
"ShmemHugePages": 0,
|
||||
"ShmemPmdMapped": 0,
|
||||
"FileHugePages": 0,
|
||||
"FilePmdMapped": 0,
|
||||
"HugePages_Total": 0,
|
||||
"HugePages_Free": 0,
|
||||
"HugePages_Rsvd": 0,
|
||||
"HugePages_Surp": 0,
|
||||
"Hugepagesize": 2048,
|
||||
"Hugetlb": 0,
|
||||
"DirectMap4k": 192320,
|
||||
"DirectMap2M": 4001792,
|
||||
"DirectMap1G": 2097152
|
||||
}
|
||||
|
||||
<a id="jc.parsers.proc_meminfo.parse"></a>
|
||||
|
||||
### parse
|
||||
|
||||
```python
|
||||
def parse(data: str, raw: bool = False, quiet: bool = False) -> Dict
|
||||
```
|
||||
|
||||
Main text parsing function
|
||||
|
||||
Parameters:
|
||||
|
||||
data: (string) text data to parse
|
||||
raw: (boolean) unprocessed output if True
|
||||
quiet: (boolean) suppress warning messages if True
|
||||
|
||||
Returns:
|
||||
|
||||
Dictionary. Raw or processed structured data.
|
||||
|
||||
### Parser Information
|
||||
Compatibility: linux
|
||||
|
||||
Version 1.0 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
132
docs/parsers/proc_modules.md
Normal file
132
docs/parsers/proc_modules.md
Normal file
@@ -0,0 +1,132 @@
|
||||
[Home](https://kellyjonbrazil.github.io/jc/)
|
||||
<a id="jc.parsers.proc_modules"></a>
|
||||
|
||||
# jc.parsers.proc\_modules
|
||||
|
||||
jc - JSON Convert `/proc/modules` file parser
|
||||
|
||||
Usage (cli):
|
||||
|
||||
$ cat /proc/modules | jc --proc
|
||||
|
||||
or
|
||||
|
||||
$ jc /proc/modules
|
||||
|
||||
or
|
||||
|
||||
$ cat /proc/modules | jc --proc-modules
|
||||
|
||||
Usage (module):
|
||||
|
||||
import jc
|
||||
result = jc.parse('proc', proc_modules_file)
|
||||
|
||||
or
|
||||
|
||||
import jc
|
||||
result = jc.parse('proc_modules', proc_modules_file)
|
||||
|
||||
Schema:
|
||||
|
||||
[
|
||||
{
|
||||
"module": string,
|
||||
"size": integer,
|
||||
"used": integer,
|
||||
"used_by": [
|
||||
string
|
||||
],
|
||||
"status": string,
|
||||
"location": string
|
||||
}
|
||||
]
|
||||
|
||||
Examples:
|
||||
|
||||
$ cat /proc/modules | jc --proc -p
|
||||
[
|
||||
{
|
||||
"module": "binfmt_misc",
|
||||
"size": 24576,
|
||||
"used": 1,
|
||||
"used_by": [],
|
||||
"status": "Live",
|
||||
"location": "0xffffffffc0ab4000"
|
||||
},
|
||||
{
|
||||
"module": "vsock_loopback",
|
||||
"size": 16384,
|
||||
"used": 0,
|
||||
"used_by": [],
|
||||
"status": "Live",
|
||||
"location": "0xffffffffc0a14000"
|
||||
},
|
||||
{
|
||||
"module": "vmw_vsock_virtio_transport_common",
|
||||
"size": 36864,
|
||||
"used": 1,
|
||||
"used_by": [
|
||||
"vsock_loopback"
|
||||
],
|
||||
"status": "Live",
|
||||
"location": "0xffffffffc0a03000"
|
||||
},
|
||||
...
|
||||
]
|
||||
|
||||
$ cat /proc/modules | jc --proc-modules -p -r
|
||||
[
|
||||
{
|
||||
"module": "binfmt_misc",
|
||||
"size": "24576",
|
||||
"used": "1",
|
||||
"used_by": [],
|
||||
"status": "Live",
|
||||
"location": "0xffffffffc0ab4000"
|
||||
},
|
||||
{
|
||||
"module": "vsock_loopback",
|
||||
"size": "16384",
|
||||
"used": "0",
|
||||
"used_by": [],
|
||||
"status": "Live",
|
||||
"location": "0xffffffffc0a14000"
|
||||
},
|
||||
{
|
||||
"module": "vmw_vsock_virtio_transport_common",
|
||||
"size": "36864",
|
||||
"used": "1",
|
||||
"used_by": [
|
||||
"vsock_loopback"
|
||||
],
|
||||
"status": "Live",
|
||||
"location": "0xffffffffc0a03000"
|
||||
},
|
||||
...
|
||||
]
|
||||
|
||||
<a id="jc.parsers.proc_modules.parse"></a>
|
||||
|
||||
### parse
|
||||
|
||||
```python
|
||||
def parse(data: str, raw: bool = False, quiet: bool = False) -> List[Dict]
|
||||
```
|
||||
|
||||
Main text parsing function
|
||||
|
||||
Parameters:
|
||||
|
||||
data: (string) text data to parse
|
||||
raw: (boolean) unprocessed output if True
|
||||
quiet: (boolean) suppress warning messages if True
|
||||
|
||||
Returns:
|
||||
|
||||
List of Dictionaries. Raw or processed structured data.
|
||||
|
||||
### Parser Information
|
||||
Compatibility: linux
|
||||
|
||||
Version 1.0 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
111
docs/parsers/proc_mtrr.md
Normal file
111
docs/parsers/proc_mtrr.md
Normal file
@@ -0,0 +1,111 @@
|
||||
[Home](https://kellyjonbrazil.github.io/jc/)
|
||||
<a id="jc.parsers.proc_mtrr"></a>
|
||||
|
||||
# jc.parsers.proc\_mtrr
|
||||
|
||||
jc - JSON Convert `/proc/mtrr` file parser
|
||||
|
||||
Usage (cli):
|
||||
|
||||
$ cat /proc/mtrr | jc --proc
|
||||
|
||||
or
|
||||
|
||||
$ jc /proc/mtrr
|
||||
|
||||
or
|
||||
|
||||
$ cat /proc/mtrr | jc --proc-mtrr
|
||||
|
||||
Usage (module):
|
||||
|
||||
import jc
|
||||
result = jc.parse('proc', proc_mtrr_file)
|
||||
|
||||
or
|
||||
|
||||
import jc
|
||||
result = jc.parse('proc_mtrr', proc_mtrr_file)
|
||||
|
||||
Schema:
|
||||
|
||||
[
|
||||
{
|
||||
"register": string,
|
||||
"type": string,
|
||||
"base": string,
|
||||
"base_mb": integer,
|
||||
"size": integer,
|
||||
"count": integer,
|
||||
"<key>": string # additional key/values are strings
|
||||
}
|
||||
]
|
||||
|
||||
Examples:
|
||||
|
||||
$ cat /proc/mtrr | jc --proc -p
|
||||
[
|
||||
{
|
||||
"register": "reg00",
|
||||
"type": "write-back",
|
||||
"base": "0x000000000",
|
||||
"base_mb": 0,
|
||||
"size": 2048,
|
||||
"count": 1
|
||||
},
|
||||
{
|
||||
"register": "reg01",
|
||||
"type": "write-back",
|
||||
"base": "0x080000000",
|
||||
"base_mb": 2048,
|
||||
"size": 1024,
|
||||
"count": 1
|
||||
},
|
||||
...
|
||||
]
|
||||
|
||||
$ cat /proc/mtrr | jc --proc-mtrr -p -r
|
||||
[
|
||||
{
|
||||
"register": "reg00",
|
||||
"type": "write-back",
|
||||
"base": "0x000000000",
|
||||
"base_mb": "0",
|
||||
"size": "2048MB",
|
||||
"count": "1"
|
||||
},
|
||||
{
|
||||
"register": "reg01",
|
||||
"type": "write-back",
|
||||
"base": "0x080000000",
|
||||
"base_mb": "2048",
|
||||
"size": "1024MB",
|
||||
"count": "1"
|
||||
},
|
||||
...
|
||||
]
|
||||
|
||||
<a id="jc.parsers.proc_mtrr.parse"></a>
|
||||
|
||||
### parse
|
||||
|
||||
```python
|
||||
def parse(data: str, raw: bool = False, quiet: bool = False) -> List[Dict]
|
||||
```
|
||||
|
||||
Main text parsing function
|
||||
|
||||
Parameters:
|
||||
|
||||
data: (string) text data to parse
|
||||
raw: (boolean) unprocessed output if True
|
||||
quiet: (boolean) suppress warning messages if True
|
||||
|
||||
Returns:
|
||||
|
||||
List of Dictionaries. Raw or processed structured data.
|
||||
|
||||
### Parser Information
|
||||
Compatibility: linux
|
||||
|
||||
Version 1.0 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
81
docs/parsers/proc_net_arp.md
Normal file
81
docs/parsers/proc_net_arp.md
Normal file
@@ -0,0 +1,81 @@
|
||||
[Home](https://kellyjonbrazil.github.io/jc/)
|
||||
<a id="jc.parsers.proc_net_arp"></a>
|
||||
|
||||
# jc.parsers.proc\_net\_arp
|
||||
|
||||
jc - JSON Convert `/proc/net/arp` file parser
|
||||
|
||||
Usage (cli):
|
||||
|
||||
$ cat /proc/net/arp | jc --proc
|
||||
|
||||
or
|
||||
|
||||
$ jc /proc/net/arp
|
||||
|
||||
or
|
||||
|
||||
$ cat /proc/net/arp | jc --proc-net-arp
|
||||
|
||||
Usage (module):
|
||||
|
||||
import jc
|
||||
result = jc.parse('proc', proc_net_arp_file)
|
||||
|
||||
or
|
||||
|
||||
import jc
|
||||
result = jc.parse('proc_net_arp', proc_net_arp_file)
|
||||
|
||||
Schema:
|
||||
|
||||
[
|
||||
{
|
||||
"IP_address": string,
|
||||
"HW_type": string,
|
||||
"Flags": string,
|
||||
"HW_address": string,
|
||||
"Mask": string,
|
||||
"Device": string
|
||||
}
|
||||
]
|
||||
|
||||
Examples:
|
||||
|
||||
$ cat /proc/net/arp | jc --proc -p
|
||||
[
|
||||
{
|
||||
"IP_address": "192.168.71.254",
|
||||
"HW_type": "0x1",
|
||||
"Flags": "0x2",
|
||||
"HW_address": "00:50:56:f3:2f:ae",
|
||||
"Mask": "*",
|
||||
"Device": "ens33"
|
||||
},
|
||||
...
|
||||
]
|
||||
|
||||
<a id="jc.parsers.proc_net_arp.parse"></a>
|
||||
|
||||
### parse
|
||||
|
||||
```python
|
||||
def parse(data: str, raw: bool = False, quiet: bool = False) -> List[Dict]
|
||||
```
|
||||
|
||||
Main text parsing function
|
||||
|
||||
Parameters:
|
||||
|
||||
data: (string) text data to parse
|
||||
raw: (boolean) unprocessed output if True
|
||||
quiet: (boolean) suppress warning messages if True
|
||||
|
||||
Returns:
|
||||
|
||||
List of Dictionaries. Raw or processed structured data.
|
||||
|
||||
### Parser Information
|
||||
Compatibility: linux
|
||||
|
||||
Version 1.0 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
127
docs/parsers/proc_net_dev.md
Normal file
127
docs/parsers/proc_net_dev.md
Normal file
@@ -0,0 +1,127 @@
|
||||
[Home](https://kellyjonbrazil.github.io/jc/)
|
||||
<a id="jc.parsers.proc_net_dev"></a>
|
||||
|
||||
# jc.parsers.proc\_net\_dev
|
||||
|
||||
jc - JSON Convert `/proc/net/dev` file parser
|
||||
|
||||
Usage (cli):
|
||||
|
||||
$ cat /proc/net/dev | jc --proc
|
||||
|
||||
or
|
||||
|
||||
$ jc /proc/net/dev
|
||||
|
||||
or
|
||||
|
||||
$ cat /proc/net/dev | jc --proc-net-dev
|
||||
|
||||
Usage (module):
|
||||
|
||||
import jc
|
||||
result = jc.parse('proc', proc_net_dev_file)
|
||||
|
||||
or
|
||||
|
||||
import jc
|
||||
result = jc.parse('proc_net_dev', proc_net_dev_file)
|
||||
|
||||
Schema:
|
||||
|
||||
[
|
||||
{
|
||||
"interface": string,
|
||||
"r_bytes": integer,
|
||||
"r_packets": integer,
|
||||
"r_errs": integer,
|
||||
"r_drop": integer,
|
||||
"r_fifo": integer,
|
||||
"r_frame": integer,
|
||||
"r_compressed": integer,
|
||||
"r_multicast": integer,
|
||||
"t_bytes": integer,
|
||||
"t_packets": integer,
|
||||
"t_errs": integer,
|
||||
"t_drop": integer,
|
||||
"t_fifo": integer,
|
||||
"t_colls": integer,
|
||||
"t_carrier": integer,
|
||||
"t_compressed": integer
|
||||
}
|
||||
]
|
||||
|
||||
Examples:
|
||||
|
||||
$ cat /proc/net/dev | jc --proc -p
|
||||
[
|
||||
{
|
||||
"interface": "lo",
|
||||
"r_bytes": 13222,
|
||||
"r_packets": 152,
|
||||
"r_errs": 0,
|
||||
"r_drop": 0,
|
||||
"r_fifo": 0,
|
||||
"r_frame": 0,
|
||||
"r_compressed": 0,
|
||||
"r_multicast": 0,
|
||||
"t_bytes": 13222,
|
||||
"t_packets": 152,
|
||||
"t_errs": 0,
|
||||
"t_drop": 0,
|
||||
"t_fifo": 0,
|
||||
"t_colls": 0,
|
||||
"t_carrier": 0,
|
||||
"t_compressed": 0
|
||||
},
|
||||
...
|
||||
]
|
||||
|
||||
$ cat /proc/net/dev | jc --proc-net-dev -p -r
|
||||
[
|
||||
{
|
||||
"interface": "lo:",
|
||||
"r_bytes": "13222",
|
||||
"r_packets": "152",
|
||||
"r_errs": "0",
|
||||
"r_drop": "0",
|
||||
"r_fifo": "0",
|
||||
"r_frame": "0",
|
||||
"r_compressed": "0",
|
||||
"r_multicast": "0",
|
||||
"t_bytes": "13222",
|
||||
"t_packets": "152",
|
||||
"t_errs": "0",
|
||||
"t_drop": "0",
|
||||
"t_fifo": "0",
|
||||
"t_colls": "0",
|
||||
"t_carrier": "0",
|
||||
"t_compressed": "0"
|
||||
},
|
||||
...
|
||||
]
|
||||
|
||||
<a id="jc.parsers.proc_net_dev.parse"></a>
|
||||
|
||||
### parse
|
||||
|
||||
```python
|
||||
def parse(data: str, raw: bool = False, quiet: bool = False) -> List[Dict]
|
||||
```
|
||||
|
||||
Main text parsing function
|
||||
|
||||
Parameters:
|
||||
|
||||
data: (string) text data to parse
|
||||
raw: (boolean) unprocessed output if True
|
||||
quiet: (boolean) suppress warning messages if True
|
||||
|
||||
Returns:
|
||||
|
||||
List of Dictionaries. Raw or processed structured data.
|
||||
|
||||
### Parser Information
|
||||
Compatibility: linux
|
||||
|
||||
Version 1.0 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
105
docs/parsers/proc_net_dev_mcast.md
Normal file
105
docs/parsers/proc_net_dev_mcast.md
Normal file
@@ -0,0 +1,105 @@
|
||||
[Home](https://kellyjonbrazil.github.io/jc/)
|
||||
<a id="jc.parsers.proc_net_dev_mcast"></a>
|
||||
|
||||
# jc.parsers.proc\_net\_dev\_mcast
|
||||
|
||||
jc - JSON Convert `/proc/net/dev_mcast` file parser
|
||||
|
||||
Usage (cli):
|
||||
|
||||
$ cat /proc/net/dev_mcast | jc --proc
|
||||
|
||||
or
|
||||
|
||||
$ jc /proc/net/dev_mcast
|
||||
|
||||
or
|
||||
|
||||
$ cat /proc/net/dev_mcast | jc --proc-net-dev-mcast
|
||||
|
||||
Usage (module):
|
||||
|
||||
import jc
|
||||
result = jc.parse('proc', proc_net_dev_mcast_file)
|
||||
|
||||
or
|
||||
|
||||
import jc
|
||||
result = jc.parse('proc_net_dev_mcast', proc_net_dev_mcast_file)
|
||||
|
||||
Schema:
|
||||
|
||||
[
|
||||
{
|
||||
"index": integer,
|
||||
"interface": string,
|
||||
"dmi_u": integer,
|
||||
"dmi_g": integer,
|
||||
"dmi_address": string
|
||||
}
|
||||
]
|
||||
|
||||
Examples:
|
||||
|
||||
$ cat /proc/net/dev_mcast | jc --proc -p
|
||||
[
|
||||
{
|
||||
"index": 2,
|
||||
"interface": "ens33",
|
||||
"dmi_u": 1,
|
||||
"dmi_g": 0,
|
||||
"dmi_address": "333300000001"
|
||||
},
|
||||
{
|
||||
"index": 2,
|
||||
"interface": "ens33",
|
||||
"dmi_u": 1,
|
||||
"dmi_g": 0,
|
||||
"dmi_address": "01005e000001"
|
||||
},
|
||||
...
|
||||
]
|
||||
|
||||
$ cat /proc/net/dev_mcast | jc --proc-net-dev-mcast -p -r
|
||||
[
|
||||
{
|
||||
"index": "2",
|
||||
"interface": "ens33",
|
||||
"dmi_u": "1",
|
||||
"dmi_g": "0",
|
||||
"dmi_address": "333300000001"
|
||||
},
|
||||
{
|
||||
"index": "2",
|
||||
"interface": "ens33",
|
||||
"dmi_u": "1",
|
||||
"dmi_g": "0",
|
||||
"dmi_address": "01005e000001"
|
||||
},
|
||||
...
|
||||
]
|
||||
|
||||
<a id="jc.parsers.proc_net_dev_mcast.parse"></a>
|
||||
|
||||
### parse
|
||||
|
||||
```python
|
||||
def parse(data: str, raw: bool = False, quiet: bool = False) -> List[Dict]
|
||||
```
|
||||
|
||||
Main text parsing function
|
||||
|
||||
Parameters:
|
||||
|
||||
data: (string) text data to parse
|
||||
raw: (boolean) unprocessed output if True
|
||||
quiet: (boolean) suppress warning messages if True
|
||||
|
||||
Returns:
|
||||
|
||||
List of Dictionaries. Raw or processed structured data.
|
||||
|
||||
### Parser Information
|
||||
Compatibility: linux
|
||||
|
||||
Version 1.0 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
88
docs/parsers/proc_net_if_inet6.md
Normal file
88
docs/parsers/proc_net_if_inet6.md
Normal file
@@ -0,0 +1,88 @@
|
||||
[Home](https://kellyjonbrazil.github.io/jc/)
|
||||
<a id="jc.parsers.proc_net_if_inet6"></a>
|
||||
|
||||
# jc.parsers.proc\_net\_if\_inet6
|
||||
|
||||
jc - JSON Convert `/proc/net/if_inet6` file parser
|
||||
|
||||
Usage (cli):
|
||||
|
||||
$ cat /proc/net/if_inet6 | jc --proc
|
||||
|
||||
or
|
||||
|
||||
$ jc /proc/net/if_inet6
|
||||
|
||||
or
|
||||
|
||||
$ cat /proc/net/if_inet6 | jc --proc-net-if-inet6
|
||||
|
||||
Usage (module):
|
||||
|
||||
import jc
|
||||
result = jc.parse('proc', proc_net_if_inet6_file)
|
||||
|
||||
or
|
||||
|
||||
import jc
|
||||
result = jc.parse('proc_net_if_inet6', proc_net_if_inet6_file)
|
||||
|
||||
Schema:
|
||||
|
||||
[
|
||||
{
|
||||
"address": string,
|
||||
"index": string,
|
||||
"prefix": string,
|
||||
"scope": string,
|
||||
"flags": string,
|
||||
"name": string
|
||||
}
|
||||
]
|
||||
|
||||
Examples:
|
||||
|
||||
$ cat /proc/net/if_inet6 | jc --proc -p
|
||||
[
|
||||
{
|
||||
"address": "fe80000000000000020c29fffea4e315",
|
||||
"index": "02",
|
||||
"prefix": "40",
|
||||
"scope": "20",
|
||||
"flags": "80",
|
||||
"name": "ens33"
|
||||
},
|
||||
{
|
||||
"address": "00000000000000000000000000000001",
|
||||
"index": "01",
|
||||
"prefix": "80",
|
||||
"scope": "10",
|
||||
"flags": "80",
|
||||
"name": "lo"
|
||||
}
|
||||
]
|
||||
|
||||
<a id="jc.parsers.proc_net_if_inet6.parse"></a>
|
||||
|
||||
### parse
|
||||
|
||||
```python
|
||||
def parse(data: str, raw: bool = False, quiet: bool = False) -> List[Dict]
|
||||
```
|
||||
|
||||
Main text parsing function
|
||||
|
||||
Parameters:
|
||||
|
||||
data: (string) text data to parse
|
||||
raw: (boolean) unprocessed output if True
|
||||
quiet: (boolean) suppress warning messages if True
|
||||
|
||||
Returns:
|
||||
|
||||
List of Dictionaries. Raw or processed structured data.
|
||||
|
||||
### Parser Information
|
||||
Compatibility: linux
|
||||
|
||||
Version 1.0 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
152
docs/parsers/proc_net_igmp.md
Normal file
152
docs/parsers/proc_net_igmp.md
Normal file
@@ -0,0 +1,152 @@
|
||||
[Home](https://kellyjonbrazil.github.io/jc/)
|
||||
<a id="jc.parsers.proc_net_igmp"></a>
|
||||
|
||||
# jc.parsers.proc\_net\_igmp
|
||||
|
||||
jc - JSON Convert `/proc/net/igmp` file parser
|
||||
|
||||
Usage (cli):
|
||||
|
||||
$ cat /proc/net/igmp | jc --proc
|
||||
|
||||
or
|
||||
|
||||
$ jc /proc/net/igmp
|
||||
|
||||
or
|
||||
|
||||
$ cat /proc/net/igmp | jc --proc-net-igmp
|
||||
|
||||
Usage (module):
|
||||
|
||||
import jc
|
||||
result = jc.parse('proc', proc_net_igmp_file)
|
||||
|
||||
or
|
||||
|
||||
import jc
|
||||
result = jc.parse('proc_net_igmp', proc_net_igmp_file)
|
||||
|
||||
Schema:
|
||||
|
||||
[
|
||||
{
|
||||
"index": integer,
|
||||
"device": string,
|
||||
"count": integer,
|
||||
"querier": string,
|
||||
"groups": [
|
||||
{
|
||||
"address": string,
|
||||
"users": integer,
|
||||
"timer": string,
|
||||
"reporter": integer
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
Examples:
|
||||
|
||||
$ cat /proc/net/igmp | jc --proc -p
|
||||
[
|
||||
{
|
||||
"index": 0,
|
||||
"device": "lo",
|
||||
"count": 0,
|
||||
"querier": "V3",
|
||||
"groups": [
|
||||
{
|
||||
"address": "010000E0",
|
||||
"users": 1,
|
||||
"timer": "0:00000000",
|
||||
"reporter": 0
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"index": 2,
|
||||
"device": "eth0",
|
||||
"count": 26,
|
||||
"querier": "V2",
|
||||
"groups": [
|
||||
{
|
||||
"address": "260301E0",
|
||||
"users": 1,
|
||||
"timer": "0:00000000",
|
||||
"reporter": 1
|
||||
},
|
||||
{
|
||||
"address": "9B0101E0",
|
||||
"users": 1,
|
||||
"timer": "0:00000000",
|
||||
"reporter": 1
|
||||
},
|
||||
]
|
||||
}
|
||||
...
|
||||
]
|
||||
|
||||
$ cat /proc/net/igmp | jc --proc-net-igmp -p -r
|
||||
[
|
||||
{
|
||||
"index": "0",
|
||||
"device": "lo",
|
||||
"count": "0",
|
||||
"querier": "V3",
|
||||
"groups": [
|
||||
{
|
||||
"address": "010000E0",
|
||||
"users": "1",
|
||||
"timer": "0:00000000",
|
||||
"reporter": "0"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"index": "2",
|
||||
"device": "eth0",
|
||||
"count": "26",
|
||||
"querier": "V2",
|
||||
"groups": [
|
||||
{
|
||||
"address": "260301E0",
|
||||
"users": "1",
|
||||
"timer": "0:00000000",
|
||||
"reporter": "1"
|
||||
},
|
||||
{
|
||||
"address": "9B0101E0",
|
||||
"users": "1",
|
||||
"timer": "0:00000000",
|
||||
"reporter": "1"
|
||||
},
|
||||
]
|
||||
}
|
||||
...
|
||||
}
|
||||
|
||||
<a id="jc.parsers.proc_net_igmp.parse"></a>
|
||||
|
||||
### parse
|
||||
|
||||
```python
|
||||
def parse(data: str, raw: bool = False, quiet: bool = False) -> List[Dict]
|
||||
```
|
||||
|
||||
Main text parsing function
|
||||
|
||||
Parameters:
|
||||
|
||||
data: (string) text data to parse
|
||||
raw: (boolean) unprocessed output if True
|
||||
quiet: (boolean) suppress warning messages if True
|
||||
|
||||
Returns:
|
||||
|
||||
List of Dictionaries. Raw or processed structured data.
|
||||
|
||||
### Parser Information
|
||||
Compatibility: linux
|
||||
|
||||
Version 1.0 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
125
docs/parsers/proc_net_igmp6.md
Normal file
125
docs/parsers/proc_net_igmp6.md
Normal file
@@ -0,0 +1,125 @@
|
||||
[Home](https://kellyjonbrazil.github.io/jc/)
|
||||
<a id="jc.parsers.proc_net_igmp6"></a>
|
||||
|
||||
# jc.parsers.proc\_net\_igmp6
|
||||
|
||||
jc - JSON Convert `/proc/net/igmp6` file parser
|
||||
|
||||
Usage (cli):
|
||||
|
||||
$ cat /proc/net/igmp6 | jc --proc
|
||||
|
||||
or
|
||||
|
||||
$ jc /proc/net/igmp6
|
||||
|
||||
or
|
||||
|
||||
$ cat /proc/net/igmp6 | jc --proc-net-igmp6
|
||||
|
||||
Usage (module):
|
||||
|
||||
import jc
|
||||
result = jc.parse('proc', proc_net_igmp6_file)
|
||||
|
||||
or
|
||||
|
||||
import jc
|
||||
result = jc.parse('proc_net_igmp6', proc_net_igmp6_file)
|
||||
|
||||
Schema:
|
||||
|
||||
[
|
||||
{
|
||||
"index": integer,
|
||||
"name": string,
|
||||
"address": string,
|
||||
"users": integer,
|
||||
"group": string,
|
||||
"reporters": integer
|
||||
}
|
||||
]
|
||||
|
||||
Examples:
|
||||
|
||||
$ cat /proc/net/igmp6 | jc --proc -p
|
||||
[
|
||||
{
|
||||
"index": 1,
|
||||
"name": "lo",
|
||||
"address": "ff020000000000000000000000000001",
|
||||
"users": 1,
|
||||
"group": "0000000C",
|
||||
"reporters": 0
|
||||
},
|
||||
{
|
||||
"index": 1,
|
||||
"name": "lo",
|
||||
"address": "ff010000000000000000000000000001",
|
||||
"users": 1,
|
||||
"group": "00000008",
|
||||
"reporters": 0
|
||||
},
|
||||
{
|
||||
"index": 2,
|
||||
"name": "ens33",
|
||||
"address": "ff0200000000000000000001ffa4e315",
|
||||
"users": 1,
|
||||
"group": "00000004",
|
||||
"reporters": 0
|
||||
},
|
||||
...
|
||||
]
|
||||
|
||||
$ cat /proc/net/igmp6 | jc --proc-net-igmp6 -p -r
|
||||
[
|
||||
{
|
||||
"index": "1",
|
||||
"name": "lo",
|
||||
"address": "ff020000000000000000000000000001",
|
||||
"users": "1",
|
||||
"group": "0000000C",
|
||||
"reporters": "0"
|
||||
},
|
||||
{
|
||||
"index": "1",
|
||||
"name": "lo",
|
||||
"address": "ff010000000000000000000000000001",
|
||||
"users": "1",
|
||||
"group": "00000008",
|
||||
"reporters": "0"
|
||||
},
|
||||
{
|
||||
"index": "2",
|
||||
"name": "ens33",
|
||||
"address": "ff0200000000000000000001ffa4e315",
|
||||
"users": "1",
|
||||
"group": "00000004",
|
||||
"reporters": "0"
|
||||
}
|
||||
]
|
||||
|
||||
<a id="jc.parsers.proc_net_igmp6.parse"></a>
|
||||
|
||||
### parse
|
||||
|
||||
```python
|
||||
def parse(data: str, raw: bool = False, quiet: bool = False) -> List[Dict]
|
||||
```
|
||||
|
||||
Main text parsing function
|
||||
|
||||
Parameters:
|
||||
|
||||
data: (string) text data to parse
|
||||
raw: (boolean) unprocessed output if True
|
||||
quiet: (boolean) suppress warning messages if True
|
||||
|
||||
Returns:
|
||||
|
||||
List of Dictionaries. Raw or processed structured data.
|
||||
|
||||
### Parser Information
|
||||
Compatibility: linux
|
||||
|
||||
Version 1.0 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
89
docs/parsers/proc_net_ipv6_route.md
Normal file
89
docs/parsers/proc_net_ipv6_route.md
Normal file
@@ -0,0 +1,89 @@
|
||||
[Home](https://kellyjonbrazil.github.io/jc/)
|
||||
<a id="jc.parsers.proc_net_ipv6_route"></a>
|
||||
|
||||
# jc.parsers.proc\_net\_ipv6\_route
|
||||
|
||||
jc - JSON Convert `/proc/net/ipv6_route` file parser
|
||||
|
||||
Usage (cli):
|
||||
|
||||
$ cat /proc/net/ipv6_route | jc --proc
|
||||
|
||||
or
|
||||
|
||||
$ jc /proc/net/ipv6_route
|
||||
|
||||
or
|
||||
|
||||
$ cat /proc/net/ipv6_route | jc --proc-net-ipv6-route
|
||||
|
||||
Usage (module):
|
||||
|
||||
import jc
|
||||
result = jc.parse('proc', proc_net_ipv6_route_file)
|
||||
|
||||
or
|
||||
|
||||
import jc
|
||||
result = jc.parse('proc_net_ipv6_route', proc_net_ipv6_route_file)
|
||||
|
||||
Schema:
|
||||
|
||||
[
|
||||
{
|
||||
"dest_net": string,
|
||||
"dest_prefix": string,
|
||||
"source_net": string,
|
||||
"source_prefix": string,
|
||||
"next_hop": string,
|
||||
"metric": string,
|
||||
"ref_count": string,
|
||||
"use_count": string,
|
||||
"flags": string,
|
||||
"device": string
|
||||
}
|
||||
]
|
||||
|
||||
Examples:
|
||||
|
||||
$ cat /proc/net/ipv6_route | jc --proc -p
|
||||
[
|
||||
{
|
||||
"dest_net": "00000000000000000000000000000001",
|
||||
"dest_prefix": "80",
|
||||
"source_net": "00000000000000000000000000000000",
|
||||
"source_prefix": "00",
|
||||
"next_hop": "00000000000000000000000000000000",
|
||||
"metric": "00000100",
|
||||
"ref_count": "00000001",
|
||||
"use_count": "00000000",
|
||||
"flags": "00000001",
|
||||
"device": "lo"
|
||||
},
|
||||
...
|
||||
]
|
||||
|
||||
<a id="jc.parsers.proc_net_ipv6_route.parse"></a>
|
||||
|
||||
### parse
|
||||
|
||||
```python
|
||||
def parse(data: str, raw: bool = False, quiet: bool = False) -> List[Dict]
|
||||
```
|
||||
|
||||
Main text parsing function
|
||||
|
||||
Parameters:
|
||||
|
||||
data: (string) text data to parse
|
||||
raw: (boolean) unprocessed output if True
|
||||
quiet: (boolean) suppress warning messages if True
|
||||
|
||||
Returns:
|
||||
|
||||
List of Dictionaries. Raw or processed structured data.
|
||||
|
||||
### Parser Information
|
||||
Compatibility: linux
|
||||
|
||||
Version 1.0 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
130
docs/parsers/proc_net_netlink.md
Normal file
130
docs/parsers/proc_net_netlink.md
Normal file
@@ -0,0 +1,130 @@
|
||||
[Home](https://kellyjonbrazil.github.io/jc/)
|
||||
<a id="jc.parsers.proc_net_netlink"></a>
|
||||
|
||||
# jc.parsers.proc\_net\_netlink
|
||||
|
||||
jc - JSON Convert `/proc/net/netlink` file parser
|
||||
|
||||
Usage (cli):
|
||||
|
||||
$ cat /proc/net/netlink | jc --proc
|
||||
|
||||
or
|
||||
|
||||
$ jc /proc/net/netlink
|
||||
|
||||
or
|
||||
|
||||
$ cat /proc/net/netlink | jc --proc-net-netlink
|
||||
|
||||
Usage (module):
|
||||
|
||||
import jc
|
||||
result = jc.parse('proc', proc_net_netlink_file)
|
||||
|
||||
or
|
||||
|
||||
import jc
|
||||
result = jc.parse('proc_net_netlink', proc_net_netlink_file)
|
||||
|
||||
Schema:
|
||||
|
||||
[
|
||||
{
|
||||
"sk": string,
|
||||
"Eth": integer,
|
||||
"Pid": integer,
|
||||
"Groups": string,
|
||||
"Rmem": integer,
|
||||
"Wmem": integer,
|
||||
"Dump": integer,
|
||||
"Locks": integer,
|
||||
"Drops": integer,
|
||||
"Inode": integer
|
||||
}
|
||||
]
|
||||
|
||||
Examples:
|
||||
|
||||
$ cat /proc/net/netlink | jc --proc -p
|
||||
[
|
||||
{
|
||||
"sk": "ffff9b61adaff000",
|
||||
"Eth": 0,
|
||||
"Pid": 1,
|
||||
"Groups": "800405d5",
|
||||
"Rmem": 0,
|
||||
"Wmem": 0,
|
||||
"Dump": 0,
|
||||
"Locks": 2,
|
||||
"Drops": 0,
|
||||
"Inode": 29791
|
||||
},
|
||||
{
|
||||
"sk": "ffff9b61a792a000",
|
||||
"Eth": 0,
|
||||
"Pid": 837,
|
||||
"Groups": "00000111",
|
||||
"Rmem": 0,
|
||||
"Wmem": 0,
|
||||
"Dump": 0,
|
||||
"Locks": 2,
|
||||
"Drops": 0,
|
||||
"Inode": 35337
|
||||
},
|
||||
...
|
||||
]
|
||||
|
||||
$ cat /proc/net/netlink | jc --proc-net-netlink -p -r
|
||||
[
|
||||
{
|
||||
"sk": "ffff9b61adaff000",
|
||||
"Eth": "0",
|
||||
"Pid": "1",
|
||||
"Groups": "800405d5",
|
||||
"Rmem": "0",
|
||||
"Wmem": "0",
|
||||
"Dump": "0",
|
||||
"Locks": "2",
|
||||
"Drops": "0",
|
||||
"Inode": "29791"
|
||||
},
|
||||
{
|
||||
"sk": "ffff9b61a792a000",
|
||||
"Eth": "0",
|
||||
"Pid": "837",
|
||||
"Groups": "00000111",
|
||||
"Rmem": "0",
|
||||
"Wmem": "0",
|
||||
"Dump": "0",
|
||||
"Locks": "2",
|
||||
"Drops": "0",
|
||||
"Inode": "35337"
|
||||
},
|
||||
...
|
||||
]
|
||||
|
||||
<a id="jc.parsers.proc_net_netlink.parse"></a>
|
||||
|
||||
### parse
|
||||
|
||||
```python
|
||||
def parse(data: str, raw: bool = False, quiet: bool = False) -> List[Dict]
|
||||
```
|
||||
|
||||
Main text parsing function
|
||||
|
||||
Parameters:
|
||||
|
||||
data: (string) text data to parse
|
||||
raw: (boolean) unprocessed output if True
|
||||
quiet: (boolean) suppress warning messages if True
|
||||
|
||||
Returns:
|
||||
|
||||
List of Dictionaries. Raw or processed structured data.
|
||||
|
||||
### Parser Information
|
||||
Compatibility: linux
|
||||
|
||||
Version 1.0 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
324
docs/parsers/proc_net_netstat.md
Normal file
324
docs/parsers/proc_net_netstat.md
Normal file
@@ -0,0 +1,324 @@
|
||||
[Home](https://kellyjonbrazil.github.io/jc/)
|
||||
<a id="jc.parsers.proc_net_netstat"></a>
|
||||
|
||||
# jc.parsers.proc\_net\_netstat
|
||||
|
||||
jc - JSON Convert `/proc/net/netstat` file parser
|
||||
|
||||
Usage (cli):
|
||||
|
||||
$ cat /proc/net/netstat | jc --proc
|
||||
|
||||
or
|
||||
|
||||
$ jc /proc/net/netstat
|
||||
|
||||
or
|
||||
|
||||
$ cat /proc/net/netstat | jc --proc-net-netstat
|
||||
|
||||
Usage (module):
|
||||
|
||||
import jc
|
||||
result = jc.parse('proc', proc_net_netstat_file)
|
||||
|
||||
or
|
||||
|
||||
import jc
|
||||
result = jc.parse('proc_net_netstat', proc_net_netstat_file)
|
||||
|
||||
Schema:
|
||||
|
||||
All values except "type" are integers
|
||||
|
||||
[
|
||||
{
|
||||
"type": string,
|
||||
"<key>": integer
|
||||
}
|
||||
]
|
||||
|
||||
Examples:
|
||||
|
||||
$ cat /proc/net/netstat | jc --proc -p
|
||||
[
|
||||
{
|
||||
"SyncookiesSent": 0,
|
||||
"SyncookiesRecv": 0,
|
||||
"SyncookiesFailed": 0,
|
||||
"EmbryonicRsts": 0,
|
||||
"PruneCalled": 0,
|
||||
"RcvPruned": 0,
|
||||
"OfoPruned": 0,
|
||||
"OutOfWindowIcmps": 0,
|
||||
"LockDroppedIcmps": 0,
|
||||
"ArpFilter": 0,
|
||||
"TW": 3,
|
||||
"TWRecycled": 0,
|
||||
"TWKilled": 0,
|
||||
"PAWSActive": 0,
|
||||
"PAWSEstab": 0,
|
||||
"DelayedACKs": 10,
|
||||
"DelayedACKLocked": 53,
|
||||
"DelayedACKLost": 0,
|
||||
"ListenOverflows": 0,
|
||||
"ListenDrops": 0,
|
||||
"TCPHPHits": 2387,
|
||||
"TCPPureAcks": 12711,
|
||||
"TCPHPAcks": 53535,
|
||||
"TCPRenoRecovery": 0,
|
||||
"TCPSackRecovery": 0,
|
||||
"TCPSACKReneging": 0,
|
||||
"TCPSACKReorder": 0,
|
||||
"TCPRenoReorder": 0,
|
||||
"TCPTSReorder": 0,
|
||||
"TCPFullUndo": 0,
|
||||
"TCPPartialUndo": 0,
|
||||
"TCPDSACKUndo": 0,
|
||||
"TCPLossUndo": 0,
|
||||
"TCPLostRetransmit": 0,
|
||||
"TCPRenoFailures": 0,
|
||||
"TCPSackFailures": 0,
|
||||
"TCPLossFailures": 0,
|
||||
"TCPFastRetrans": 0,
|
||||
"TCPSlowStartRetrans": 0,
|
||||
"TCPTimeouts": 0,
|
||||
"TCPLossProbes": 0,
|
||||
"TCPLossProbeRecovery": 0,
|
||||
"TCPRenoRecoveryFail": 0,
|
||||
"TCPSackRecoveryFail": 0,
|
||||
"TCPRcvCollapsed": 0,
|
||||
"TCPBacklogCoalesce": 2883,
|
||||
"TCPDSACKOldSent": 0,
|
||||
"TCPDSACKOfoSent": 0,
|
||||
"TCPDSACKRecv": 0,
|
||||
"TCPDSACKOfoRecv": 0,
|
||||
"TCPAbortOnData": 0,
|
||||
"TCPAbortOnClose": 1,
|
||||
"TCPAbortOnMemory": 0,
|
||||
"TCPAbortOnTimeout": 0,
|
||||
"TCPAbortOnLinger": 0,
|
||||
"TCPAbortFailed": 0,
|
||||
"TCPMemoryPressures": 0,
|
||||
"TCPMemoryPressuresChrono": 0,
|
||||
"TCPSACKDiscard": 0,
|
||||
"TCPDSACKIgnoredOld": 0,
|
||||
"TCPDSACKIgnoredNoUndo": 0,
|
||||
"TCPSpuriousRTOs": 0,
|
||||
"TCPMD5NotFound": 0,
|
||||
"TCPMD5Unexpected": 0,
|
||||
"TCPMD5Failure": 0,
|
||||
"TCPSackShifted": 0,
|
||||
"TCPSackMerged": 0,
|
||||
"TCPSackShiftFallback": 0,
|
||||
"TCPBacklogDrop": 0,
|
||||
"PFMemallocDrop": 0,
|
||||
"TCPMinTTLDrop": 0,
|
||||
"TCPDeferAcceptDrop": 0,
|
||||
"IPReversePathFilter": 0,
|
||||
"TCPTimeWaitOverflow": 0,
|
||||
"TCPReqQFullDoCookies": 0,
|
||||
"TCPReqQFullDrop": 0,
|
||||
"TCPRetransFail": 0,
|
||||
"TCPRcvCoalesce": 151,
|
||||
"TCPOFOQueue": 0,
|
||||
"TCPOFODrop": 0,
|
||||
"TCPOFOMerge": 0,
|
||||
"TCPChallengeACK": 0,
|
||||
"TCPSYNChallenge": 0,
|
||||
"TCPFastOpenActive": 0,
|
||||
"TCPFastOpenActiveFail": 0,
|
||||
"TCPFastOpenPassive": 0,
|
||||
"TCPFastOpenPassiveFail": 0,
|
||||
"TCPFastOpenListenOverflow": 0,
|
||||
"TCPFastOpenCookieReqd": 0,
|
||||
"TCPFastOpenBlackhole": 0,
|
||||
"TCPSpuriousRtxHostQueues": 0,
|
||||
"BusyPollRxPackets": 0,
|
||||
"TCPAutoCorking": 28376,
|
||||
"TCPFromZeroWindowAdv": 0,
|
||||
"TCPToZeroWindowAdv": 0,
|
||||
"TCPWantZeroWindowAdv": 0,
|
||||
"TCPSynRetrans": 0,
|
||||
"TCPOrigDataSent": 119438,
|
||||
"TCPHystartTrainDetect": 3,
|
||||
"TCPHystartTrainCwnd": 60,
|
||||
"TCPHystartDelayDetect": 0,
|
||||
"TCPHystartDelayCwnd": 0,
|
||||
"TCPACKSkippedSynRecv": 0,
|
||||
"TCPACKSkippedPAWS": 0,
|
||||
"TCPACKSkippedSeq": 0,
|
||||
"TCPACKSkippedFinWait2": 0,
|
||||
"TCPACKSkippedTimeWait": 0,
|
||||
"TCPACKSkippedChallenge": 0,
|
||||
"TCPWinProbe": 0,
|
||||
"TCPKeepAlive": 6,
|
||||
"TCPMTUPFail": 0,
|
||||
"TCPMTUPSuccess": 0,
|
||||
"TCPDelivered": 119453,
|
||||
"TCPDeliveredCE": 0,
|
||||
"TCPAckCompressed": 0,
|
||||
"TCPZeroWindowDrop": 0,
|
||||
"TCPRcvQDrop": 0,
|
||||
"TCPWqueueTooBig": 0,
|
||||
"TCPFastOpenPassiveAltKey": 0,
|
||||
"TcpTimeoutRehash": 0,
|
||||
"TcpDuplicateDataRehash": 0,
|
||||
"type": "TcpExt"
|
||||
},
|
||||
...
|
||||
]
|
||||
|
||||
$ cat /proc/net/netstat | jc --proc-net-netstat -p -r
|
||||
[
|
||||
{
|
||||
"SyncookiesSent": "0",
|
||||
"SyncookiesRecv": "0",
|
||||
"SyncookiesFailed": "0",
|
||||
"EmbryonicRsts": "0",
|
||||
"PruneCalled": "0",
|
||||
"RcvPruned": "0",
|
||||
"OfoPruned": "0",
|
||||
"OutOfWindowIcmps": "0",
|
||||
"LockDroppedIcmps": "0",
|
||||
"ArpFilter": "0",
|
||||
"TW": "3",
|
||||
"TWRecycled": "0",
|
||||
"TWKilled": "0",
|
||||
"PAWSActive": "0",
|
||||
"PAWSEstab": "0",
|
||||
"DelayedACKs": "10",
|
||||
"DelayedACKLocked": "53",
|
||||
"DelayedACKLost": "0",
|
||||
"ListenOverflows": "0",
|
||||
"ListenDrops": "0",
|
||||
"TCPHPHits": "2387",
|
||||
"TCPPureAcks": "12711",
|
||||
"TCPHPAcks": "53535",
|
||||
"TCPRenoRecovery": "0",
|
||||
"TCPSackRecovery": "0",
|
||||
"TCPSACKReneging": "0",
|
||||
"TCPSACKReorder": "0",
|
||||
"TCPRenoReorder": "0",
|
||||
"TCPTSReorder": "0",
|
||||
"TCPFullUndo": "0",
|
||||
"TCPPartialUndo": "0",
|
||||
"TCPDSACKUndo": "0",
|
||||
"TCPLossUndo": "0",
|
||||
"TCPLostRetransmit": "0",
|
||||
"TCPRenoFailures": "0",
|
||||
"TCPSackFailures": "0",
|
||||
"TCPLossFailures": "0",
|
||||
"TCPFastRetrans": "0",
|
||||
"TCPSlowStartRetrans": "0",
|
||||
"TCPTimeouts": "0",
|
||||
"TCPLossProbes": "0",
|
||||
"TCPLossProbeRecovery": "0",
|
||||
"TCPRenoRecoveryFail": "0",
|
||||
"TCPSackRecoveryFail": "0",
|
||||
"TCPRcvCollapsed": "0",
|
||||
"TCPBacklogCoalesce": "2883",
|
||||
"TCPDSACKOldSent": "0",
|
||||
"TCPDSACKOfoSent": "0",
|
||||
"TCPDSACKRecv": "0",
|
||||
"TCPDSACKOfoRecv": "0",
|
||||
"TCPAbortOnData": "0",
|
||||
"TCPAbortOnClose": "1",
|
||||
"TCPAbortOnMemory": "0",
|
||||
"TCPAbortOnTimeout": "0",
|
||||
"TCPAbortOnLinger": "0",
|
||||
"TCPAbortFailed": "0",
|
||||
"TCPMemoryPressures": "0",
|
||||
"TCPMemoryPressuresChrono": "0",
|
||||
"TCPSACKDiscard": "0",
|
||||
"TCPDSACKIgnoredOld": "0",
|
||||
"TCPDSACKIgnoredNoUndo": "0",
|
||||
"TCPSpuriousRTOs": "0",
|
||||
"TCPMD5NotFound": "0",
|
||||
"TCPMD5Unexpected": "0",
|
||||
"TCPMD5Failure": "0",
|
||||
"TCPSackShifted": "0",
|
||||
"TCPSackMerged": "0",
|
||||
"TCPSackShiftFallback": "0",
|
||||
"TCPBacklogDrop": "0",
|
||||
"PFMemallocDrop": "0",
|
||||
"TCPMinTTLDrop": "0",
|
||||
"TCPDeferAcceptDrop": "0",
|
||||
"IPReversePathFilter": "0",
|
||||
"TCPTimeWaitOverflow": "0",
|
||||
"TCPReqQFullDoCookies": "0",
|
||||
"TCPReqQFullDrop": "0",
|
||||
"TCPRetransFail": "0",
|
||||
"TCPRcvCoalesce": "151",
|
||||
"TCPOFOQueue": "0",
|
||||
"TCPOFODrop": "0",
|
||||
"TCPOFOMerge": "0",
|
||||
"TCPChallengeACK": "0",
|
||||
"TCPSYNChallenge": "0",
|
||||
"TCPFastOpenActive": "0",
|
||||
"TCPFastOpenActiveFail": "0",
|
||||
"TCPFastOpenPassive": "0",
|
||||
"TCPFastOpenPassiveFail": "0",
|
||||
"TCPFastOpenListenOverflow": "0",
|
||||
"TCPFastOpenCookieReqd": "0",
|
||||
"TCPFastOpenBlackhole": "0",
|
||||
"TCPSpuriousRtxHostQueues": "0",
|
||||
"BusyPollRxPackets": "0",
|
||||
"TCPAutoCorking": "28376",
|
||||
"TCPFromZeroWindowAdv": "0",
|
||||
"TCPToZeroWindowAdv": "0",
|
||||
"TCPWantZeroWindowAdv": "0",
|
||||
"TCPSynRetrans": "0",
|
||||
"TCPOrigDataSent": "119438",
|
||||
"TCPHystartTrainDetect": "3",
|
||||
"TCPHystartTrainCwnd": "60",
|
||||
"TCPHystartDelayDetect": "0",
|
||||
"TCPHystartDelayCwnd": "0",
|
||||
"TCPACKSkippedSynRecv": "0",
|
||||
"TCPACKSkippedPAWS": "0",
|
||||
"TCPACKSkippedSeq": "0",
|
||||
"TCPACKSkippedFinWait2": "0",
|
||||
"TCPACKSkippedTimeWait": "0",
|
||||
"TCPACKSkippedChallenge": "0",
|
||||
"TCPWinProbe": "0",
|
||||
"TCPKeepAlive": "6",
|
||||
"TCPMTUPFail": "0",
|
||||
"TCPMTUPSuccess": "0",
|
||||
"TCPDelivered": "119453",
|
||||
"TCPDeliveredCE": "0",
|
||||
"TCPAckCompressed": "0",
|
||||
"TCPZeroWindowDrop": "0",
|
||||
"TCPRcvQDrop": "0",
|
||||
"TCPWqueueTooBig": "0",
|
||||
"TCPFastOpenPassiveAltKey": "0",
|
||||
"TcpTimeoutRehash": "0",
|
||||
"TcpDuplicateDataRehash": "0",
|
||||
"type": "TcpExt"
|
||||
},
|
||||
...
|
||||
]
|
||||
|
||||
<a id="jc.parsers.proc_net_netstat.parse"></a>
|
||||
|
||||
### parse
|
||||
|
||||
```python
|
||||
def parse(data: str, raw: bool = False, quiet: bool = False) -> List[Dict]
|
||||
```
|
||||
|
||||
Main text parsing function
|
||||
|
||||
Parameters:
|
||||
|
||||
data: (string) text data to parse
|
||||
raw: (boolean) unprocessed output if True
|
||||
quiet: (boolean) suppress warning messages if True
|
||||
|
||||
Returns:
|
||||
|
||||
List of Dictionaries. Raw or processed structured data.
|
||||
|
||||
### Parser Information
|
||||
Compatibility: linux
|
||||
|
||||
Version 1.0 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
95
docs/parsers/proc_net_packet.md
Normal file
95
docs/parsers/proc_net_packet.md
Normal file
@@ -0,0 +1,95 @@
|
||||
[Home](https://kellyjonbrazil.github.io/jc/)
|
||||
<a id="jc.parsers.proc_net_packet"></a>
|
||||
|
||||
# jc.parsers.proc\_net\_packet
|
||||
|
||||
jc - JSON Convert `/proc/net/packet` file parser
|
||||
|
||||
Usage (cli):
|
||||
|
||||
$ cat /proc/net/packet | jc --proc
|
||||
|
||||
or
|
||||
|
||||
$ jc /proc/net/packet
|
||||
|
||||
or
|
||||
|
||||
$ cat /proc/net/packet | jc --proc-net-packet
|
||||
|
||||
Usage (module):
|
||||
|
||||
import jc
|
||||
result = jc.parse('proc', proc_net_packet_file)
|
||||
|
||||
or
|
||||
|
||||
import jc
|
||||
result = jc.parse('proc_net_packet', proc_net_packet_file)
|
||||
|
||||
Schema:
|
||||
|
||||
{
|
||||
"sk": string,
|
||||
"RefCnt": integer,
|
||||
"Type": integer,
|
||||
"Proto": string,
|
||||
"Iface": integer,
|
||||
"R": integer,
|
||||
"Rmem": integer,
|
||||
"User": integer,
|
||||
"Inode": integer
|
||||
}
|
||||
|
||||
Examples:
|
||||
|
||||
$ cat /proc/net/packet | jc --proc -p
|
||||
{
|
||||
"sk": "ffff9b61b56c1800",
|
||||
"RefCnt": 3,
|
||||
"Type": 3,
|
||||
"Proto": "88cc",
|
||||
"Iface": 2,
|
||||
"R": 1,
|
||||
"Rmem": 0,
|
||||
"User": 101,
|
||||
"Inode": 34754
|
||||
}
|
||||
|
||||
$ cat /proc/net/packet | jc --proc-net-packet -p -r
|
||||
{
|
||||
"sk": "ffff9b61b56c1800",
|
||||
"RefCnt": "3",
|
||||
"Type": "3",
|
||||
"Proto": "88cc",
|
||||
"Iface": "2",
|
||||
"R": "1",
|
||||
"Rmem": "0",
|
||||
"User": "101",
|
||||
"Inode": "34754"
|
||||
}
|
||||
|
||||
<a id="jc.parsers.proc_net_packet.parse"></a>
|
||||
|
||||
### parse
|
||||
|
||||
```python
|
||||
def parse(data: str, raw: bool = False, quiet: bool = False) -> Dict
|
||||
```
|
||||
|
||||
Main text parsing function
|
||||
|
||||
Parameters:
|
||||
|
||||
data: (string) text data to parse
|
||||
raw: (boolean) unprocessed output if True
|
||||
quiet: (boolean) suppress warning messages if True
|
||||
|
||||
Returns:
|
||||
|
||||
Dictionary. Raw or processed structured data.
|
||||
|
||||
### Parser Information
|
||||
Compatibility: linux
|
||||
|
||||
Version 1.0 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
157
docs/parsers/proc_net_protocols.md
Normal file
157
docs/parsers/proc_net_protocols.md
Normal file
@@ -0,0 +1,157 @@
|
||||
[Home](https://kellyjonbrazil.github.io/jc/)
|
||||
<a id="jc.parsers.proc_net_protocols"></a>
|
||||
|
||||
# jc.parsers.proc\_net\_protocols
|
||||
|
||||
jc - JSON Convert `/proc/net/protocols` file parser
|
||||
|
||||
Usage (cli):
|
||||
|
||||
$ cat /proc/net/protocols | jc --proc
|
||||
|
||||
or
|
||||
|
||||
$ jc /proc/net/protocols
|
||||
|
||||
or
|
||||
|
||||
$ cat /proc/net/protocols | jc --proc-net-protocols
|
||||
|
||||
Usage (module):
|
||||
|
||||
import jc
|
||||
result = jc.parse('proc', proc_net_protocols_file)
|
||||
|
||||
or
|
||||
|
||||
import jc
|
||||
result = jc.parse('proc_net_protocols', proc_net_protocols_file)
|
||||
|
||||
Schema:
|
||||
|
||||
[
|
||||
{
|
||||
"protocol": string,
|
||||
"size": integer,
|
||||
"sockets": integer,
|
||||
"memory": integer,
|
||||
"press": string,
|
||||
"maxhdr": integer,
|
||||
"slab": boolean,
|
||||
"module": string,
|
||||
"cl": boolean,
|
||||
"co": boolean,
|
||||
"di": boolean,
|
||||
"ac": boolean,
|
||||
"io": boolean,
|
||||
"in": boolean,
|
||||
"de": boolean,
|
||||
"sh": boolean,
|
||||
"ss": boolean,
|
||||
"gs": boolean,
|
||||
"se": boolean,
|
||||
"re": boolean,
|
||||
"sp": boolean,
|
||||
"bi": boolean,
|
||||
"br": boolean,
|
||||
"ha": boolean,
|
||||
"uh": boolean,
|
||||
"gp": boolean,
|
||||
"em": boolean,
|
||||
}
|
||||
]
|
||||
|
||||
Examples:
|
||||
|
||||
$ cat /proc/net/protocols | jc --proc -p
|
||||
[
|
||||
{
|
||||
"protocol": "AF_VSOCK",
|
||||
"size": 1216,
|
||||
"sockets": 0,
|
||||
"memory": -1,
|
||||
"press": "NI",
|
||||
"maxhdr": 0,
|
||||
"slab": true,
|
||||
"module": "vsock",
|
||||
"cl": false,
|
||||
"co": false,
|
||||
"di": false,
|
||||
"ac": false,
|
||||
"io": false,
|
||||
"in": false,
|
||||
"de": false,
|
||||
"sh": false,
|
||||
"ss": false,
|
||||
"gs": false,
|
||||
"se": false,
|
||||
"re": false,
|
||||
"sp": false,
|
||||
"bi": false,
|
||||
"br": false,
|
||||
"ha": false,
|
||||
"uh": false,
|
||||
"gp": false,
|
||||
"em": false
|
||||
},
|
||||
...
|
||||
]
|
||||
|
||||
$ cat /proc/net/protocols | jc --proc-net-protocols -p -r
|
||||
[
|
||||
{
|
||||
"protocol": "AF_VSOCK",
|
||||
"size": "1216",
|
||||
"sockets": "0",
|
||||
"memory": "-1",
|
||||
"press": "NI",
|
||||
"maxhdr": "0",
|
||||
"slab": "yes",
|
||||
"module": "vsock",
|
||||
"cl": "n",
|
||||
"co": "n",
|
||||
"di": "n",
|
||||
"ac": "n",
|
||||
"io": "n",
|
||||
"in": "n",
|
||||
"de": "n",
|
||||
"sh": "n",
|
||||
"ss": "n",
|
||||
"gs": "n",
|
||||
"se": "n",
|
||||
"re": "n",
|
||||
"sp": "n",
|
||||
"bi": "n",
|
||||
"br": "n",
|
||||
"ha": "n",
|
||||
"uh": "n",
|
||||
"gp": "n",
|
||||
"em": "n"
|
||||
},
|
||||
...
|
||||
]
|
||||
|
||||
<a id="jc.parsers.proc_net_protocols.parse"></a>
|
||||
|
||||
### parse
|
||||
|
||||
```python
|
||||
def parse(data: str, raw: bool = False, quiet: bool = False) -> List[Dict]
|
||||
```
|
||||
|
||||
Main text parsing function
|
||||
|
||||
Parameters:
|
||||
|
||||
data: (string) text data to parse
|
||||
raw: (boolean) unprocessed output if True
|
||||
quiet: (boolean) suppress warning messages if True
|
||||
|
||||
Returns:
|
||||
|
||||
List of Dictionaries. Raw or processed structured data.
|
||||
|
||||
### Parser Information
|
||||
Compatibility: linux
|
||||
|
||||
Version 1.0 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
109
docs/parsers/proc_net_route.md
Normal file
109
docs/parsers/proc_net_route.md
Normal file
@@ -0,0 +1,109 @@
|
||||
[Home](https://kellyjonbrazil.github.io/jc/)
|
||||
<a id="jc.parsers.proc_net_route"></a>
|
||||
|
||||
# jc.parsers.proc\_net\_route
|
||||
|
||||
jc - JSON Convert `/proc/net/route` file parser
|
||||
|
||||
Usage (cli):
|
||||
|
||||
$ cat /proc/net/route | jc --proc
|
||||
|
||||
or
|
||||
|
||||
$ jc /proc/net/route
|
||||
|
||||
or
|
||||
|
||||
$ cat /proc/net/route | jc --proc-net-route
|
||||
|
||||
Usage (module):
|
||||
|
||||
import jc
|
||||
result = jc.parse('proc', proc_net_route_file)
|
||||
|
||||
or
|
||||
|
||||
import jc
|
||||
result = jc.parse('proc_net_route', proc_net_route_file)
|
||||
|
||||
Schema:
|
||||
|
||||
[
|
||||
{
|
||||
"Iface": string,
|
||||
"Destination": string,
|
||||
"Gateway": string,
|
||||
"Flags": string,
|
||||
"RefCnt": integer,
|
||||
"Use": integer,
|
||||
"Metric": integer,
|
||||
"Mask": string,
|
||||
"MTU": integer,
|
||||
"Window": integer,
|
||||
"IRTT": integer
|
||||
}
|
||||
]
|
||||
|
||||
Examples:
|
||||
|
||||
$ cat /proc/net/route | jc --proc -p
|
||||
[
|
||||
{
|
||||
"Iface": "ens33",
|
||||
"Destination": "00000000",
|
||||
"Gateway": "0247A8C0",
|
||||
"Flags": "0003",
|
||||
"RefCnt": 0,
|
||||
"Use": 0,
|
||||
"Metric": 100,
|
||||
"Mask": "00000000",
|
||||
"MTU": 0,
|
||||
"Window": 0,
|
||||
"IRTT": 0
|
||||
},
|
||||
...
|
||||
]
|
||||
|
||||
$ cat /proc/net/route | jc --proc-net-route -p -r
|
||||
[
|
||||
{
|
||||
"Iface": "ens33",
|
||||
"Destination": "00000000",
|
||||
"Gateway": "0247A8C0",
|
||||
"Flags": "0003",
|
||||
"RefCnt": "0",
|
||||
"Use": "0",
|
||||
"Metric": "100",
|
||||
"Mask": "00000000",
|
||||
"MTU": "0",
|
||||
"Window": "0",
|
||||
"IRTT": "0"
|
||||
},
|
||||
...
|
||||
]
|
||||
|
||||
<a id="jc.parsers.proc_net_route.parse"></a>
|
||||
|
||||
### parse
|
||||
|
||||
```python
|
||||
def parse(data: str, raw: bool = False, quiet: bool = False) -> List[Dict]
|
||||
```
|
||||
|
||||
Main text parsing function
|
||||
|
||||
Parameters:
|
||||
|
||||
data: (string) text data to parse
|
||||
raw: (boolean) unprocessed output if True
|
||||
quiet: (boolean) suppress warning messages if True
|
||||
|
||||
Returns:
|
||||
|
||||
List of Dictionaries. Raw or processed structured data.
|
||||
|
||||
### Parser Information
|
||||
Compatibility: linux
|
||||
|
||||
Version 1.0 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
186
docs/parsers/proc_net_tcp.md
Normal file
186
docs/parsers/proc_net_tcp.md
Normal file
@@ -0,0 +1,186 @@
|
||||
[Home](https://kellyjonbrazil.github.io/jc/)
|
||||
<a id="jc.parsers.proc_net_tcp"></a>
|
||||
|
||||
# jc.parsers.proc\_net\_tcp
|
||||
|
||||
jc - JSON Convert `/proc/net/tcp` and `proc/net/tcp6` file parser
|
||||
|
||||
IPv4 and IPv6 addresses are converted to standard notation unless the raw
|
||||
(--raw) option is used.
|
||||
|
||||
Usage (cli):
|
||||
|
||||
$ cat /proc/net/tcp | jc --proc
|
||||
|
||||
or
|
||||
|
||||
$ jc /proc/net/tcp
|
||||
|
||||
or
|
||||
|
||||
$ cat /proc/net/tcp | jc --proc-net-tcp
|
||||
|
||||
Usage (module):
|
||||
|
||||
import jc
|
||||
result = jc.parse('proc', proc_net_tcp_file)
|
||||
|
||||
or
|
||||
|
||||
import jc
|
||||
result = jc.parse('proc_net_tcp', proc_net_tcp_file)
|
||||
|
||||
Schema:
|
||||
|
||||
Field names and types gathered from the following:
|
||||
|
||||
https://www.kernel.org/doc/Documentation/networking/proc_net_tcp.txt
|
||||
|
||||
https://github.com/torvalds/linux/blob/master/net/ipv4/tcp_ipv4.c
|
||||
|
||||
https://github.com/torvalds/linux/blob/master/net/ipv6/tcp_ipv6.c
|
||||
|
||||
[
|
||||
{
|
||||
"entry": integer,
|
||||
"local_address": string,
|
||||
"local_port": integer,
|
||||
"remote_address": string,
|
||||
"remote_port": integer,
|
||||
"state": string,
|
||||
"tx_queue": string,
|
||||
"rx_queue": string,
|
||||
"timer_active": integer,
|
||||
"jiffies_until_timer_expires": string,
|
||||
"unrecovered_rto_timeouts": string,
|
||||
"uid": integer,
|
||||
"unanswered_0_window_probes": integer,
|
||||
"inode": integer,
|
||||
"sock_ref_count": integer,
|
||||
"sock_mem_loc": string,
|
||||
"retransmit_timeout": integer,
|
||||
"soft_clock_tick": integer,
|
||||
"ack_quick_pingpong": integer,
|
||||
"sending_congestion_window": integer,
|
||||
"slow_start_size_threshold": integer
|
||||
}
|
||||
]
|
||||
|
||||
Examples:
|
||||
|
||||
$ cat /proc/net/tcp | jc --proc -p
|
||||
[
|
||||
{
|
||||
"entry": "0",
|
||||
"local_address": "10.0.0.28",
|
||||
"local_port": 42082,
|
||||
"remote_address": "64.12.0.108",
|
||||
"remote_port": 80,
|
||||
"state": "04",
|
||||
"tx_queue": "00000001",
|
||||
"rx_queue": "00000000",
|
||||
"timer_active": 1,
|
||||
"jiffies_until_timer_expires": "00000015",
|
||||
"unrecovered_rto_timeouts": "00000000",
|
||||
"uid": 0,
|
||||
"unanswered_0_window_probes": 0,
|
||||
"inode": 0,
|
||||
"sock_ref_count": 3,
|
||||
"sock_mem_loc": "ffff8c7a0de930c0",
|
||||
"retransmit_timeout": 21,
|
||||
"soft_clock_tick": 4,
|
||||
"ack_quick_pingpong": 30,
|
||||
"sending_congestion_window": 10,
|
||||
"slow_start_size_threshold": -1
|
||||
},
|
||||
{
|
||||
"entry": "1",
|
||||
"local_address": "10.0.0.28",
|
||||
"local_port": 38864,
|
||||
"remote_address": "104.244.42.65",
|
||||
"remote_port": 80,
|
||||
"state": "06",
|
||||
"tx_queue": "00000000",
|
||||
"rx_queue": "00000000",
|
||||
"timer_active": 3,
|
||||
"jiffies_until_timer_expires": "000007C5",
|
||||
"unrecovered_rto_timeouts": "00000000",
|
||||
"uid": 0,
|
||||
"unanswered_0_window_probes": 0,
|
||||
"inode": 0,
|
||||
"sock_ref_count": 3,
|
||||
"sock_mem_loc": "ffff8c7a12d31aa0"
|
||||
},
|
||||
...
|
||||
]
|
||||
|
||||
$ cat /proc/net/tcp | jc --proc -p -r
|
||||
[
|
||||
{
|
||||
"entry": "1",
|
||||
"local_address": "1C00000A",
|
||||
"local_port": "A462",
|
||||
"remote_address": "6C000C40",
|
||||
"remote_port": "0050",
|
||||
"state": "04",
|
||||
"tx_queue": "00000001",
|
||||
"rx_queue": "00000000",
|
||||
"timer_active": "01",
|
||||
"jiffies_until_timer_expires": "00000015",
|
||||
"unrecovered_rto_timeouts": "00000000",
|
||||
"uid": "0",
|
||||
"unanswered_0_window_probes": "0",
|
||||
"inode": "0",
|
||||
"sock_ref_count": "3",
|
||||
"sock_mem_loc": "ffff8c7a0de930c0",
|
||||
"retransmit_timeout": "21",
|
||||
"soft_clock_tick": "4",
|
||||
"ack_quick_pingpong": "30",
|
||||
"sending_congestion_window": "10",
|
||||
"slow_start_size_threshold": "-1"
|
||||
},
|
||||
{
|
||||
"entry": "2",
|
||||
"local_address": "1C00000A",
|
||||
"local_port": "97D0",
|
||||
"remote_address": "412AF468",
|
||||
"remote_port": "0050",
|
||||
"state": "06",
|
||||
"tx_queue": "00000000",
|
||||
"rx_queue": "00000000",
|
||||
"timer_active": "03",
|
||||
"jiffies_until_timer_expires": "000007C5",
|
||||
"unrecovered_rto_timeouts": "00000000",
|
||||
"uid": "0",
|
||||
"unanswered_0_window_probes": "0",
|
||||
"inode": "0",
|
||||
"sock_ref_count": "3",
|
||||
"sock_mem_loc": "ffff8c7a12d31aa0"
|
||||
},
|
||||
...
|
||||
]
|
||||
|
||||
<a id="jc.parsers.proc_net_tcp.parse"></a>
|
||||
|
||||
### parse
|
||||
|
||||
```python
|
||||
def parse(data: str, raw: bool = False, quiet: bool = False) -> List[Dict]
|
||||
```
|
||||
|
||||
Main text parsing function
|
||||
|
||||
Parameters:
|
||||
|
||||
data: (string) text data to parse
|
||||
raw: (boolean) unprocessed output if True
|
||||
quiet: (boolean) suppress warning messages if True
|
||||
|
||||
Returns:
|
||||
|
||||
List of Dictionaries. Raw or processed structured data.
|
||||
|
||||
### Parser Information
|
||||
Compatibility: linux
|
||||
|
||||
Version 1.0 by Alvin Solomon (alvinms01@gmail.com)
|
||||
100
docs/parsers/proc_net_unix.md
Normal file
100
docs/parsers/proc_net_unix.md
Normal file
@@ -0,0 +1,100 @@
|
||||
[Home](https://kellyjonbrazil.github.io/jc/)
|
||||
<a id="jc.parsers.proc_net_unix"></a>
|
||||
|
||||
# jc.parsers.proc\_net\_unix
|
||||
|
||||
jc - JSON Convert `/proc/net/unix` file parser
|
||||
|
||||
Usage (cli):
|
||||
|
||||
$ cat /proc/net/unix | jc --proc
|
||||
|
||||
or
|
||||
|
||||
$ jc /proc/net/unix
|
||||
|
||||
or
|
||||
|
||||
$ cat /proc/net/unix | jc --proc-net-unix
|
||||
|
||||
Usage (module):
|
||||
|
||||
import jc
|
||||
result = jc.parse('proc', proc_net_unix_file)
|
||||
|
||||
or
|
||||
|
||||
import jc
|
||||
result = jc.parse('proc_net_unix', proc_net_unix_file)
|
||||
|
||||
Schema:
|
||||
|
||||
[
|
||||
{
|
||||
"Num": string,
|
||||
"RefCount": string,
|
||||
"Protocol": string,
|
||||
"Flags": string,
|
||||
"Type": string,
|
||||
"St": string,
|
||||
"Inode": integer,
|
||||
"Path": string
|
||||
}
|
||||
]
|
||||
|
||||
Examples:
|
||||
|
||||
$ cat /proc/net/unix | jc --proc -p
|
||||
[
|
||||
{
|
||||
"Num": "ffff9b61ac49c400:",
|
||||
"RefCount": "00000002",
|
||||
"Protocol": "00000000",
|
||||
"Flags": "00010000",
|
||||
"Type": "0001",
|
||||
"St": "01",
|
||||
"Inode": 42776,
|
||||
"Path": "/var/snap/lxd/common/lxd/unix.socket"
|
||||
},
|
||||
...
|
||||
]
|
||||
|
||||
$ cat /proc/net/unix | jc --proc-net-unix -p -r
|
||||
[
|
||||
{
|
||||
"Num": "ffff9b61ac49c400:",
|
||||
"RefCount": "00000002",
|
||||
"Protocol": "00000000",
|
||||
"Flags": "00010000",
|
||||
"Type": "0001",
|
||||
"St": "01",
|
||||
"Inode": "42776",
|
||||
"Path": "/var/snap/lxd/common/lxd/unix.socket"
|
||||
},
|
||||
...
|
||||
]
|
||||
|
||||
<a id="jc.parsers.proc_net_unix.parse"></a>
|
||||
|
||||
### parse
|
||||
|
||||
```python
|
||||
def parse(data: str, raw: bool = False, quiet: bool = False) -> List[Dict]
|
||||
```
|
||||
|
||||
Main text parsing function
|
||||
|
||||
Parameters:
|
||||
|
||||
data: (string) text data to parse
|
||||
raw: (boolean) unprocessed output if True
|
||||
quiet: (boolean) suppress warning messages if True
|
||||
|
||||
Returns:
|
||||
|
||||
List of Dictionaries. Raw or processed structured data.
|
||||
|
||||
### Parser Information
|
||||
Compatibility: linux
|
||||
|
||||
Version 1.0 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
141
docs/parsers/proc_pagetypeinfo.md
Normal file
141
docs/parsers/proc_pagetypeinfo.md
Normal file
@@ -0,0 +1,141 @@
|
||||
[Home](https://kellyjonbrazil.github.io/jc/)
|
||||
<a id="jc.parsers.proc_pagetypeinfo"></a>
|
||||
|
||||
# jc.parsers.proc\_pagetypeinfo
|
||||
|
||||
jc - JSON Convert `/proc/pagetypeinfo` file parser
|
||||
|
||||
Usage (cli):
|
||||
|
||||
$ cat /proc/pagetypeinfo | jc --proc
|
||||
|
||||
or
|
||||
|
||||
$ jc /proc/pagetypeinfo
|
||||
|
||||
or
|
||||
|
||||
$ cat /proc/pagetypeinfo | jc --proc-pagetypeinfo
|
||||
|
||||
Usage (module):
|
||||
|
||||
import jc
|
||||
result = jc.parse('proc', proc_pagetypeinfo_file)
|
||||
|
||||
or
|
||||
|
||||
import jc
|
||||
result = jc.parse('proc_pagetypeinfo', proc_pagetypeinfo_file)
|
||||
|
||||
Schema:
|
||||
|
||||
{
|
||||
"page_block_order": integer,
|
||||
"pages_per_block": integer,
|
||||
"free_pages": [
|
||||
{
|
||||
"node": integer,
|
||||
"zone": string,
|
||||
"type": string,
|
||||
"free": [
|
||||
integer # [0]
|
||||
]
|
||||
],
|
||||
"num_blocks_type": [
|
||||
{
|
||||
"node": integer,
|
||||
"zone": string,
|
||||
"unmovable": integer,
|
||||
"movable": integer,
|
||||
"reclaimable": integer,
|
||||
"high_atomic": integer,
|
||||
"isolate": integer
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
[0] array index correlates to the Order number.
|
||||
E.g. free[0] is the value for Order 0
|
||||
|
||||
Examples:
|
||||
|
||||
$ cat /proc/pagetypeinfo | jc --proc -p
|
||||
{
|
||||
"page_block_order": 9,
|
||||
"pages_per_block": 512,
|
||||
"free_pages": [
|
||||
{
|
||||
"node": 0,
|
||||
"zone": "DMA",
|
||||
"type": "Unmovable",
|
||||
"free": [
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
0,
|
||||
0,
|
||||
0
|
||||
]
|
||||
},
|
||||
...
|
||||
],
|
||||
"num_blocks_type": [
|
||||
{
|
||||
"node": 0,
|
||||
"zone": "DMA",
|
||||
"unmovable": 1,
|
||||
"movable": 7,
|
||||
"reclaimable": 0,
|
||||
"high_atomic": 0,
|
||||
"isolate": 0
|
||||
},
|
||||
{
|
||||
"node": 0,
|
||||
"zone": "DMA32",
|
||||
"unmovable": 8,
|
||||
"movable": 1472,
|
||||
"reclaimable": 48,
|
||||
"high_atomic": 0,
|
||||
"isolate": 0
|
||||
},
|
||||
{
|
||||
"node": 0,
|
||||
"zone": "Normal",
|
||||
"unmovable": 120,
|
||||
"movable": 345,
|
||||
"reclaimable": 47,
|
||||
"high_atomic": 0,
|
||||
"isolate": 0
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
<a id="jc.parsers.proc_pagetypeinfo.parse"></a>
|
||||
|
||||
### parse
|
||||
|
||||
```python
|
||||
def parse(data: str, raw: bool = False, quiet: bool = False) -> Dict
|
||||
```
|
||||
|
||||
Main text parsing function
|
||||
|
||||
Parameters:
|
||||
|
||||
data: (string) text data to parse
|
||||
raw: (boolean) unprocessed output if True
|
||||
quiet: (boolean) suppress warning messages if True
|
||||
|
||||
Returns:
|
||||
|
||||
Dictionary. Raw or processed structured data.
|
||||
|
||||
### Parser Information
|
||||
Compatibility: linux
|
||||
|
||||
Version 1.0 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
100
docs/parsers/proc_partitions.md
Normal file
100
docs/parsers/proc_partitions.md
Normal file
@@ -0,0 +1,100 @@
|
||||
[Home](https://kellyjonbrazil.github.io/jc/)
|
||||
<a id="jc.parsers.proc_partitions"></a>
|
||||
|
||||
# jc.parsers.proc\_partitions
|
||||
|
||||
jc - JSON Convert `/proc/partitions` file parser
|
||||
|
||||
Usage (cli):
|
||||
|
||||
$ cat /proc/partitions | jc --proc
|
||||
|
||||
or
|
||||
|
||||
$ jc /proc/partitions
|
||||
|
||||
or
|
||||
|
||||
$ cat /proc/partitions | jc --proc-partitions
|
||||
|
||||
Usage (module):
|
||||
|
||||
import jc
|
||||
result = jc.parse('proc', proc_partitions_file)
|
||||
|
||||
or
|
||||
|
||||
import jc
|
||||
result = jc.parse('proc_partitions', proc_partitions_file)
|
||||
|
||||
Schema:
|
||||
|
||||
[
|
||||
{
|
||||
"major": integer,
|
||||
"minor": integer,
|
||||
"num_blocks": integer,
|
||||
"name": string
|
||||
}
|
||||
]
|
||||
|
||||
Examples:
|
||||
|
||||
$ cat /proc/partitions | jc --proc -p
|
||||
[
|
||||
{
|
||||
"major": 7,
|
||||
"minor": 0,
|
||||
"num_blocks": 56896,
|
||||
"name": "loop0"
|
||||
},
|
||||
{
|
||||
"major": 7,
|
||||
"minor": 1,
|
||||
"num_blocks": 56868,
|
||||
"name": "loop1"
|
||||
},
|
||||
...
|
||||
]
|
||||
|
||||
$ cat /proc/partitions | jc --proc-partitions -p -r
|
||||
[
|
||||
{
|
||||
"major": "7",
|
||||
"minor": "0",
|
||||
"num_blocks": "56896",
|
||||
"name": "loop0"
|
||||
},
|
||||
{
|
||||
"major": "7",
|
||||
"minor": "1",
|
||||
"num_blocks": "56868",
|
||||
"name": "loop1"
|
||||
},
|
||||
...
|
||||
]
|
||||
|
||||
<a id="jc.parsers.proc_partitions.parse"></a>
|
||||
|
||||
### parse
|
||||
|
||||
```python
|
||||
def parse(data: str, raw: bool = False, quiet: bool = False) -> List[Dict]
|
||||
```
|
||||
|
||||
Main text parsing function
|
||||
|
||||
Parameters:
|
||||
|
||||
data: (string) text data to parse
|
||||
raw: (boolean) unprocessed output if True
|
||||
quiet: (boolean) suppress warning messages if True
|
||||
|
||||
Returns:
|
||||
|
||||
List of Dictionaries. Raw or processed structured data.
|
||||
|
||||
### Parser Information
|
||||
Compatibility: linux
|
||||
|
||||
Version 1.0 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
127
docs/parsers/proc_pid_fdinfo.md
Normal file
127
docs/parsers/proc_pid_fdinfo.md
Normal file
@@ -0,0 +1,127 @@
|
||||
[Home](https://kellyjonbrazil.github.io/jc/)
|
||||
<a id="jc.parsers.proc_pid_fdinfo"></a>
|
||||
|
||||
# jc.parsers.proc\_pid\_fdinfo
|
||||
|
||||
jc - JSON Convert `/proc/<pid>/fdinfo/<fd>` file parser
|
||||
|
||||
Usage (cli):
|
||||
|
||||
$ cat /proc/1/fdinfo/5 | jc --proc
|
||||
|
||||
or
|
||||
|
||||
$ jc /proc/1/fdinfo/5
|
||||
|
||||
or
|
||||
|
||||
$ cat /proc/1/fdinfo/5 | jc --proc-pid-fdinfo
|
||||
|
||||
Usage (module):
|
||||
|
||||
import jc
|
||||
result = jc.parse('proc', proc_pid_fdinfo_file)
|
||||
|
||||
or
|
||||
|
||||
import jc
|
||||
result = jc.parse('proc_pid_fdinfo', proc_pid_fdinfo_file)
|
||||
|
||||
Schema:
|
||||
|
||||
Any unspecified fields are strings.
|
||||
|
||||
{
|
||||
"pos": integer,
|
||||
"flags": integer,
|
||||
"mnt_id": integer,
|
||||
"scm_fds": string,
|
||||
"ino": integer,
|
||||
"lock": string,
|
||||
"epoll": {
|
||||
"tfd": integer,
|
||||
"events": string,
|
||||
"data": string,
|
||||
"pos": integer,
|
||||
"ino": string,
|
||||
"sdev": string
|
||||
},
|
||||
"inotify": {
|
||||
"wd": integer,
|
||||
"ino": string,
|
||||
"sdev": string,
|
||||
"mask": string,
|
||||
"ignored_mask": string,
|
||||
"fhandle-bytes": string,
|
||||
"fhandle-type": string,
|
||||
"f_handle": string
|
||||
},
|
||||
"fanotify": {
|
||||
"flags": string,
|
||||
"event-flags": string,
|
||||
"mnt_id": string,
|
||||
"mflags": string,
|
||||
"mask": string,
|
||||
"ignored_mask": string,
|
||||
"ino": string,
|
||||
"sdev": string,
|
||||
"fhandle-bytes": string,
|
||||
"fhandle-type": string,
|
||||
"f_handle": string
|
||||
},
|
||||
"clockid": integer,
|
||||
"ticks": integer,
|
||||
"settime flags": integer,
|
||||
"it_value": [
|
||||
integer
|
||||
],
|
||||
"it_interval": [
|
||||
integer
|
||||
]
|
||||
}
|
||||
|
||||
Examples:
|
||||
|
||||
$ cat /proc/1/fdinfo/5 | jc --proc -p
|
||||
{
|
||||
"pos": 0,
|
||||
"flags": 2,
|
||||
"mnt_id": 9,
|
||||
"ino": 63107,
|
||||
"clockid": 0,
|
||||
"ticks": 0,
|
||||
"settime flags": 1,
|
||||
"it_value": [
|
||||
0,
|
||||
49406829
|
||||
],
|
||||
"it_interval": [
|
||||
1,
|
||||
0
|
||||
]
|
||||
}
|
||||
|
||||
<a id="jc.parsers.proc_pid_fdinfo.parse"></a>
|
||||
|
||||
### parse
|
||||
|
||||
```python
|
||||
def parse(data: str, raw: bool = False, quiet: bool = False) -> Dict
|
||||
```
|
||||
|
||||
Main text parsing function
|
||||
|
||||
Parameters:
|
||||
|
||||
data: (string) text data to parse
|
||||
raw: (boolean) unprocessed output if True
|
||||
quiet: (boolean) suppress warning messages if True
|
||||
|
||||
Returns:
|
||||
|
||||
Dictionary. Raw or processed structured data.
|
||||
|
||||
### Parser Information
|
||||
Compatibility: linux
|
||||
|
||||
Version 1.0 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
74
docs/parsers/proc_pid_io.md
Normal file
74
docs/parsers/proc_pid_io.md
Normal file
@@ -0,0 +1,74 @@
|
||||
[Home](https://kellyjonbrazil.github.io/jc/)
|
||||
<a id="jc.parsers.proc_pid_io"></a>
|
||||
|
||||
# jc.parsers.proc\_pid\_io
|
||||
|
||||
jc - JSON Convert `/proc/<pid>/io` file parser
|
||||
|
||||
Usage (cli):
|
||||
|
||||
$ cat /proc/1/io | jc --proc
|
||||
|
||||
or
|
||||
|
||||
$ jc /proc/1/io
|
||||
|
||||
or
|
||||
|
||||
$ cat /proc/1/io | jc --proc-pid-io
|
||||
|
||||
Usage (module):
|
||||
|
||||
import jc
|
||||
result = jc.parse('proc', proc_pid_io_file)
|
||||
|
||||
or
|
||||
|
||||
import jc
|
||||
result = jc.parse('proc_pid_io', proc_pid_io_file)
|
||||
|
||||
Schema:
|
||||
|
||||
All values are integers.
|
||||
|
||||
{
|
||||
<keyName> integer
|
||||
}
|
||||
|
||||
Examples:
|
||||
|
||||
$ cat /proc/1/io | jc --proc -p
|
||||
{
|
||||
"rchar": 4699288382,
|
||||
"wchar": 2931802997,
|
||||
"syscr": 661897,
|
||||
"syscw": 890910,
|
||||
"read_bytes": 168468480,
|
||||
"write_bytes": 27357184,
|
||||
"cancelled_write_bytes": 16883712
|
||||
}
|
||||
|
||||
<a id="jc.parsers.proc_pid_io.parse"></a>
|
||||
|
||||
### parse
|
||||
|
||||
```python
|
||||
def parse(data: str, raw: bool = False, quiet: bool = False) -> Dict
|
||||
```
|
||||
|
||||
Main text parsing function
|
||||
|
||||
Parameters:
|
||||
|
||||
data: (string) text data to parse
|
||||
raw: (boolean) unprocessed output if True
|
||||
quiet: (boolean) suppress warning messages if True
|
||||
|
||||
Returns:
|
||||
|
||||
Dictionary. Raw or processed structured data.
|
||||
|
||||
### Parser Information
|
||||
Compatibility: linux
|
||||
|
||||
Version 1.0 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
125
docs/parsers/proc_pid_maps.md
Normal file
125
docs/parsers/proc_pid_maps.md
Normal file
@@ -0,0 +1,125 @@
|
||||
[Home](https://kellyjonbrazil.github.io/jc/)
|
||||
<a id="jc.parsers.proc_pid_maps"></a>
|
||||
|
||||
# jc.parsers.proc\_pid\_maps
|
||||
|
||||
jc - JSON Convert `/proc/<pid>/maps` file parser
|
||||
|
||||
Usage (cli):
|
||||
|
||||
$ cat /proc/1/maps | jc --proc
|
||||
|
||||
or
|
||||
|
||||
$ jc /proc/1/maps
|
||||
|
||||
or
|
||||
|
||||
$ cat /proc/1/maps | jc --proc-pid-maps
|
||||
|
||||
Usage (module):
|
||||
|
||||
import jc
|
||||
result = jc.parse('proc', proc_pid_maps_file)
|
||||
|
||||
or
|
||||
|
||||
import jc
|
||||
result = jc.parse('proc_pid_maps', proc_pid_maps_file)
|
||||
|
||||
Schema:
|
||||
|
||||
[
|
||||
{
|
||||
"start": string,
|
||||
"end": string,
|
||||
"perms": [
|
||||
string
|
||||
],
|
||||
"offset": string,
|
||||
"inode": integer,
|
||||
"pathname": string,
|
||||
"maj": string,
|
||||
"min": string
|
||||
}
|
||||
]
|
||||
|
||||
Examples:
|
||||
|
||||
$ cat /proc/1/maps | jc --proc -p
|
||||
[
|
||||
{
|
||||
"perms": [
|
||||
"read",
|
||||
"private"
|
||||
],
|
||||
"offset": "00000000",
|
||||
"inode": 798126,
|
||||
"pathname": "/usr/lib/systemd/systemd",
|
||||
"start": "55a9e753c000",
|
||||
"end": "55a9e7570000",
|
||||
"maj": "fd",
|
||||
"min": "00"
|
||||
},
|
||||
{
|
||||
"perms": [
|
||||
"read",
|
||||
"execute",
|
||||
"private"
|
||||
],
|
||||
"offset": "00034000",
|
||||
"inode": 798126,
|
||||
"pathname": "/usr/lib/systemd/systemd",
|
||||
"start": "55a9e7570000",
|
||||
"end": "55a9e763a000",
|
||||
"maj": "fd",
|
||||
"min": "00"
|
||||
},
|
||||
...
|
||||
]
|
||||
|
||||
$ cat /proc/1/maps | jc --proc-pid-maps -p -r
|
||||
[
|
||||
{
|
||||
"address": "55a9e753c000-55a9e7570000",
|
||||
"perms": "r--p",
|
||||
"offset": "00000000",
|
||||
"dev": "fd:00",
|
||||
"inode": "798126",
|
||||
"pathname": "/usr/lib/systemd/systemd"
|
||||
},
|
||||
{
|
||||
"address": "55a9e7570000-55a9e763a000",
|
||||
"perms": "r-xp",
|
||||
"offset": "00034000",
|
||||
"dev": "fd:00",
|
||||
"inode": "798126",
|
||||
"pathname": "/usr/lib/systemd/systemd"
|
||||
},
|
||||
...
|
||||
]
|
||||
|
||||
<a id="jc.parsers.proc_pid_maps.parse"></a>
|
||||
|
||||
### parse
|
||||
|
||||
```python
|
||||
def parse(data: str, raw: bool = False, quiet: bool = False) -> List[Dict]
|
||||
```
|
||||
|
||||
Main text parsing function
|
||||
|
||||
Parameters:
|
||||
|
||||
data: (string) text data to parse
|
||||
raw: (boolean) unprocessed output if True
|
||||
quiet: (boolean) suppress warning messages if True
|
||||
|
||||
Returns:
|
||||
|
||||
List of Dictionaries. Raw or processed structured data.
|
||||
|
||||
### Parser Information
|
||||
Compatibility: linux
|
||||
|
||||
Version 1.0 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
170
docs/parsers/proc_pid_mountinfo.md
Normal file
170
docs/parsers/proc_pid_mountinfo.md
Normal file
@@ -0,0 +1,170 @@
|
||||
[Home](https://kellyjonbrazil.github.io/jc/)
|
||||
<a id="jc.parsers.proc_pid_mountinfo"></a>
|
||||
|
||||
# jc.parsers.proc\_pid\_mountinfo
|
||||
|
||||
jc - JSON Convert `/proc/<pid>/mountinfo` file parser
|
||||
|
||||
Usage (cli):
|
||||
|
||||
$ cat /proc/1/mountinfo | jc --proc
|
||||
|
||||
or
|
||||
|
||||
$ jc /proc/1/mountinfo
|
||||
|
||||
or
|
||||
|
||||
$ cat /proc/1/mountinfo | jc --proc-pid-mountinfo
|
||||
|
||||
Usage (module):
|
||||
|
||||
import jc
|
||||
result = jc.parse('proc', proc_pid_mountinfo_file)
|
||||
|
||||
or
|
||||
|
||||
import jc
|
||||
result = jc.parse('proc_pid_mountinfo', proc_pid_mountinfo_file)
|
||||
|
||||
Schema:
|
||||
|
||||
[
|
||||
{
|
||||
"mount_id": integer,
|
||||
"parent_id": integer,
|
||||
"maj": integer,
|
||||
"min": integer,
|
||||
"root": string,
|
||||
"mount_point": string,
|
||||
"mount_options": [
|
||||
string
|
||||
],
|
||||
"optional_fields": { # [0]
|
||||
"<key>": integer # [1]
|
||||
},
|
||||
"fs_type": string,
|
||||
"mount_source": string,
|
||||
"super_options": [
|
||||
integer # [2]
|
||||
],
|
||||
"super_options_fields": {
|
||||
"<key>": string
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
[0] if empty, then private mount
|
||||
[1] unbindable will always have a value of 0
|
||||
[2] integer conversions are attempted. Use --raw or raw=True for
|
||||
original string values.
|
||||
|
||||
Examples:
|
||||
|
||||
$ cat /proc/1/mountinfo | jc --proc -p
|
||||
[
|
||||
{
|
||||
"mount_id": 24,
|
||||
"parent_id": 30,
|
||||
"maj": 0,
|
||||
"min": 22,
|
||||
"root": "/",
|
||||
"mount_point": "/sys",
|
||||
"mount_options": [
|
||||
"rw",
|
||||
"nosuid",
|
||||
"nodev",
|
||||
"noexec",
|
||||
"relatime"
|
||||
],
|
||||
"optional_fields": {
|
||||
"master": 1,
|
||||
"shared": 7
|
||||
},
|
||||
"fs_type": "sysfs",
|
||||
"mount_source": "sysfs",
|
||||
"super_options": [
|
||||
"rw"
|
||||
]
|
||||
},
|
||||
{
|
||||
"mount_id": 25,
|
||||
"parent_id": 30,
|
||||
"maj": 0,
|
||||
"min": 23,
|
||||
"root": "/",
|
||||
"mount_point": "/proc",
|
||||
"mount_options": [
|
||||
"rw",
|
||||
"nosuid",
|
||||
"nodev",
|
||||
"noexec",
|
||||
"relatime"
|
||||
],
|
||||
"optional_fields": {
|
||||
"shared": 14
|
||||
},
|
||||
"fs_type": "proc",
|
||||
"mount_source": "proc",
|
||||
"super_options": [
|
||||
"rw"
|
||||
]
|
||||
},
|
||||
...
|
||||
]
|
||||
|
||||
$ cat /proc/1/mountinfo | jc --proc-pid-mountinfo -p -r
|
||||
[
|
||||
{
|
||||
"mount_id": "24",
|
||||
"parent_id": "30",
|
||||
"maj": "0",
|
||||
"min": "22",
|
||||
"root": "/",
|
||||
"mount_point": "/sys",
|
||||
"mount_options": "rw,nosuid,nodev,noexec,relatime",
|
||||
"optional_fields": "master:1 shared:7 ",
|
||||
"fs_type": "sysfs",
|
||||
"mount_source": "sysfs",
|
||||
"super_options": "rw"
|
||||
},
|
||||
{
|
||||
"mount_id": "25",
|
||||
"parent_id": "30",
|
||||
"maj": "0",
|
||||
"min": "23",
|
||||
"root": "/",
|
||||
"mount_point": "/proc",
|
||||
"mount_options": "rw,nosuid,nodev,noexec,relatime",
|
||||
"optional_fields": "shared:14 ",
|
||||
"fs_type": "proc",
|
||||
"mount_source": "proc",
|
||||
"super_options": "rw"
|
||||
},
|
||||
...
|
||||
]
|
||||
|
||||
<a id="jc.parsers.proc_pid_mountinfo.parse"></a>
|
||||
|
||||
### parse
|
||||
|
||||
```python
|
||||
def parse(data: str, raw: bool = False, quiet: bool = False) -> List[Dict]
|
||||
```
|
||||
|
||||
Main text parsing function
|
||||
|
||||
Parameters:
|
||||
|
||||
data: (string) text data to parse
|
||||
raw: (boolean) unprocessed output if True
|
||||
quiet: (boolean) suppress warning messages if True
|
||||
|
||||
Returns:
|
||||
|
||||
List of Dictionaries. Raw or processed structured data.
|
||||
|
||||
### Parser Information
|
||||
Compatibility: linux
|
||||
|
||||
Version 1.0 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
126
docs/parsers/proc_pid_numa_maps.md
Normal file
126
docs/parsers/proc_pid_numa_maps.md
Normal file
@@ -0,0 +1,126 @@
|
||||
[Home](https://kellyjonbrazil.github.io/jc/)
|
||||
<a id="jc.parsers.proc_pid_numa_maps"></a>
|
||||
|
||||
# jc.parsers.proc\_pid\_numa\_maps
|
||||
|
||||
jc - JSON Convert `/proc/<pid>/numa_maps` file parser
|
||||
|
||||
This parser will attempt to convert number values to integers. If that is
|
||||
not desired, please use the `--raw` option (cli) or `raw=True` argument
|
||||
(module).
|
||||
|
||||
Usage (cli):
|
||||
|
||||
$ cat /proc/1/numa_maps | jc --proc
|
||||
|
||||
or
|
||||
|
||||
$ jc /proc/1/numa_maps
|
||||
|
||||
or
|
||||
|
||||
$ cat /proc/1/numa_maps | jc --proc-pid-numa-maps
|
||||
|
||||
Usage (module):
|
||||
|
||||
import jc
|
||||
result = jc.parse('proc', proc_pid_numa_maps_file)
|
||||
|
||||
or
|
||||
|
||||
import jc
|
||||
result = jc.parse('proc_pid_numa_maps', proc_pid_numa_maps_file)
|
||||
|
||||
Schema:
|
||||
|
||||
Integer conversion for Key/value pairs will be attempted.
|
||||
|
||||
[
|
||||
{
|
||||
"address": string,
|
||||
"policy": string,
|
||||
"<key>": string/integer,
|
||||
"options": [
|
||||
string # [0]
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
[0] remaining individual words that are not part of a key/value pair
|
||||
|
||||
Examples:
|
||||
|
||||
$ cat /proc/1/numa_maps | jc --proc -p
|
||||
[
|
||||
{
|
||||
"address": "7f53b5083000",
|
||||
"policy": "default",
|
||||
"file": "/usr/lib/x86_64-linux-gnu/ld-2.32.so",
|
||||
"anon": 2,
|
||||
"dirty": 2,
|
||||
"N0": 2,
|
||||
"kernelpagesize_kB": 4
|
||||
},
|
||||
{
|
||||
"address": "7ffd1b23e000",
|
||||
"policy": "default",
|
||||
"anon": 258,
|
||||
"dirty": 258,
|
||||
"N0": 258,
|
||||
"kernelpagesize_kB": 4,
|
||||
"options": [
|
||||
"stack"
|
||||
]
|
||||
},
|
||||
...
|
||||
]
|
||||
|
||||
$ cat /proc/1/numa_maps | jc --proc-pid-numa-maps -p -r
|
||||
[
|
||||
{
|
||||
"address": "7f53b5083000",
|
||||
"policy": "default",
|
||||
"file": "/usr/lib/x86_64-linux-gnu/ld-2.32.so",
|
||||
"anon": "2",
|
||||
"dirty": "2",
|
||||
"N0": "2",
|
||||
"kernelpagesize_kB": "4"
|
||||
},
|
||||
{
|
||||
"address": "7ffd1b23e000",
|
||||
"policy": "default",
|
||||
"anon": "258",
|
||||
"dirty": "258",
|
||||
"N0": "258",
|
||||
"kernelpagesize_kB": "4",
|
||||
"options": [
|
||||
"stack"
|
||||
]
|
||||
},
|
||||
...
|
||||
]
|
||||
|
||||
<a id="jc.parsers.proc_pid_numa_maps.parse"></a>
|
||||
|
||||
### parse
|
||||
|
||||
```python
|
||||
def parse(data: str, raw: bool = False, quiet: bool = False) -> List[Dict]
|
||||
```
|
||||
|
||||
Main text parsing function
|
||||
|
||||
Parameters:
|
||||
|
||||
data: (string) text data to parse
|
||||
raw: (boolean) unprocessed output if True
|
||||
quiet: (boolean) suppress warning messages if True
|
||||
|
||||
Returns:
|
||||
|
||||
List of Dictionaries. Raw or processed structured data.
|
||||
|
||||
### Parser Information
|
||||
Compatibility: linux
|
||||
|
||||
Version 1.0 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
192
docs/parsers/proc_pid_smaps.md
Normal file
192
docs/parsers/proc_pid_smaps.md
Normal file
@@ -0,0 +1,192 @@
|
||||
[Home](https://kellyjonbrazil.github.io/jc/)
|
||||
<a id="jc.parsers.proc_pid_smaps"></a>
|
||||
|
||||
# jc.parsers.proc\_pid\_smaps
|
||||
|
||||
jc - JSON Convert `/proc/<pid>/smaps` file parser
|
||||
|
||||
Usage (cli):
|
||||
|
||||
$ cat /proc/1/smaps | jc --proc
|
||||
|
||||
or
|
||||
|
||||
$ jc /proc/1/smaps
|
||||
|
||||
or
|
||||
|
||||
$ cat /proc/1/smaps | jc --proc-pid-smaps
|
||||
|
||||
Usage (module):
|
||||
|
||||
import jc
|
||||
result = jc.parse('proc', proc_pid_smaps_file)
|
||||
|
||||
or
|
||||
|
||||
import jc
|
||||
result = jc.parse('proc_pid_smaps', proc_pid_smaps_file)
|
||||
|
||||
Schema:
|
||||
|
||||
[
|
||||
{
|
||||
"start": string,
|
||||
"end": string,
|
||||
"perms": [
|
||||
string
|
||||
],
|
||||
"offset": string,
|
||||
"maj": string,
|
||||
"min": string,
|
||||
"inode": integer,
|
||||
"pathname": string,
|
||||
"Size": integer,
|
||||
"KernelPageSize": integer,
|
||||
"MMUPageSize": integer,
|
||||
"Rss": integer,
|
||||
"Pss": integer,
|
||||
"Shared_Clean": integer,
|
||||
"Shared_Dirty": integer,
|
||||
"Private_Clean": integer,
|
||||
"Private_Dirty": integer,
|
||||
"Referenced": integer,
|
||||
"Anonymous": integer,
|
||||
"LazyFree": integer,
|
||||
"AnonHugePages": integer,
|
||||
"ShmemPmdMapped": integer,
|
||||
"FilePmdMapped": integer,
|
||||
"Shared_Hugetlb": integer,
|
||||
"Private_Hugetlb": integer,
|
||||
"Swap": integer,
|
||||
"SwapPss": integer,
|
||||
"Locked": integer,
|
||||
"THPeligible": integer,
|
||||
"VmFlags": [
|
||||
string
|
||||
],
|
||||
"VmFlags_pretty": [
|
||||
string
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
Examples:
|
||||
|
||||
$ cat /proc/1/smaps | jc --proc -p
|
||||
[
|
||||
{
|
||||
"start": "55a9e753c000",
|
||||
"end": "55a9e7570000",
|
||||
"perms": [
|
||||
"read",
|
||||
"private"
|
||||
],
|
||||
"offset": "00000000",
|
||||
"maj": "fd",
|
||||
"min": "00",
|
||||
"inode": 798126,
|
||||
"pathname": "/usr/lib/systemd/systemd",
|
||||
"Size": 208,
|
||||
"KernelPageSize": 4,
|
||||
"MMUPageSize": 4,
|
||||
"Rss": 208,
|
||||
"Pss": 104,
|
||||
"Shared_Clean": 208,
|
||||
"Shared_Dirty": 0,
|
||||
"Private_Clean": 0,
|
||||
"Private_Dirty": 0,
|
||||
"Referenced": 208,
|
||||
"Anonymous": 0,
|
||||
"LazyFree": 0,
|
||||
"AnonHugePages": 0,
|
||||
"ShmemPmdMapped": 0,
|
||||
"FilePmdMapped": 0,
|
||||
"Shared_Hugetlb": 0,
|
||||
"Private_Hugetlb": 0,
|
||||
"Swap": 0,
|
||||
"SwapPss": 0,
|
||||
"Locked": 0,
|
||||
"THPeligible": 0,
|
||||
"VmFlags": [
|
||||
"rd",
|
||||
"mr",
|
||||
"mw",
|
||||
"me",
|
||||
"dw",
|
||||
"sd",
|
||||
"mp"
|
||||
],
|
||||
"VmFlags_pretty": [
|
||||
"readable",
|
||||
"may read",
|
||||
"may write",
|
||||
"may execute",
|
||||
"disabled write to the mapped file",
|
||||
"soft-dirty flag"
|
||||
]
|
||||
},
|
||||
...
|
||||
]
|
||||
|
||||
$ cat /proc/1/smaps | jc --proc-pid-smaps -p -r
|
||||
[
|
||||
{
|
||||
"start": "55a9e753c000",
|
||||
"end": "55a9e7570000",
|
||||
"perms": "r--p",
|
||||
"offset": "00000000",
|
||||
"maj": "fd",
|
||||
"min": "00",
|
||||
"inode": "798126",
|
||||
"pathname": "/usr/lib/systemd/systemd",
|
||||
"Size": "208 kB",
|
||||
"KernelPageSize": "4 kB",
|
||||
"MMUPageSize": "4 kB",
|
||||
"Rss": "208 kB",
|
||||
"Pss": "104 kB",
|
||||
"Shared_Clean": "208 kB",
|
||||
"Shared_Dirty": "0 kB",
|
||||
"Private_Clean": "0 kB",
|
||||
"Private_Dirty": "0 kB",
|
||||
"Referenced": "208 kB",
|
||||
"Anonymous": "0 kB",
|
||||
"LazyFree": "0 kB",
|
||||
"AnonHugePages": "0 kB",
|
||||
"ShmemPmdMapped": "0 kB",
|
||||
"FilePmdMapped": "0 kB",
|
||||
"Shared_Hugetlb": "0 kB",
|
||||
"Private_Hugetlb": "0 kB",
|
||||
"Swap": "0 kB",
|
||||
"SwapPss": "0 kB",
|
||||
"Locked": "0 kB",
|
||||
"THPeligible": "0",
|
||||
"VmFlags": "rd mr mw me dw sd"
|
||||
},
|
||||
...
|
||||
]
|
||||
|
||||
<a id="jc.parsers.proc_pid_smaps.parse"></a>
|
||||
|
||||
### parse
|
||||
|
||||
```python
|
||||
def parse(data: str, raw: bool = False, quiet: bool = False) -> List[Dict]
|
||||
```
|
||||
|
||||
Main text parsing function
|
||||
|
||||
Parameters:
|
||||
|
||||
data: (string) text data to parse
|
||||
raw: (boolean) unprocessed output if True
|
||||
quiet: (boolean) suppress warning messages if True
|
||||
|
||||
Returns:
|
||||
|
||||
List of Dictionaries. Raw or processed structured data.
|
||||
|
||||
### Parser Information
|
||||
Compatibility: linux
|
||||
|
||||
Version 1.0 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
226
docs/parsers/proc_pid_stat.md
Normal file
226
docs/parsers/proc_pid_stat.md
Normal file
@@ -0,0 +1,226 @@
|
||||
[Home](https://kellyjonbrazil.github.io/jc/)
|
||||
<a id="jc.parsers.proc_pid_stat"></a>
|
||||
|
||||
# jc.parsers.proc\_pid\_stat
|
||||
|
||||
jc - JSON Convert `/proc/<pid>/stat` file parser
|
||||
|
||||
Usage (cli):
|
||||
|
||||
$ cat /proc/1/stat | jc --proc
|
||||
|
||||
or
|
||||
|
||||
$ jc /proc/1/stat
|
||||
|
||||
or
|
||||
|
||||
$ cat /proc/1/stat | jc --proc-pid-stat
|
||||
|
||||
Usage (module):
|
||||
|
||||
import jc
|
||||
result = jc.parse('proc', proc_pid_stat_file)
|
||||
|
||||
or
|
||||
|
||||
import jc
|
||||
result = jc.parse('proc_pid_stat', proc_pid_stat_file)
|
||||
|
||||
Schema:
|
||||
|
||||
{
|
||||
"pid": integer,
|
||||
"comm": string,
|
||||
"state": string,
|
||||
"state_pretty": string,
|
||||
"ppid": integer,
|
||||
"pgrp": integer,
|
||||
"session": integer,
|
||||
"tty_nr": integer,
|
||||
"tpg_id": integer,
|
||||
"flags": integer,
|
||||
"minflt": integer,
|
||||
"cminflt": integer,
|
||||
"majflt": integer,
|
||||
"cmajflt": integer,
|
||||
"utime": integer,
|
||||
"stime": integer,
|
||||
"cutime": integer,
|
||||
"cstime": integer,
|
||||
"priority": integer,
|
||||
"nice": integer,
|
||||
"num_threads": integer,
|
||||
"itrealvalue": integer,
|
||||
"starttime": integer,
|
||||
"vsize": integer,
|
||||
"rss": integer,
|
||||
"rsslim": integer,
|
||||
"startcode": integer,
|
||||
"endcode": integer,
|
||||
"startstack": integer,
|
||||
"kstkeep": integer,
|
||||
"kstkeip": integer,
|
||||
"signal": integer,
|
||||
"blocked": integer,
|
||||
"sigignore": integer,
|
||||
"sigcatch": integer,
|
||||
"wchan": integer,
|
||||
"nswap": integer,
|
||||
"cnswap": integer,
|
||||
"exit_signal": integer,
|
||||
"processor": integer,
|
||||
"rt_priority": integer,
|
||||
"policy": integer,
|
||||
"delayacct_blkio_ticks": integer,
|
||||
"guest_time": integer,
|
||||
"cguest_time": integer,
|
||||
"start_data": integer,
|
||||
"end_data": integer,
|
||||
"start_brk": integer,
|
||||
"arg_start": integer,
|
||||
"arg_end": integer,
|
||||
"env_start": integer,
|
||||
"env_end": integer,
|
||||
"exit_code": integer,
|
||||
}
|
||||
|
||||
Examples:
|
||||
|
||||
$ cat /proc/1/stat | jc --proc -p
|
||||
{
|
||||
"pid": 1,
|
||||
"comm": "systemd",
|
||||
"state": "S",
|
||||
"ppid": 0,
|
||||
"pgrp": 1,
|
||||
"session": 1,
|
||||
"tty_nr": 0,
|
||||
"tpg_id": -1,
|
||||
"flags": 4194560,
|
||||
"minflt": 23478,
|
||||
"cminflt": 350218,
|
||||
"majflt": 99,
|
||||
"cmajflt": 472,
|
||||
"utime": 107,
|
||||
"stime": 461,
|
||||
"cutime": 2672,
|
||||
"cstime": 4402,
|
||||
"priority": 20,
|
||||
"nice": 0,
|
||||
"num_threads": 1,
|
||||
"itrealvalue": 0,
|
||||
"starttime": 128,
|
||||
"vsize": 174063616,
|
||||
"rss": 3313,
|
||||
"rsslim": 18446744073709551615,
|
||||
"startcode": 94188219072512,
|
||||
"endcode": 94188219899461,
|
||||
"startstack": 140725059845296,
|
||||
"kstkeep": 0,
|
||||
"kstkeip": 0,
|
||||
"signal": 0,
|
||||
"blocked": 671173123,
|
||||
"sigignore": 4096,
|
||||
"sigcatch": 1260,
|
||||
"wchan": 1,
|
||||
"nswap": 0,
|
||||
"cnswap": 0,
|
||||
"exit_signal": 17,
|
||||
"processor": 0,
|
||||
"rt_priority": 0,
|
||||
"policy": 0,
|
||||
"delayacct_blkio_ticks": 18,
|
||||
"guest_time": 0,
|
||||
"cguest_time": 0,
|
||||
"start_data": 94188220274448,
|
||||
"end_data": 94188220555504,
|
||||
"start_brk": 94188243599360,
|
||||
"arg_start": 140725059845923,
|
||||
"arg_end": 140725059845934,
|
||||
"env_start": 140725059845934,
|
||||
"env_end": 140725059846125,
|
||||
"exit_code": 0,
|
||||
"state_pretty": "Sleeping in an interruptible wait"
|
||||
}
|
||||
|
||||
$ cat /proc/1/stat | jc --proc-pid-stat -p -r
|
||||
{
|
||||
"pid": 1,
|
||||
"comm": "systemd",
|
||||
"state": "S",
|
||||
"ppid": 0,
|
||||
"pgrp": 1,
|
||||
"session": 1,
|
||||
"tty_nr": 0,
|
||||
"tpg_id": -1,
|
||||
"flags": 4194560,
|
||||
"minflt": 23478,
|
||||
"cminflt": 350218,
|
||||
"majflt": 99,
|
||||
"cmajflt": 472,
|
||||
"utime": 107,
|
||||
"stime": 461,
|
||||
"cutime": 2672,
|
||||
"cstime": 4402,
|
||||
"priority": 20,
|
||||
"nice": 0,
|
||||
"num_threads": 1,
|
||||
"itrealvalue": 0,
|
||||
"starttime": 128,
|
||||
"vsize": 174063616,
|
||||
"rss": 3313,
|
||||
"rsslim": 18446744073709551615,
|
||||
"startcode": 94188219072512,
|
||||
"endcode": 94188219899461,
|
||||
"startstack": 140725059845296,
|
||||
"kstkeep": 0,
|
||||
"kstkeip": 0,
|
||||
"signal": 0,
|
||||
"blocked": 671173123,
|
||||
"sigignore": 4096,
|
||||
"sigcatch": 1260,
|
||||
"wchan": 1,
|
||||
"nswap": 0,
|
||||
"cnswap": 0,
|
||||
"exit_signal": 17,
|
||||
"processor": 0,
|
||||
"rt_priority": 0,
|
||||
"policy": 0,
|
||||
"delayacct_blkio_ticks": 18,
|
||||
"guest_time": 0,
|
||||
"cguest_time": 0,
|
||||
"start_data": 94188220274448,
|
||||
"end_data": 94188220555504,
|
||||
"start_brk": 94188243599360,
|
||||
"arg_start": 140725059845923,
|
||||
"arg_end": 140725059845934,
|
||||
"env_start": 140725059845934,
|
||||
"env_end": 140725059846125,
|
||||
"exit_code": 0
|
||||
}
|
||||
|
||||
<a id="jc.parsers.proc_pid_stat.parse"></a>
|
||||
|
||||
### parse
|
||||
|
||||
```python
|
||||
def parse(data: str, raw: bool = False, quiet: bool = False) -> Dict
|
||||
```
|
||||
|
||||
Main text parsing function
|
||||
|
||||
Parameters:
|
||||
|
||||
data: (string) text data to parse
|
||||
raw: (boolean) unprocessed output if True
|
||||
quiet: (boolean) suppress warning messages if True
|
||||
|
||||
Returns:
|
||||
|
||||
Dictionary. Raw or processed structured data.
|
||||
|
||||
### Parser Information
|
||||
Compatibility: linux
|
||||
|
||||
Version 1.1 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
78
docs/parsers/proc_pid_statm.md
Normal file
78
docs/parsers/proc_pid_statm.md
Normal file
@@ -0,0 +1,78 @@
|
||||
[Home](https://kellyjonbrazil.github.io/jc/)
|
||||
<a id="jc.parsers.proc_pid_statm"></a>
|
||||
|
||||
# jc.parsers.proc\_pid\_statm
|
||||
|
||||
jc - JSON Convert `/proc/<pid>/statm` file parser
|
||||
|
||||
Usage (cli):
|
||||
|
||||
$ cat /proc/1/statm | jc --proc
|
||||
|
||||
or
|
||||
|
||||
$ jc /proc/1/statm
|
||||
|
||||
or
|
||||
|
||||
$ cat /proc/1/statm | jc --proc-pid-statm
|
||||
|
||||
Usage (module):
|
||||
|
||||
import jc
|
||||
result = jc.parse('proc', proc_pid_statm_file)
|
||||
|
||||
or
|
||||
|
||||
import jc
|
||||
result = jc.parse('proc_pid_statm', proc_pid_statm_file)
|
||||
|
||||
Schema:
|
||||
|
||||
{
|
||||
"size": integer,
|
||||
"resident": integer,
|
||||
"shared": integer,
|
||||
"text": integer,
|
||||
"lib": integer,
|
||||
"data": integer,
|
||||
"dt": integer
|
||||
}
|
||||
|
||||
Examples:
|
||||
|
||||
$ cat /proc/1/statm | jc --proc -p
|
||||
{
|
||||
"size": 42496,
|
||||
"resident": 3313,
|
||||
"shared": 2169,
|
||||
"text": 202,
|
||||
"lib": 0,
|
||||
"data": 5180,
|
||||
"dt": 0
|
||||
}
|
||||
|
||||
<a id="jc.parsers.proc_pid_statm.parse"></a>
|
||||
|
||||
### parse
|
||||
|
||||
```python
|
||||
def parse(data: str, raw: bool = False, quiet: bool = False) -> Dict
|
||||
```
|
||||
|
||||
Main text parsing function
|
||||
|
||||
Parameters:
|
||||
|
||||
data: (string) text data to parse
|
||||
raw: (boolean) unprocessed output if True
|
||||
quiet: (boolean) suppress warning messages if True
|
||||
|
||||
Returns:
|
||||
|
||||
Dictionary. Raw or processed structured data.
|
||||
|
||||
### Parser Information
|
||||
Compatibility: linux
|
||||
|
||||
Version 1.0 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
295
docs/parsers/proc_pid_status.md
Normal file
295
docs/parsers/proc_pid_status.md
Normal file
@@ -0,0 +1,295 @@
|
||||
[Home](https://kellyjonbrazil.github.io/jc/)
|
||||
<a id="jc.parsers.proc_pid_status"></a>
|
||||
|
||||
# jc.parsers.proc\_pid\_status
|
||||
|
||||
jc - JSON Convert `/proc/<pid>/status` file parser
|
||||
|
||||
Usage (cli):
|
||||
|
||||
$ cat /proc/1/status | jc --proc
|
||||
|
||||
or
|
||||
|
||||
$ jc /proc/1/status
|
||||
|
||||
or
|
||||
|
||||
$ cat /proc/1/status | jc --proc-pid-status
|
||||
|
||||
Usage (module):
|
||||
|
||||
import jc
|
||||
result = jc.parse('proc', proc_pid_status_file)
|
||||
|
||||
or
|
||||
|
||||
import jc
|
||||
result = jc.parse('proc_pid_status', proc_pid_status_file)
|
||||
|
||||
Schema:
|
||||
|
||||
{
|
||||
"Name": string,
|
||||
"Umask": string,
|
||||
"State": string,
|
||||
"State_pretty": string,
|
||||
"Tgid": integer,
|
||||
"Ngid": integer,
|
||||
"Pid": integer,
|
||||
"PPid": integer,
|
||||
"TracerPid": integer,
|
||||
"Uid": [
|
||||
integer
|
||||
],
|
||||
"Gid": [
|
||||
integer
|
||||
],
|
||||
"FDSize": integer,
|
||||
"Groups": string,
|
||||
"NStgid": integer,
|
||||
"NSpid": integer,
|
||||
"NSpgid": integer,
|
||||
"NSsid": integer,
|
||||
"VmPeak": integer,
|
||||
"VmSize": integer,
|
||||
"VmLck": integer,
|
||||
"VmPin": integer,
|
||||
"VmHWM": integer,
|
||||
"VmRSS": integer,
|
||||
"RssAnon": integer,
|
||||
"RssFile": integer,
|
||||
"RssShmem": integer,
|
||||
"VmData": integer,
|
||||
"VmStk": integer,
|
||||
"VmExe": integer,
|
||||
"VmLib": integer,
|
||||
"VmPTE": integer,
|
||||
"VmSwap": integer,
|
||||
"HugetlbPages": integer,
|
||||
"CoreDumping": integer,
|
||||
"THP_enabled": integer,
|
||||
"Threads": integer,
|
||||
"SigQ": string,
|
||||
"SigQ_current": integer,
|
||||
"SigQ_limit": integer,
|
||||
"SigPnd": string,
|
||||
"ShdPnd": string,
|
||||
"SigBlk": string,
|
||||
"SigIgn": string,
|
||||
"SigCgt": string,
|
||||
"CapInh": string,
|
||||
"CapPrm": string,
|
||||
"CapEff": string,
|
||||
"CapBnd": string,
|
||||
"CapAmb": string,
|
||||
"NoNewPrivs": integer,
|
||||
"Seccomp": integer,
|
||||
"Speculation_Store_Bypass": string,
|
||||
"Cpus_allowed": [
|
||||
string
|
||||
],
|
||||
"Cpus_allowed_list": string,
|
||||
"Mems_allowed": [
|
||||
string
|
||||
],
|
||||
"Mems_allowed_list": string,
|
||||
"voluntary_ctxt_switches": integer,
|
||||
"nonvoluntary_ctxt_switches": integer
|
||||
}
|
||||
|
||||
Examples:
|
||||
|
||||
$ cat /proc/1/status | jc --proc -p
|
||||
{
|
||||
"Name": "systemd",
|
||||
"Umask": "0000",
|
||||
"State": "S",
|
||||
"Tgid": 1,
|
||||
"Ngid": 0,
|
||||
"Pid": 1,
|
||||
"PPid": 0,
|
||||
"TracerPid": 0,
|
||||
"Uid": [
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"Gid": [
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"FDSize": 128,
|
||||
"Groups": "",
|
||||
"NStgid": 1,
|
||||
"NSpid": 1,
|
||||
"NSpgid": 1,
|
||||
"NSsid": 1,
|
||||
"VmPeak": 235380,
|
||||
"VmSize": 169984,
|
||||
"VmLck": 0,
|
||||
"VmPin": 0,
|
||||
"VmHWM": 13252,
|
||||
"VmRSS": 13252,
|
||||
"RssAnon": 4576,
|
||||
"RssFile": 8676,
|
||||
"RssShmem": 0,
|
||||
"VmData": 19688,
|
||||
"VmStk": 1032,
|
||||
"VmExe": 808,
|
||||
"VmLib": 9772,
|
||||
"VmPTE": 96,
|
||||
"VmSwap": 0,
|
||||
"HugetlbPages": 0,
|
||||
"CoreDumping": 0,
|
||||
"THP_enabled": 1,
|
||||
"Threads": 1,
|
||||
"SigQ": "0/15245",
|
||||
"SigPnd": "0000000000000000",
|
||||
"ShdPnd": "0000000000000000",
|
||||
"SigBlk": "7be3c0fe28014a03",
|
||||
"SigIgn": "0000000000001000",
|
||||
"SigCgt": "00000001800004ec",
|
||||
"CapInh": "0000000000000000",
|
||||
"CapPrm": "000000ffffffffff",
|
||||
"CapEff": "000000ffffffffff",
|
||||
"CapBnd": "000000ffffffffff",
|
||||
"CapAmb": "0000000000000000",
|
||||
"NoNewPrivs": 0,
|
||||
"Seccomp": 0,
|
||||
"Speculation_Store_Bypass": "thread vulnerable",
|
||||
"Cpus_allowed": [
|
||||
"ffffffff",
|
||||
"ffffffff",
|
||||
"ffffffff",
|
||||
"ffffffff"
|
||||
],
|
||||
"Cpus_allowed_list": "0-127",
|
||||
"Mems_allowed": [
|
||||
"00000000",
|
||||
"00000000",
|
||||
"00000000",
|
||||
"00000000",
|
||||
"00000000",
|
||||
"00000000",
|
||||
"00000000",
|
||||
"00000000",
|
||||
"00000000",
|
||||
"00000000",
|
||||
"00000000",
|
||||
"00000000",
|
||||
"00000000",
|
||||
"00000000",
|
||||
"00000000",
|
||||
"00000000",
|
||||
"00000000",
|
||||
"00000000",
|
||||
"00000000",
|
||||
"00000000",
|
||||
"00000000",
|
||||
"00000000",
|
||||
"00000000",
|
||||
"00000000",
|
||||
"00000000",
|
||||
"00000000",
|
||||
"00000000",
|
||||
"00000000",
|
||||
"00000000",
|
||||
"00000000",
|
||||
"00000000",
|
||||
"00000001"
|
||||
],
|
||||
"Mems_allowed_list": "0",
|
||||
"voluntary_ctxt_switches": 1856,
|
||||
"nonvoluntary_ctxt_switches": 6620,
|
||||
"State_pretty": "sleeping",
|
||||
"SigQ_current": 0,
|
||||
"SigQ_limit": 15245
|
||||
}
|
||||
|
||||
$ cat /proc/1/status | jc --proc-pid-status -p -r
|
||||
{
|
||||
"Name": "systemd",
|
||||
"Umask": "0000",
|
||||
"State": "S (sleeping)",
|
||||
"Tgid": "1",
|
||||
"Ngid": "0",
|
||||
"Pid": "1",
|
||||
"PPid": "0",
|
||||
"TracerPid": "0",
|
||||
"Uid": "0\t0\t0\t0",
|
||||
"Gid": "0\t0\t0\t0",
|
||||
"FDSize": "128",
|
||||
"Groups": "",
|
||||
"NStgid": "1",
|
||||
"NSpid": "1",
|
||||
"NSpgid": "1",
|
||||
"NSsid": "1",
|
||||
"VmPeak": "235380 kB",
|
||||
"VmSize": "169984 kB",
|
||||
"VmLck": "0 kB",
|
||||
"VmPin": "0 kB",
|
||||
"VmHWM": "13252 kB",
|
||||
"VmRSS": "13252 kB",
|
||||
"RssAnon": "4576 kB",
|
||||
"RssFile": "8676 kB",
|
||||
"RssShmem": "0 kB",
|
||||
"VmData": "19688 kB",
|
||||
"VmStk": "1032 kB",
|
||||
"VmExe": "808 kB",
|
||||
"VmLib": "9772 kB",
|
||||
"VmPTE": "96 kB",
|
||||
"VmSwap": "0 kB",
|
||||
"HugetlbPages": "0 kB",
|
||||
"CoreDumping": "0",
|
||||
"THP_enabled": "1",
|
||||
"Threads": "1",
|
||||
"SigQ": "0/15245",
|
||||
"SigPnd": "0000000000000000",
|
||||
"ShdPnd": "0000000000000000",
|
||||
"SigBlk": "7be3c0fe28014a03",
|
||||
"SigIgn": "0000000000001000",
|
||||
"SigCgt": "00000001800004ec",
|
||||
"CapInh": "0000000000000000",
|
||||
"CapPrm": "000000ffffffffff",
|
||||
"CapEff": "000000ffffffffff",
|
||||
"CapBnd": "000000ffffffffff",
|
||||
"CapAmb": "0000000000000000",
|
||||
"NoNewPrivs": "0",
|
||||
"Seccomp": "0",
|
||||
"Speculation_Store_Bypass": "thread vulnerable",
|
||||
"Cpus_allowed": "ffffffff,ffffffff,ffffffff,ffffffff",
|
||||
"Cpus_allowed_list": "0-127",
|
||||
"Mems_allowed": "00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000001",
|
||||
"Mems_allowed_list": "0",
|
||||
"voluntary_ctxt_switches": "1856",
|
||||
"nonvoluntary_ctxt_switches": "6620"
|
||||
}
|
||||
|
||||
<a id="jc.parsers.proc_pid_status.parse"></a>
|
||||
|
||||
### parse
|
||||
|
||||
```python
|
||||
def parse(data: str, raw: bool = False, quiet: bool = False) -> Dict
|
||||
```
|
||||
|
||||
Main text parsing function
|
||||
|
||||
Parameters:
|
||||
|
||||
data: (string) text data to parse
|
||||
raw: (boolean) unprocessed output if True
|
||||
quiet: (boolean) suppress warning messages if True
|
||||
|
||||
Returns:
|
||||
|
||||
Dictionary. Raw or processed structured data.
|
||||
|
||||
### Parser Information
|
||||
Compatibility: linux
|
||||
|
||||
Version 1.0 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
100
docs/parsers/proc_slabinfo.md
Normal file
100
docs/parsers/proc_slabinfo.md
Normal file
@@ -0,0 +1,100 @@
|
||||
[Home](https://kellyjonbrazil.github.io/jc/)
|
||||
<a id="jc.parsers.proc_slabinfo"></a>
|
||||
|
||||
# jc.parsers.proc\_slabinfo
|
||||
|
||||
jc - JSON Convert `/proc/slabinfo` file parser
|
||||
|
||||
Usage (cli):
|
||||
|
||||
$ cat /proc/slabinfo | jc --proc
|
||||
|
||||
or
|
||||
|
||||
$ jc /proc/slabinfo
|
||||
|
||||
or
|
||||
|
||||
$ cat /proc/slabinfo | jc --proc-slabinfo
|
||||
|
||||
Usage (module):
|
||||
|
||||
import jc
|
||||
result = jc.parse('proc', proc_slabinfo_file)
|
||||
|
||||
or
|
||||
|
||||
import jc
|
||||
result = jc.parse('proc_slabinfo', proc_slabinfo_file)
|
||||
|
||||
Schema:
|
||||
|
||||
[
|
||||
{
|
||||
"name": string,
|
||||
"active_objs": integer,
|
||||
"num_objs": integer,
|
||||
"obj_size": integer,
|
||||
"obj_per_slab": integer,
|
||||
"pages_per_slab": integer,
|
||||
"tunables": {
|
||||
"limit": integer,
|
||||
"batch_count": integer,
|
||||
"shared_factor": integer
|
||||
},
|
||||
"slabdata": {
|
||||
"active_slabs": integer,
|
||||
"num_slabs": integer,
|
||||
"shared_avail": integer
|
||||
}
|
||||
]
|
||||
|
||||
Examples:
|
||||
|
||||
$ cat /proc/slabinfo | jc --proc -p
|
||||
[
|
||||
{
|
||||
"name": "ext4_groupinfo_4k",
|
||||
"active_objs": 224,
|
||||
"num_objs": 224,
|
||||
"obj_size": 144,
|
||||
"obj_per_slab": 56,
|
||||
"pages_per_slab": 2,
|
||||
"tunables": {
|
||||
"limit": 0,
|
||||
"batch_count": 0,
|
||||
"shared_factor": 0
|
||||
},
|
||||
"slabdata": {
|
||||
"active_slabs": 4,
|
||||
"num_slabs": 4,
|
||||
"shared_avail": 0
|
||||
}
|
||||
},
|
||||
...
|
||||
]
|
||||
|
||||
<a id="jc.parsers.proc_slabinfo.parse"></a>
|
||||
|
||||
### parse
|
||||
|
||||
```python
|
||||
def parse(data: str, raw: bool = False, quiet: bool = False) -> List[Dict]
|
||||
```
|
||||
|
||||
Main text parsing function
|
||||
|
||||
Parameters:
|
||||
|
||||
data: (string) text data to parse
|
||||
raw: (boolean) unprocessed output if True
|
||||
quiet: (boolean) suppress warning messages if True
|
||||
|
||||
Returns:
|
||||
|
||||
List of Dictionaries. Raw or processed structured data.
|
||||
|
||||
### Parser Information
|
||||
Compatibility: linux
|
||||
|
||||
Version 1.0 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
85
docs/parsers/proc_softirqs.md
Normal file
85
docs/parsers/proc_softirqs.md
Normal file
@@ -0,0 +1,85 @@
|
||||
[Home](https://kellyjonbrazil.github.io/jc/)
|
||||
<a id="jc.parsers.proc_softirqs"></a>
|
||||
|
||||
# jc.parsers.proc\_softirqs
|
||||
|
||||
jc - JSON Convert `/proc/softirqs` file parser
|
||||
|
||||
Usage (cli):
|
||||
|
||||
$ cat /proc/softirqs | jc --proc
|
||||
|
||||
or
|
||||
|
||||
$ jc /proc/softirqs
|
||||
|
||||
or
|
||||
|
||||
$ cat /proc/softirqs | jc --proc-softirqs
|
||||
|
||||
Usage (module):
|
||||
|
||||
import jc
|
||||
result = jc.parse('proc', proc_softirqs_file)
|
||||
|
||||
or
|
||||
|
||||
import jc
|
||||
result = jc.parse('proc_softirqs', proc_softirqs_file)
|
||||
|
||||
Schema:
|
||||
|
||||
[
|
||||
{
|
||||
"counter": string,
|
||||
"CPU<number>": integer,
|
||||
}
|
||||
]
|
||||
|
||||
Examples:
|
||||
|
||||
$ cat /proc/softirqs | jc --proc -p
|
||||
[
|
||||
{
|
||||
"counter": "HI",
|
||||
"CPU0": 1,
|
||||
"CPU1": 34056,
|
||||
"CPU2": 0,
|
||||
"CPU3": 0,
|
||||
"CPU4": 0
|
||||
},
|
||||
{
|
||||
"counter": "TIMER",
|
||||
"CPU0": 322970,
|
||||
"CPU1": 888166,
|
||||
"CPU2": 0,
|
||||
"CPU3": 0,
|
||||
"CPU4": 0
|
||||
},
|
||||
...
|
||||
]
|
||||
|
||||
<a id="jc.parsers.proc_softirqs.parse"></a>
|
||||
|
||||
### parse
|
||||
|
||||
```python
|
||||
def parse(data: str, raw: bool = False, quiet: bool = False) -> List[Dict]
|
||||
```
|
||||
|
||||
Main text parsing function
|
||||
|
||||
Parameters:
|
||||
|
||||
data: (string) text data to parse
|
||||
raw: (boolean) unprocessed output if True
|
||||
quiet: (boolean) suppress warning messages if True
|
||||
|
||||
Returns:
|
||||
|
||||
List of Dictionaries. Raw or processed structured data.
|
||||
|
||||
### Parser Information
|
||||
Compatibility: linux
|
||||
|
||||
Version 1.0 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user