{"id":15140213,"url":"https://github.com/emmeowzing/jc","last_synced_at":"2025-09-29T08:31:56.289Z","repository":{"id":111656886,"uuid":"561386343","full_name":"emmeowzing/jc","owner":"emmeowzing","description":"CLI tool and python library that converts the output of popular command-line tools, file-types, and common strings to JSON, YAML, or Dictionaries. This allows piping of output to tools like jq and simplifying automation scripts.","archived":false,"fork":true,"pushed_at":"2023-06-02T17:48:27.000Z","size":11409,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2024-09-27T08:02:24.381Z","etag":null,"topics":["github","probot"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"kellyjonbrazil/jc","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/emmeowzing.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2022-11-03T15:22:17.000Z","updated_at":"2022-11-03T15:23:10.000Z","dependencies_parsed_at":"2023-08-11T10:32:29.023Z","dependency_job_id":null,"html_url":"https://github.com/emmeowzing/jc","commit_stats":null,"previous_names":["emmeowzing/jc"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emmeowzing%2Fjc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emmeowzing%2Fjc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emmeowzing%2Fjc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emmeowzing%2Fjc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/emmeowzing","download_url":"https://codeload.github.com/emmeowzing/jc/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234604488,"owners_count":18859164,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["github","probot"],"created_at":"2024-09-26T08:01:37.609Z","updated_at":"2025-09-29T08:31:53.748Z","avatar_url":"https://github.com/emmeowzing.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Tests](https://github.com/kellyjonbrazil/jc/workflows/Tests/badge.svg?branch=master)](https://github.com/kellyjonbrazil/jc/actions)\n[![Pypi](https://img.shields.io/pypi/v/jc.svg)](https://pypi.org/project/jc/)\n\n\u003e Check out the `jc` Python [package documentation](https://github.com/kellyjonbrazil/jc/tree/master/docs) for developers\n\n\u003e Try the `jc` [web demo](https://jc-web.onrender.com/)\n\n\u003e JC is [now available](https://galaxy.ansible.com/community/general) as an\nAnsible filter plugin in the `community.general` collection. See this\n[blog post](https://blog.kellybrazil.com/2020/08/30/parsing-command-output-in-ansible-with-jc/)\nfor an example.\n\n# JC\nJSON Convert\n\n`jc` JSONifies the output of many CLI tools, file-types, and common strings\nfor easier parsing in scripts. See the [**Parsers**](#parsers) section for\nsupported commands, file-types, and strings.\n```bash\ndig example.com | jc --dig\n```\n```json\n[{\"id\":38052,\"opcode\":\"QUERY\",\"status\":\"NOERROR\",\"flags\":[\"qr\",\"rd\",\"ra\"],\n\"query_num\":1,\"answer_num\":1,\"authority_num\":0,\"additional_num\":1,\n\"opt_pseudosection\":{\"edns\":{\"version\":0,\"flags\":[],\"udp\":4096}},\"question\":\n{\"name\":\"example.com.\",\"class\":\"IN\",\"type\":\"A\"},\"answer\":[{\"name\":\n\"example.com.\",\"class\":\"IN\",\"type\":\"A\",\"ttl\":39049,\"data\":\"93.184.216.34\"}],\n\"query_time\":49,\"server\":\"2600:1700:bab0:d40::1#53(2600:1700:bab0:d40::1)\",\n\"when\":\"Fri Apr 16 16:09:00 PDT 2021\",\"rcvd\":56,\"when_epoch\":1618614540,\n\"when_epoch_utc\":null}]\n```\n\nThis allows further command-line processing of output with tools like `jq`\nor [`jello`](https://github.com/kellyjonbrazil/jello) by piping commands:\n```bash\n$ dig example.com | jc --dig | jq -r '.[].answer[].data'\n93.184.216.34\n```\n\nor using the alternative \"magic\" syntax:\n\n```bash\n$ jc dig example.com | jq -r '.[].answer[].data'\n93.184.216.34\n```\n\n`jc` can also be used as a python library. In this case the output will be\na python dictionary, a list of dictionaries, or even a\n[lazy iterable of dictionaries](#using-streaming-parsers-as-python-modules)\ninstead of JSON:\n```python\n\u003e\u003e\u003e import subprocess\n\u003e\u003e\u003e import jc\n\u003e\u003e\u003e\n\u003e\u003e\u003e cmd_output = subprocess.check_output(['dig', 'example.com'], text=True)\n\u003e\u003e\u003e data = jc.parse('dig', cmd_output)\n\u003e\u003e\u003e\n\u003e\u003e\u003e data[0]['answer']\n[{'name': 'example.com.', 'class': 'IN', 'type': 'A', 'ttl': 29658, 'data':\n'93.184.216.34'}]\n```\n\n\u003e For `jc` Python package documentation, use `help('jc')`, `help('jc.lib')`, or\nsee the [online documentation](https://github.com/kellyjonbrazil/jc/tree/master/docs).\n\nTwo representations of the data are available. The default representation uses a\nstrict schema per parser and converts known numbers to int/float JSON values.\nCertain known values of `None` are converted to JSON `null`, known boolean\nvalues are converted, and, in some cases, additional semantic context fields are\nadded.\n\nTo access the raw, pre-processed JSON, use the `-r` cli option or the `raw=True`\nfunction parameter in `parse()` when using `jc` as a python library.\n\nSchemas for each parser can be found at the documentation link beside each\n[**Parser**](#parsers) below.\n\nRelease notes can be found [here](https://blog.kellybrazil.com/category/jc-news/).\n\n## Why Would Anyone Do This!?\nFor more information on the motivations for this project, please see my blog\npost on [Bringing the Unix Philosophy to the 21st Century](https://blog.kellybrazil.com/2019/11/26/bringing-the-unix-philosophy-to-the-21st-century/) and my [interview with Console](https://console.substack.com/p/console-89).\n\nSee also:\n- [libxo on FreeBSD](http://juniper.github.io/libxo/libxo-manual.html)\n- [powershell](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/convertto-json?view=powershell-7)\n- [blog: linux apps should have a json flag](https://thomashunter.name/posts/2012-06-06-linux-cli-apps-should-have-a-json-flag)\n- [Hacker News discussion](https://news.ycombinator.com/item?id=28266193)\n- [Reddit discussion](https://www.reddit.com/r/programming/comments/pa4cbb/bringing_the_unix_philosophy_to_the_21st_century/)\n\nUse Cases:\n- [Bash scripting](https://blog.kellybrazil.com/2021/04/12/practical-json-at-the-command-line/)\n- [Ansible command output parsing](https://blog.kellybrazil.com/2020/08/30/parsing-command-output-in-ansible-with-jc/)\n- [Saltstack command output parsing](https://blog.kellybrazil.com/2020/09/15/parsing-command-output-in-saltstack-with-jc/)\n- [Nornir command output parsing](https://blog.kellybrazil.com/2020/12/09/parsing-command-output-in-nornir-with-jc/)\n- [FortiSOAR command output parsing](https://docs.fortinet.com/document/fortisoar/1.0.0/jc-parse-command-output/323/jc-parse-command-output-v1-0-0)\n\n## Installation\nThere are several ways to get `jc`. You can install via `pip`, OS package\n[repositories](https://repology.org/project/jc/versions), or by downloading the\ncorrect [binary](https://github.com/kellyjonbrazil/jc/releases) for your\narchitecture and running it anywhere on your filesystem.\n\n### Pip (macOS, linux, unix, Windows)\n[![Pypi](https://img.shields.io/pypi/v/jc.svg)](https://pypi.org/project/jc/)\n```bash\npip3 install jc\n```\n\n### OS Package Repositories\n\n| OS                                   | Command                                                                       |\n|--------------------------------------|-------------------------------------------------------------------------------|\n| Debian/Ubuntu linux                  | `apt-get install jc`                                                          |\n| Fedora linux                         | `dnf install jc`                                                              |\n| openSUSE linux                       | `zypper install jc`                                                           |\n| Archlinux Community Repository       | `paru -S jc` or `aura -S jc` or `yay -S jc`                                   |\n| NixOS linux                          | `nix-env -iA nixpkgs.jc` or `nix-env -iA nixos.jc`                            |\n| Guix System linux                    | `guix install jc`                                                             |\n| Gentoo Linux                         | `emerge dev-python/jc`                                                        |\n| macOS                                | `brew install jc`                                                             |\n| FreeBSD                              | `portsnap fetch update \u0026\u0026 cd /usr/ports/textproc/py-jc \u0026\u0026 make install clean` |\n| Ansible filter plugin                | `ansible-galaxy collection install community.general`                         |\n| FortiSOAR connector                  | Install from FortiSOAR Connector Marketplace                                  |\n\n\u003e For more OS Packages, see https://repology.org/project/jc/versions.\n\n### Binaries\nFor precompiled binaries, see [Releases](https://github.com/kellyjonbrazil/jc/releases)\non Github.\n\n## Usage\n`jc` accepts piped input from `STDIN` and outputs a JSON representation of the\nprevious command's output to `STDOUT`.\n```bash\nCOMMAND | jc [OPTIONS] PARSER\ncat FILE | jc [OPTIONS] PARSER\necho STRING | jc [OPTIONS] PARSER\n```\n\nAlternatively, the \"magic\" syntax can be used by prepending `jc` to the command\nto be converted or in front of the absolute path for Proc files. Options can be\npassed to `jc` immediately before the command or Proc file path is given.\n(Note: command aliases and shell builtins are not supported)\n```bash\njc [OPTIONS] COMMAND\njc [OPTIONS] /proc/\u003cpath-to-procfile\u003e\n```\n\nThe JSON output can be compact (default) or pretty formatted with the `-p`\noption.\n\n### Parsers\n\n| Argument          | Command or Filetype                                     | Documentation                                                              |\n|-------------------|---------------------------------------------------------|----------------------------------------------------------------------------|\n| `         --acpi` | `acpi` command parser                                   | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/acpi)           |\n| `      --airport` | `airport -I` command parser                             | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/airport)        |\n| `    --airport-s` | `airport -s` command parser                             | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/airport_s)      |\n| `          --arp` | `arp` command parser                                    | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/arp)            |\n| `   --asciitable` | ASCII and Unicode table parser                          | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/asciitable)     |\n| ` --asciitable-m` | multi-line ASCII and Unicode table parser               | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/asciitable_m)   |\n| `        --blkid` | `blkid` command parser                                  | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/blkid)          |\n| `          --cef` | CEF string parser                                       | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/cef)            |\n| `        --cef-s` | CEF string streaming parser                             | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/cef_s)          |\n| `        --chage` | `chage --list` command parser                           | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/chage)          |\n| `        --cksum` | `cksum` and `sum` command parser                        | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/cksum)          |\n| `      --crontab` | `crontab` command and file parser                       | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/crontab)        |\n| `    --crontab-u` | `crontab` file parser with user support                 | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/crontab_u)      |\n| `          --csv` | CSV file parser                                         | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/csv)            |\n| `        --csv-s` | CSV file streaming parser                               | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/csv_s)          |\n| `         --date` | `date` command parser                                   | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/date)           |\n| ` --datetime-iso` | ISO 8601 Datetime string parser                         | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/datetime_iso)   |\n| `           --df` | `df` command parser                                     | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/df)             |\n| `          --dig` | `dig` command parser                                    | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/dig)            |\n| `          --dir` | `dir` command parser                                    | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/dir)            |\n| `    --dmidecode` | `dmidecode` command parser                              | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/dmidecode)      |\n| `       --dpkg-l` | `dpkg -l` command parser                                | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/dpkg_l)         |\n| `           --du` | `du` command parser                                     | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/du)             |\n| `--email-address` | Email Address string parser                             | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/email_address)  |\n| `          --env` | `env` command parser                                    | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/env)            |\n| `         --file` | `file` command parser                                   | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/file)           |\n| `       --finger` | `finger` command parser                                 | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/finger)         |\n| `         --free` | `free` command parser                                   | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/free)           |\n| `        --fstab` | `/etc/fstab` file parser                                | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/fstab)          |\n| `      --git-log` | `git log` command parser                                | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/git_log)        |\n| `    --git-log-s` | `git log` command streaming parser                      | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/git_log_s)      |\n| `          --gpg` | `gpg --with-colons` command parser                      | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/gpg)            |\n| `        --group` | `/etc/group` file parser                                | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/group)          |\n| `      --gshadow` | `/etc/gshadow` file parser                              | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/gshadow)        |\n| `         --hash` | `hash` command parser                                   | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/hash)           |\n| `      --hashsum` | hashsum command parser (`md5sum`, `shasum`, etc.)       | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/hashsum)        |\n| `    --hciconfig` | `hciconfig` command parser                              | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/hciconfig)      |\n| `      --history` | `history` command parser                                | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/history)        |\n| `        --hosts` | `/etc/hosts` file parser                                | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/hosts)          |\n| `           --id` | `id` command parser                                     | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/id)             |\n| `     --ifconfig` | `ifconfig` command parser                               | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/ifconfig)       |\n| `          --ini` | INI file parser                                         | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/ini)            |\n| `       --iostat` | `iostat` command parser                                 | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/iostat)         |\n| `     --iostat-s` | `iostat` command streaming parser                       | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/iostat_s)       |\n| `   --ip-address` | IPv4 and IPv6 Address string parser                     | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/ip_address)     |\n| `     --iptables` | `iptables` command parser                               | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/iptables)       |\n| `      --iw-scan` | `iw dev [device] scan` command parser                   | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/iw_scan)        |\n| ` --jar-manifest` | Java MANIFEST.MF file parser                            | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/jar_manifest)   |\n| `         --jobs` | `jobs` command parser                                   | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/jobs)           |\n| `          --jwt` | JWT string parser                                       | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/jwt)            |\n| `           --kv` | Key/Value file parser                                   | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/kv)             |\n| `         --last` | `last` and `lastb` command parser                       | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/last)           |\n| `           --ls` | `ls` command parser                                     | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/ls)             |\n| `         --ls-s` | `ls` command streaming parser                           | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/ls_s)           |\n| `        --lsblk` | `lsblk` command parser                                  | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/lsblk)          |\n| `        --lsmod` | `lsmod` command parser                                  | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/lsmod)          |\n| `         --lsof` | `lsof` command parser                                   | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/lsof)           |\n| `        --lspci` | `lspci -mmv` command parser                             | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/lspci)          |\n| `        --lsusb` | `lsusb` command parser                                  | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/lsusb)          |\n| `          --m3u` | M3U and M3U8 file parser                                | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/m3u)            |\n| `        --mdadm` | `mdadm` command parser                                  | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/mdadm)          |\n| `        --mount` | `mount` command parser                                  | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/mount)          |\n| `       --mpstat` | `mpstat` command parser                                 | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/mpstat)         |\n| `     --mpstat-s` | `mpstat` command streaming parser                       | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/mpstat_s)       |\n| `      --netstat` | `netstat` command parser                                | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/netstat)        |\n| `        --nmcli` | `nmcli` command parser                                  | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/nmcli)          |\n| `         --ntpq` | `ntpq -p` command parser                                | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/ntpq)           |\n| `       --passwd` | `/etc/passwd` file parser                               | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/passwd)         |\n| `      --pci-ids` | `pci.ids` file parser                                   | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/pci_ids)        |\n| `      --pidstat` | `pidstat -H` command parser                             | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/pidstat)        |\n| `    --pidstat-s` | `pidstat -H` command streaming parser                   | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/pidstat_s)      |\n| `         --ping` | `ping` and `ping6` command parser                       | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/ping)           |\n| `       --ping-s` | `ping` and `ping6` command streaming parser             | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/ping_s)         |\n| `     --pip-list` | `pip list` command parser                               | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/pip_list)       |\n| `     --pip-show` | `pip show` command parser                               | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/pip_show)       |\n| `        --plist` | PLIST file parser                                       | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/plist)          |\n| `     --postconf` | `postconf -M` command parser                            | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/postconf)       |\n| `         --proc` | `/proc/` file parser                                    | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/proc)           |\n| `           --ps` | `ps` command parser                                     | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/ps)             |\n| `        --route` | `route` command parser                                  | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/route)          |\n| `       --rpm-qi` | `rpm -qi` command parser                                | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/rpm_qi)         |\n| `        --rsync` | `rsync` command parser                                  | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/rsync)          |\n| `      --rsync-s` | `rsync` command streaming parser                        | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/rsync_s)        |\n| `       --sfdisk` | `sfdisk` command parser                                 | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/sfdisk)         |\n| `       --shadow` | `/etc/shadow` file parser                               | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/shadow)         |\n| `           --ss` | `ss` command parser                                     | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/ss)             |\n| `         --stat` | `stat` command parser                                   | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/stat)           |\n| `       --stat-s` | `stat` command streaming parser                         | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/stat_s)         |\n| `       --sysctl` | `sysctl` command parser                                 | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/sysctl)         |\n| `       --syslog` | Syslog RFC 5424 string parser                           | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/syslog)         |\n| `     --syslog-s` | Syslog RFC 5424 string streaming parser                 | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/syslog_s)       |\n| `   --syslog-bsd` | Syslog RFC 3164 string parser                           | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/syslog_bsd)     |\n| ` --syslog-bsd-s` | Syslog RFC 3164 string streaming parser                 | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/syslog_bsd_s)   |\n| `    --systemctl` | `systemctl` command parser                              | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/systemctl)      |\n| ` --systemctl-lj` | `systemctl list-jobs` command parser                    | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/systemctl_lj)   |\n| ` --systemctl-ls` | `systemctl list-sockets` command parser                 | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/systemctl_ls)   |\n| `--systemctl-luf` | `systemctl list-unit-files` command parser              | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/systemctl_luf)  |\n| `   --systeminfo` | `systeminfo` command parser                             | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/systeminfo)     |\n| `         --time` | `/usr/bin/time` command parser                          | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/time)           |\n| `  --timedatectl` | `timedatectl status` command parser                     | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/timedatectl)    |\n| `    --timestamp` | Unix Epoch Timestamp string parser                      | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/timestamp)      |\n| `          --top` | `top -b` command parser                                 | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/top)            |\n| `        --top-s` | `top -b` command streaming parser                       | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/top_s)          |\n| `    --tracepath` | `tracepath` and `tracepath6` command parser             | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/tracepath)      |\n| `   --traceroute` | `traceroute` and `traceroute6` command parser           | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/traceroute)     |\n| `      --udevadm` | `udevadm info` command parser                           | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/udevadm)        |\n| `          --ufw` | `ufw status` command parser                             | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/ufw)            |\n| `  --ufw-appinfo` | `ufw app info [application]` command parser             | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/ufw_appinfo)    |\n| `        --uname` | `uname -a` command parser                               | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/uname)          |\n| `--update-alt-gs` | `update-alternatives --get-selections` command parser   | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/update_alt_gs)  |\n| ` --update-alt-q` | `update-alternatives --query` command parser            | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/update_alt_q)   |\n| `       --upower` | `upower` command parser                                 | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/upower)         |\n| `       --uptime` | `uptime` command parser                                 | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/uptime)         |\n| `          --url` | URL string parser                                       | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/url)            |\n| `       --vmstat` | `vmstat` command parser                                 | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/vmstat)         |\n| `     --vmstat-s` | `vmstat` command streaming parser                       | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/vmstat_s)       |\n| `            --w` | `w` command parser                                      | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/w)              |\n| `           --wc` | `wc` command parser                                     | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/wc)             |\n| `          --who` | `who` command parser                                    | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/who)            |\n| `    --x509-cert` | X.509 PEM and DER certificate file parser               | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/x509_cert)      |\n| `          --xml` | XML file parser                                         | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/xml)            |\n| `       --xrandr` | `xrandr` command parser                                 | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/xrandr)         |\n| `         --yaml` | YAML file parser                                        | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/yaml)           |\n| `      --zipinfo` | `zipinfo` command parser                                | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/zipinfo)        |\n\n### Options\n\n| Short | Long            | Description                                                                                                         |\n|-------|-----------------|---------------------------------------------------------------------------------------------------------------------|\n| `-a`  | `--about`       | About `jc`. Prints information about `jc` and the parsers (in JSON or YAML, of course!)                             |\n| `-C`  | `--force-color` | Force color output even when using pipes (overrides `-m` and the `NO_COLOR` env variable)                           |\n| `-d`  | `--debug`       | Debug mode. Prints trace messages if parsing issues are encountered (use`-dd` for verbose debugging)                |\n| `-h`  | `--help`        | Help. Use `jc -h --parser_name` for parser documentation. Use twice to show hidden parsers (e.g. `-hh`)             |\n| `-m`  | `--monochrome`  | Monochrome output                                                                                                   |\n| `-M`  | `--meta-out`    | Add metadata to output including timestamp, parser name, magic command, magic command exit code, etc.               |                                                                        |\n| `-p`  | `--pretty`      | Pretty format the JSON output                                                                                       |\n| `-q`  | `--quiet`       | Quiet mode. Suppresses parser warning messages (use `-qq` to ignore streaming parser errors)                        |\n| `-r`  | `--raw`         | Raw output. Provides more literal output, typically with string values and no additional semantic processing        |\n| `-u`  | `--unbuffer`    | Unbuffer output                                                                                                     |\n| `-v`  | `--version`     | Version information                                                                                                 |\n| `-y`  | `--yaml-out`    | YAML output                                                                                                         |\n| `-B`  | `--bash-comp`   | Generate Bash shell completion script ([more info](https://github.com/kellyjonbrazil/jc/wiki/Shell-Completions))    |\n| `-Z`  | `--zsh-comp`    | Generate Zsh shell completion script ([more info](https://github.com/kellyjonbrazil/jc/wiki/Shell-Completions))     |\n\n### Exit Codes\nAny fatal errors within `jc` will generate an exit code of `100`, otherwise the\nexit code will be `0`.\n\nWhen using the \"magic\" syntax (e.g. `jc ifconfig eth0`),\n`jc` will store the exit code of the program being parsed and add it to the `jc`\nexit code. This way it is easier to determine if an error was from the parsed\nprogram or `jc`.\n\nConsider the following examples using `ifconfig`:\n\n| `ifconfig` exit code | `jc` exit code | Combined exit code | Interpretation                     |\n|----------------------|----------------|--------------------|------------------------------------|\n| `0`                  | `0`            | `0`                | No errors                          |\n| `1`                  | `0`            | `1`                | Error in  `ifconfig`               |\n| `0`                  | `100`          | `100`              | Error in  `jc`                     |\n| `1`                  | `100`          | `101`              | Error in  both `ifconfig` and `jc` |\n\nWhen using the \"magic\" syntax you can also retrieve the exit code of the called\nprogram by using the `--meta-out` or `-M` option. This will append a `_jc_meta`\nobject to the output that will include the magic command information, including\nthe exit code.\n\nHere is an example with `ping`:\n```bash\n$ jc --meta-out -p ping -c2 192.168.1.252\n{\n  \"destination_ip\": \"192.168.1.252\",\n  \"data_bytes\": 56,\n  \"pattern\": null,\n  \"destination\": \"192.168.1.252\",\n  \"packets_transmitted\": 2,\n  \"packets_received\": 0,\n  \"packet_loss_percent\": 100.0,\n  \"duplicates\": 0,\n  \"responses\": [\n    {\n      \"type\": \"timeout\",\n      \"icmp_seq\": 0,\n      \"duplicate\": false\n    }\n  ],\n  \"_jc_meta\": {\n    \"parser\": \"ping\",\n    \"timestamp\": 1661357115.27949,\n    \"magic_command\": [\n      \"ping\",\n      \"-c2\",\n      \"192.168.1.252\"\n    ],\n    \"magic_command_exit\": 2\n  }\n}\n$ echo $?\n2\n```\n\n### Setting Custom Colors via Environment Variable\nYou can specify custom colors via the `JC_COLORS` environment variable. The\n`JC_COLORS` environment variable takes four comma separated string values in\nthe following format:\n```bash\nJC_COLORS=\u003ckeyname_color\u003e,\u003ckeyword_color\u003e,\u003cnumber_color\u003e,\u003cstring_color\u003e\n```\n\nWhere colors are: `black`, `red`, `green`, `yellow`, `blue`, `magenta`, `cyan`,\n`gray`, `brightblack`, `brightred`, `brightgreen`, `brightyellow`, `brightblue`,\n`brightmagenta`, `brightcyan`, `white`, or  `default`\n\nFor example, to set to the default colors:\n```bash\nJC_COLORS=blue,brightblack,magenta,green\n```\nor\n```bash\nJC_COLORS=default,default,default,default\n```\n\n### Disable Colors via Environment Variable\nYou can set the [`NO_COLOR`](http://no-color.org/) environment variable to any\nvalue to disable color output in `jc`. Note that using the `-C` option to force\ncolor output will override both the `NO_COLOR` environment variable and the `-m`\noption.\n\n### Streaming Parsers\nMost parsers load all of the data from `STDIN`, parse it, then output the entire\nJSON document serially. There are some streaming parsers (e.g. `ls-s` and\n`ping-s`) that immediately start processing and outputing the data line-by-line\nas [JSON Lines](https://jsonlines.org/) (aka [NDJSON](http://ndjson.org/)) while\nit is being received from `STDIN`. This can significantly reduce the amount of\nmemory required to parse large amounts of command output (e.g. `ls -lR /`) and\ncan sometimes process the data more quickly. Streaming parsers have slightly\ndifferent behavior than standard parsers as outlined below.\n\n\u003e Note: Streaming parsers cannot be used with the \"magic\" syntax\n\n#### Ignoring Errors\n\nYou may want to ignore parsing errors when using streaming parsers since these\nmay be used in long-lived processing pipelines and errors can break the pipe. To\nignore parsing errors, use the `-qq` cli option or the `ignore_exceptions=True`\nargument with the `parse()` function. This will add a `_jc_meta` object to the\nJSON output with a `success` attribute. If `success` is `true`, then there were\nno issues parsing the line. If `success` is `false`, then a parsing issue was\nfound and `error` and `line` fields will be added to include a short error\ndescription and the contents of the unparsable line, respectively:\n\nSuccessfully parsed line with `-qq` option:\n```json\n{\n  \"command_data\": \"data\",\n  \"_jc_meta\": {\n    \"success\": true\n  }\n}\n```\n\nUnsuccessfully parsed line with `-qq` option:\n```json\n{\n  \"_jc_meta\": {\n    \"success\": false,\n    \"error\": \"error message\",\n    \"line\": \"original line data\"\n  }\n}\n```\n\n#### Unbuffering Output\n\nMost operating systems will buffer output that is being piped from process to\nprocess. The buffer is usually around 4KB. When viewing the output in the\nterminal the OS buffer is not engaged so output is immediately displayed on the\nscreen. When piping multiple processes together, though, it may seem as if the\noutput is hanging when the input data is very slow (e.g. `ping`):\n```\n$ ping 1.1.1.1 | jc --ping-s | jq\n\u003cslow output\u003e\n```\n\nThis is because the OS engages the 4KB buffer between `jc` and `jq` in this\nexample. To display the data on the terminal in realtime, you can disable the\nbuffer with the `-u` (unbuffer) cli option:\n```\n$ ping 1.1.1.1 | jc --ping-s -u | jq\n{\"type\":\"reply\",\"pattern\":null,\"timestamp\":null,\"bytes\":\"64\",\"respons...}\n{\"type\":\"reply\",\"pattern\":null,\"timestamp\":null,\"bytes\":\"64\",\"respons...}\n...\n```\n\n\u003e Note: Unbuffered output can be slower for large data streams.\n\n#### Using Streaming Parsers as Python Modules\n\nStreaming parsers accept any iterable object and return an iterable object\nallowing lazy processing of the data. The input data should iterate on lines\nof string data. Examples of good input data are `sys.stdin` or\n`str.splitlines()`.\n\nTo use the returned iterable object in your code, simply loop through it or\nuse the [next()](https://docs.python.org/3/library/functions.html#next)\nbuiltin function:\n```python\nimport jc\n\nresult = jc.parse('ls_s', ls_command_output.splitlines())\nfor item in result:\n    print(item[\"filename\"])\n```\n\n### Custom Parsers\nCustom local parser plugins may be placed in a `jc/jcparsers` folder in your\nlocal **\"App data directory\"**:\n\n- Linux/unix: `$HOME/.local/share/jc/jcparsers`\n- macOS: `$HOME/Library/Application Support/jc/jcparsers`\n- Windows: `$LOCALAPPDATA\\jc\\jc\\jcparsers`\n\nLocal parser plugins are standard python module files. Use the\n[`jc/parsers/foo.py`](https://github.com/kellyjonbrazil/jc/blob/master/jc/parsers/foo.py)\nor [`jc/parsers/foo_s.py (streaming)`](https://github.com/kellyjonbrazil/jc/blob/master/jc/parsers/foo_s.py)\nparser as a template and simply place a `.py` file in the `jcparsers` subfolder.\n\nLocal plugin filenames must be valid python module names and therefore must\nstart with a letter and consist entirely of alphanumerics and underscores.\nLocal plugins may override default parsers.\n\n\u003e Note: The application data directory follows the\n[XDG Base Directory Specification](https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html)\n\n### Caveats\n\n#### Locale\n\nFor best results set the locale environment variables to `C` or\n`en_US.UTF-8` by modifying the `LC_ALL` variable:\n```\n$ LC_ALL=C date | jc --date\n```\n\nYou can also set the locale variables individually:\n```\n$ export LANG=C\n$ export LC_NUMERIC=C\n```\n\nOn some older systems UTF-8 output will be downgraded to ASCII with `\\\\u`\nescape sequences if the `C` locale does not support UTF-8 encoding.\n\n#### Timezones\n\nSome parsers have calculated epoch timestamp fields added to the output. Unless\na timestamp field name has a `_utc` suffix it is considered naive. (i.e. based\non the local timezone of the system the `jc` parser was run on).\n\nIf a UTC timezone can be detected in the text of the command output, the\ntimestamp will be timezone aware and have a `_utc` suffix on the key name.\n(e.g. `epoch_utc`) No other timezones are supported for aware timestamps.\n\n## Use In Other Shells\n`jc` can be used in most any shell. Some modern shells have JSON deserialization\nand filtering capabilities built-in which makes using `jc` even more convenient.\n\nFor example, the following is possible in [NGS](https://ngs-lang.org/)\n(Next Generation Shell):\n```bash\nmyvar = ``jc dig www.google.com``[0].answer[0].data\n```\nThis runs `jc`, parses the output JSON, and assigs the resulting data structure\nto a variable in a single line of code.\n\nFor more examples of how to use `jc` in other shells, see this\n[wiki page](https://github.com/kellyjonbrazil/jc/wiki/Using-jc-With-Different-Shells).\n\n## Compatibility\nSome parsers like `dig`, `xml`, `csv`, etc. will work on any platform. Other\nparsers that convert platform-specific output will generate a warning message if\nthey are run on an unsupported platform. To see all parser information,\nincluding compatibility, run `jc -ap`.\n\nYou may still use a parser on an unsupported platform - for example, you may\nwant to parse a file with linux `lsof` output on an macOS or Windows laptop. In\nthat case you can suppress the warning message with the `-q` cli option or the\n`quiet=True` function parameter in `parse()`:\n\nmacOS:\n```bash\ncat lsof.out | jc -q --lsof\n```\n\nor Windows:\n```bash\ntype lsof.out | jc -q --lsof\n```\n\nTested on:\n- Centos 7.7\n- Ubuntu 18.04\n- Ubuntu 20.04\n- Fedora32\n- macOS 10.11.6\n- macOS 10.14.6\n- NixOS\n- FreeBSD12\n- Windows 10\n- Windows 2016 Server\n- Windows 2019 Server\n\n## Contributions\nFeel free to add/improve code or parsers! You can use the\n[`jc/parsers/foo.py`](https://github.com/kellyjonbrazil/jc/blob/master/jc/parsers/foo.py)\nor [`jc/parsers/foo_s.py (streaming)`](https://github.com/kellyjonbrazil/jc/blob/master/jc/parsers/foo_s.py) parsers as a template and submit your parser with a pull\nrequest.\n\nPlease see the [Contributing Guidelines](https://github.com/kellyjonbrazil/jc/blob/master/CONTRIBUTING.md) for more information.\n\n## Acknowledgments\n- Local parser plugin feature contributed by [Dean Serenevy](https://github.com/duelafn)\n- CI automation and code optimizations by [philippeitis](https://github.com/philippeitis)\n- [`ifconfig-parser`](https://github.com/KnightWhoSayNi/ifconfig-parser) module\n  by KnightWhoSayNi\n- [`xmltodict`](https://github.com/martinblech/xmltodict) module by Martín Blech\n- [`ruamel.yaml`](https://pypi.org/project/ruamel.yaml) module by Anthon van\n  der Neut\n- [`trparse`](https://github.com/lbenitez000/trparse) module by Luis Benitez\n- Parsing [code](https://gist.github.com/cahna/43a1a3ff4d075bcd71f9d7120037a501)\n  from Conor Heine adapted for some parsers\n- Excellent constructive feedback from [Ilya Sher](https://github.com/ilyash-b)\n\n## Examples\nHere are some examples of `jc` output. For more examples, see\n[here](https://kellyjonbrazil.github.io/jc/EXAMPLES) or the parser\ndocumentation.\n\n### arp\n```bash\narp | jc -p --arp          # or:  jc -p arp\n```\n```json\n[\n  {\n    \"address\": \"gateway\",\n    \"hwtype\": \"ether\",\n    \"hwaddress\": \"00:50:56:f7:4a:fc\",\n    \"flags_mask\": \"C\",\n    \"iface\": \"ens33\"\n  },\n  {\n    \"address\": \"192.168.71.1\",\n    \"hwtype\": \"ether\",\n    \"hwaddress\": \"00:50:56:c0:00:08\",\n    \"flags_mask\": \"C\",\n    \"iface\": \"ens33\"\n  },\n  {\n    \"address\": \"192.168.71.254\",\n    \"hwtype\": \"ether\",\n    \"hwaddress\": \"00:50:56:fe:7a:b4\",\n    \"flags_mask\": \"C\",\n    \"iface\": \"ens33\"\n  }\n]\n```\n### CSV files\n```bash\ncat homes.csv\n```\n```\n\"Sell\", \"List\", \"Living\", \"Rooms\", \"Beds\", \"Baths\", \"Age\", \"Acres\", \"Taxes\"\n142, 160, 28, 10, 5, 3,  60, 0.28,  3167\n175, 180, 18,  8, 4, 1,  12, 0.43,  4033\n129, 132, 13,  6, 3, 1,  41, 0.33,  1471\n...\n```\n```bash\ncat homes.csv | jc -p --csv\n```\n```json\n[\n  {\n    \"Sell\": \"142\",\n    \"List\": \"160\",\n    \"Living\": \"28\",\n    \"Rooms\": \"10\",\n    \"Beds\": \"5\",\n    \"Baths\": \"3\",\n    \"Age\": \"60\",\n    \"Acres\": \"0.28\",\n    \"Taxes\": \"3167\"\n  },\n  {\n    \"Sell\": \"175\",\n    \"List\": \"180\",\n    \"Living\": \"18\",\n    \"Rooms\": \"8\",\n    \"Beds\": \"4\",\n    \"Baths\": \"1\",\n    \"Age\": \"12\",\n    \"Acres\": \"0.43\",\n    \"Taxes\": \"4033\"\n  },\n  {\n    \"Sell\": \"129\",\n    \"List\": \"132\",\n    \"Living\": \"13\",\n    \"Rooms\": \"6\",\n    \"Beds\": \"3\",\n    \"Baths\": \"1\",\n    \"Age\": \"41\",\n    \"Acres\": \"0.33\",\n    \"Taxes\": \"1471\"\n  }\n]\n```\n### /etc/hosts file\n```bash\ncat /etc/hosts | jc -p --hosts\n```\n```json\n[\n  {\n    \"ip\": \"127.0.0.1\",\n    \"hostname\": [\n      \"localhost\"\n    ]\n  },\n  {\n    \"ip\": \"::1\",\n    \"hostname\": [\n      \"ip6-localhost\",\n      \"ip6-loopback\"\n    ]\n  },\n  {\n    \"ip\": \"fe00::0\",\n    \"hostname\": [\n      \"ip6-localnet\"\n    ]\n  }\n]\n```\n### ifconfig\n```bash\nifconfig | jc -p --ifconfig          # or:  jc -p ifconfig\n```\n```json\n[\n  {\n    \"name\": \"ens33\",\n    \"flags\": 4163,\n    \"state\": [\n      \"UP\",\n      \"BROADCAST\",\n      \"RUNNING\",\n      \"MULTICAST\"\n    ],\n    \"mtu\": 1500,\n    \"ipv4_addr\": \"192.168.71.137\",\n    \"ipv4_mask\": \"255.255.255.0\",\n    \"ipv4_bcast\": \"192.168.71.255\",\n    \"ipv6_addr\": \"fe80::c1cb:715d:bc3e:b8a0\",\n    \"ipv6_mask\": 64,\n    \"ipv6_scope\": \"0x20\",\n    \"mac_addr\": \"00:0c:29:3b:58:0e\",\n    \"type\": \"Ethernet\",\n    \"rx_packets\": 8061,\n    \"rx_bytes\": 1514413,\n    \"rx_errors\": 0,\n    \"rx_dropped\": 0,\n    \"rx_overruns\": 0,\n    \"rx_frame\": 0,\n    \"tx_packets\": 4502,\n    \"tx_bytes\": 866622,\n    \"tx_errors\": 0,\n    \"tx_dropped\": 0,\n    \"tx_overruns\": 0,\n    \"tx_carrier\": 0,\n    \"tx_collisions\": 0,\n    \"metric\": null\n  }\n]\n```\n### INI files\n```bash\ncat example.ini\n```\n```\n[DEFAULT]\nServerAliveInterval = 45\nCompression = yes\nCompressionLevel = 9\nForwardX11 = yes\n\n[bitbucket.org]\nUser = hg\n\n[topsecret.server.com]\nPort = 50022\nForwardX11 = no\n```\n```bash\ncat example.ini | jc -p --ini\n```\n```json\n{\n  \"bitbucket.org\": {\n    \"ServeraLiveInterval\": \"45\",\n    \"Compression\": \"yes\",\n    \"CompressionLevel\": \"9\",\n    \"ForwardX11\": \"yes\",\n    \"User\": \"hg\"\n  },\n  \"topsecret.server.com\": {\n    \"ServeraLiveInterval\": \"45\",\n    \"Compression\": \"yes\",\n    \"CompressionLevel\": \"9\",\n    \"ForwardX11\": \"no\",\n    \"Port\": \"50022\"\n  }\n}\n```\n### ls\n```bash\n$ ls -l /usr/bin | jc -p --ls          # or:  jc -p ls -l /usr/bin\n```\n```json\n[\n  {\n    \"filename\": \"apropos\",\n    \"link_to\": \"whatis\",\n    \"flags\": \"lrwxrwxrwx.\",\n    \"links\": 1,\n    \"owner\": \"root\",\n    \"group\": \"root\",\n    \"size\": 6,\n    \"date\": \"Aug 15 10:53\"\n  },\n  {\n    \"filename\": \"ar\",\n    \"flags\": \"-rwxr-xr-x.\",\n    \"links\": 1,\n    \"owner\": \"root\",\n    \"group\": \"root\",\n    \"size\": 62744,\n    \"date\": \"Aug 8 16:14\"\n  },\n  {\n    \"filename\": \"arch\",\n    \"flags\": \"-rwxr-xr-x.\",\n    \"links\": 1,\n    \"owner\": \"root\",\n    \"group\": \"root\",\n    \"size\": 33080,\n    \"date\": \"Aug 19 23:25\"\n  }\n]\n```\n### netstat\n```bash\nnetstat -apee | jc -p --netstat          # or:  jc -p netstat -apee\n```\n```json\n[\n  {\n    \"proto\": \"tcp\",\n    \"recv_q\": 0,\n    \"send_q\": 0,\n    \"local_address\": \"localhost\",\n    \"foreign_address\": \"0.0.0.0\",\n    \"state\": \"LISTEN\",\n    \"user\": \"systemd-resolve\",\n    \"inode\": 26958,\n    \"program_name\": \"systemd-resolve\",\n    \"kind\": \"network\",\n    \"pid\": 887,\n    \"local_port\": \"domain\",\n    \"foreign_port\": \"*\",\n    \"transport_protocol\": \"tcp\",\n    \"network_protocol\": \"ipv4\"\n  },\n  {\n    \"proto\": \"tcp6\",\n    \"recv_q\": 0,\n    \"send_q\": 0,\n    \"local_address\": \"[::]\",\n    \"foreign_address\": \"[::]\",\n    \"state\": \"LISTEN\",\n    \"user\": \"root\",\n    \"inode\": 30510,\n    \"program_name\": \"sshd\",\n    \"kind\": \"network\",\n    \"pid\": 1186,\n    \"local_port\": \"ssh\",\n    \"foreign_port\": \"*\",\n    \"transport_protocol\": \"tcp\",\n    \"network_protocol\": \"ipv6\"\n  },\n  {\n    \"proto\": \"udp\",\n    \"recv_q\": 0,\n    \"send_q\": 0,\n    \"local_address\": \"localhost\",\n    \"foreign_address\": \"0.0.0.0\",\n    \"state\": null,\n    \"user\": \"systemd-resolve\",\n    \"inode\": 26957,\n    \"program_name\": \"systemd-resolve\",\n    \"kind\": \"network\",\n    \"pid\": 887,\n    \"local_port\": \"domain\",\n    \"foreign_port\": \"*\",\n    \"transport_protocol\": \"udp\",\n    \"network_protocol\": \"ipv4\"\n  },\n  {\n    \"proto\": \"raw6\",\n    \"recv_q\": 0,\n    \"send_q\": 0,\n    \"local_address\": \"[::]\",\n    \"foreign_address\": \"[::]\",\n    \"state\": \"7\",\n    \"user\": \"systemd-network\",\n    \"inode\": 27001,\n    \"program_name\": \"systemd-network\",\n    \"kind\": \"network\",\n    \"pid\": 867,\n    \"local_port\": \"ipv6-icmp\",\n    \"foreign_port\": \"*\",\n    \"transport_protocol\": null,\n    \"network_protocol\": \"ipv6\"\n  },\n  {\n    \"proto\": \"unix\",\n    \"refcnt\": 2,\n    \"flags\": null,\n    \"type\": \"DGRAM\",\n    \"state\": null,\n    \"inode\": 33322,\n    \"program_name\": \"systemd\",\n    \"path\": \"/run/user/1000/systemd/notify\",\n    \"kind\": \"socket\",\n    \"pid\": 1607\n  }\n]\n```\n### /etc/passwd file\n```bash\ncat /etc/passwd | jc -p --passwd\n```\n```json\n[\n  {\n    \"username\": \"root\",\n    \"password\": \"*\",\n    \"uid\": 0,\n    \"gid\": 0,\n    \"comment\": \"System Administrator\",\n    \"home\": \"/var/root\",\n    \"shell\": \"/bin/sh\"\n  },\n  {\n    \"username\": \"daemon\",\n    \"password\": \"*\",\n    \"uid\": 1,\n    \"gid\": 1,\n    \"comment\": \"System Services\",\n    \"home\": \"/var/root\",\n    \"shell\": \"/usr/bin/false\"\n  }\n]\n```\n### ping\n```bash\nping 8.8.8.8 -c 3 | jc -p --ping          # or:  jc -p ping 8.8.8.8 -c 3\n```\n```json\n{\n  \"destination_ip\": \"8.8.8.8\",\n  \"data_bytes\": 56,\n  \"pattern\": null,\n  \"destination\": \"8.8.8.8\",\n  \"packets_transmitted\": 3,\n  \"packets_received\": 3,\n  \"packet_loss_percent\": 0.0,\n  \"duplicates\": 0,\n  \"time_ms\": 2005.0,\n  \"round_trip_ms_min\": 23.835,\n  \"round_trip_ms_avg\": 30.46,\n  \"round_trip_ms_max\": 34.838,\n  \"round_trip_ms_stddev\": 4.766,\n  \"responses\": [\n    {\n      \"type\": \"reply\",\n      \"timestamp\": null,\n      \"bytes\": 64,\n      \"response_ip\": \"8.8.8.8\",\n      \"icmp_seq\": 1,\n      \"ttl\": 118,\n      \"time_ms\": 23.8,\n      \"duplicate\": false\n    },\n    {\n      \"type\": \"reply\",\n      \"timestamp\": null,\n      \"bytes\": 64,\n      \"response_ip\": \"8.8.8.8\",\n      \"icmp_seq\": 2,\n      \"ttl\": 118,\n      \"time_ms\": 34.8,\n      \"duplicate\": false\n    },\n    {\n      \"type\": \"reply\",\n      \"timestamp\": null,\n      \"bytes\": 64,\n      \"response_ip\": \"8.8.8.8\",\n      \"icmp_seq\": 3,\n      \"ttl\": 118,\n      \"time_ms\": 32.7,\n      \"duplicate\": false\n    }\n  ]\n}\n```\n### ps\n```bash\nps axu | jc -p --ps          # or:  jc -p ps axu\n```\n```json\n[\n  {\n    \"user\": \"root\",\n    \"pid\": 1,\n    \"cpu_percent\": 0.0,\n    \"mem_percent\": 0.1,\n    \"vsz\": 128072,\n    \"rss\": 6784,\n    \"tty\": null,\n    \"stat\": \"Ss\",\n    \"start\": \"Nov09\",\n    \"time\": \"0:08\",\n    \"command\": \"/usr/lib/systemd/systemd --switched-root --system --deseria...\"\n  },\n  {\n    \"user\": \"root\",\n    \"pid\": 2,\n    \"cpu_percent\": 0.0,\n    \"mem_percent\": 0.0,\n    \"vsz\": 0,\n    \"rss\": 0,\n    \"tty\": null,\n    \"stat\": \"S\",\n    \"start\": \"Nov09\",\n    \"time\": \"0:00\",\n    \"command\": \"[kthreadd]\"\n  },\n  {\n    \"user\": \"root\",\n    \"pid\": 4,\n    \"cpu_percent\": 0.0,\n    \"mem_percent\": 0.0,\n    \"vsz\": 0,\n    \"rss\": 0,\n    \"tty\": null,\n    \"stat\": \"S\u003c\",\n    \"start\": \"Nov09\",\n    \"time\": \"0:00\",\n    \"command\": \"[kworker/0:0H]\"\n  }\n]\n```\n### traceroute\n```bash\ntraceroute -m 2 8.8.8.8 | jc -p --traceroute\n# or:  jc -p traceroute -m 2 8.8.8.8\n```\n```json\n{\n  \"destination_ip\": \"8.8.8.8\",\n  \"destination_name\": \"8.8.8.8\",\n  \"hops\": [\n    {\n      \"hop\": 1,\n      \"probes\": [\n        {\n          \"annotation\": null,\n          \"asn\": null,\n          \"ip\": \"192.168.1.254\",\n          \"name\": \"dsldevice.local.net\",\n          \"rtt\": 6.616\n        },\n        {\n          \"annotation\": null,\n          \"asn\": null,\n          \"ip\": \"192.168.1.254\",\n          \"name\": \"dsldevice.local.net\",\n          \"rtt\": 6.413\n        },\n        {\n          \"annotation\": null,\n          \"asn\": null,\n          \"ip\": \"192.168.1.254\",\n          \"name\": \"dsldevice.local.net\",\n          \"rtt\": 6.308\n        }\n      ]\n    },\n    {\n      \"hop\": 2,\n      \"probes\": [\n        {\n          \"annotation\": null,\n          \"asn\": null,\n          \"ip\": \"76.220.24.1\",\n          \"name\": \"76-220-24-1.lightspeed.sntcca.sbcglobal.net\",\n          \"rtt\": 29.367\n        },\n        {\n          \"annotation\": null,\n          \"asn\": null,\n          \"ip\": \"76.220.24.1\",\n          \"name\": \"76-220-24-1.lightspeed.sntcca.sbcglobal.net\",\n          \"rtt\": 40.197\n        },\n        {\n          \"annotation\": null,\n          \"asn\": null,\n          \"ip\": \"76.220.24.1\",\n          \"name\": \"76-220-24-1.lightspeed.sntcca.sbcglobal.net\",\n          \"rtt\": 29.162\n        }\n      ]\n    }\n  ]\n}\n```\n### uptime\n```bash\nuptime | jc -p --uptime          # or:  jc -p uptime\n```\n```json\n{\n  \"time\": \"11:35\",\n  \"uptime\": \"3 days, 4:03\",\n  \"users\": 5,\n  \"load_1m\": 1.88,\n  \"load_5m\": 2.0,\n  \"load_15m\": 1.94,\n  \"time_hour\": 11,\n  \"time_minute\": 35,\n  \"time_second\": null,\n  \"uptime_days\": 3,\n  \"uptime_hours\": 4,\n  \"uptime_minutes\": 3,\n  \"uptime_total_seconds\": 273780\n}\n```\n### XML files\n```bash\ncat cd_catalog.xml\n```\n```xml\n\u003c?xml version=\"1.0\" encoding=\"UTF-8\"?\u003e\n\u003cCATALOG\u003e\n  \u003cCD\u003e\n    \u003cTITLE\u003eEmpire Burlesque\u003c/TITLE\u003e\n    \u003cARTIST\u003eBob Dylan\u003c/ARTIST\u003e\n    \u003cCOUNTRY\u003eUSA\u003c/COUNTRY\u003e\n    \u003cCOMPANY\u003eColumbia\u003c/COMPANY\u003e\n    \u003cPRICE\u003e10.90\u003c/PRICE\u003e\n    \u003cYEAR\u003e1985\u003c/YEAR\u003e\n  \u003c/CD\u003e\n  \u003cCD\u003e\n    \u003cTITLE\u003eHide your heart\u003c/TITLE\u003e\n    \u003cARTIST\u003eBonnie Tyler\u003c/ARTIST\u003e\n    \u003cCOUNTRY\u003eUK\u003c/COUNTRY\u003e\n    \u003cCOMPANY\u003eCBS Records\u003c/COMPANY\u003e\n    \u003cPRICE\u003e9.90\u003c/PRICE\u003e\n    \u003cYEAR\u003e1988\u003c/YEAR\u003e\n  \u003c/CD\u003e\n  ...\n```\n```bash\ncat cd_catalog.xml | jc -p --xml\n```\n```json\n{\n  \"CATALOG\": {\n    \"CD\": [\n      {\n        \"TITLE\": \"Empire Burlesque\",\n        \"ARTIST\": \"Bob Dylan\",\n        \"COUNTRY\": \"USA\",\n        \"COMPANY\": \"Columbia\",\n        \"PRICE\": \"10.90\",\n        \"YEAR\": \"1985\"\n      },\n      {\n        \"TITLE\": \"Hide your heart\",\n        \"ARTIST\": \"Bonnie Tyler\",\n        \"COUNTRY\": \"UK\",\n        \"COMPANY\": \"CBS Records\",\n        \"PRICE\": \"9.90\",\n        \"YEAR\": \"1988\"\n      }\n    ]\n  }\n}\n```\n### YAML files\n```bash\ncat istio.yaml \n```\n```yaml\napiVersion: \"authentication.istio.io/v1alpha1\"\nkind: \"Policy\"\nmetadata:\n  name: \"default\"\n  namespace: \"default\"\nspec:\n  peers:\n  - mtls: {}\n---\napiVersion: \"networking.istio.io/v1alpha3\"\nkind: \"DestinationRule\"\nmetadata:\n  name: \"default\"\n  namespace: \"default\"\nspec:\n  host: \"*.default.svc.cluster.local\"\n  trafficPolicy:\n    tls:\n      mode: ISTIO_MUTUAL\n```\n```bash\ncat istio.yaml | jc -p --yaml\n```\n```json\n[\n  {\n    \"apiVersion\": \"authentication.istio.io/v1alpha1\",\n    \"kind\": \"Policy\",\n    \"metadata\": {\n      \"name\": \"default\",\n      \"namespace\": \"default\"\n    },\n    \"spec\": {\n      \"peers\": [\n        {\n          \"mtls\": {}\n        }\n      ]\n    }\n  },\n  {\n    \"apiVersion\": \"networking.istio.io/v1alpha3\",\n    \"kind\": \"DestinationRule\",\n    \"metadata\": {\n      \"name\": \"default\",\n      \"namespace\": \"default\"\n    },\n    \"spec\": {\n      \"host\": \"*.default.svc.cluster.local\",\n      \"trafficPolicy\": {\n        \"tls\": {\n          \"mode\": \"ISTIO_MUTUAL\"\n        }\n      }\n    }\n  }\n]\n```\n\n© 2019-2022 Kelly Brazil","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femmeowzing%2Fjc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Femmeowzing%2Fjc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femmeowzing%2Fjc/lists"}