diff --git a/README.md b/README.md index d5c8f0b7..f85a7b68 100755 --- a/README.md +++ b/README.md @@ -85,6 +85,7 @@ The JSON output can be compact (default) or pretty formatted with the `-p` optio ### Parsers - `--arp` enables the `arp` command parser +- `--blkid` enables the `blkid` command parser - `--crontab` enables the `crontab` command and file parser - `--crontab-u` enables the `crontab` file parser with user support - `--df` enables the `df` command parser @@ -100,6 +101,7 @@ The JSON output can be compact (default) or pretty formatted with the `-p` optio - `--ini` enables the `INI` file parser - `--iptables` enables the `iptables` command parser - `--jobs` enables the `jobs` command parser +- `--last` enables the `last` and `lastb` command parser - `--ls` enables the `ls` command parser - `--lsblk` enables the `lsblk` command parser - `--lsmod` enables the `lsmod` command parser @@ -209,6 +211,53 @@ $ arp -a | jc --arp -p # or: jc -p arp -a } ] ``` +### blkid +``` +$ blkid | jc --blkid -p # or: jc -p blkid +[ + { + "device": "/dev/sda1", + "uuid": "05d927ab-5875-49e4-ada1-7f46cb32c932", + "type": "xfs" + }, + { + "device": "/dev/sda2", + "uuid": "3klkIj-w1kk-DkJi-0XBJ-y3i7-i2Ac-vHqWBM", + "type": "LVM2_member" + }, + { + "device": "/dev/mapper/centos-root", + "uuid": "07d718ff-950c-4e5b-98f0-42a1147c77d9", + "type": "xfs" + }, + { + "device": "/dev/mapper/centos-swap", + "uuid": "615eb89a-bcbf-46fd-80e3-c483ff5c931f", + "type": "swap" + } +] +``` +``` +$ sudo blkid -o udev -ip /dev/sda2 | jc --blkid -p # or: sudo jc -p blkid -o udev -ip /dev/sda2 +[ + { + "id_fs_uuid": "3klkIj-w1kk-DkJi-0XBJ-y3i7-i2Ac-vHqWBM", + "id_fs_uuid_enc": "3klkIj-w1kk-DkJi-0XBJ-y3i7-i2Ac-vHqWBM", + "id_fs_version": "LVM2\x20001", + "id_fs_type": "LVM2_member", + "id_fs_usage": "raid", + "id_iolimit_minimum_io_size": 512, + "id_iolimit_physical_sector_size": 512, + "id_iolimit_logical_sector_size": 512, + "id_part_entry_scheme": "dos", + "id_part_entry_type": "0x8e", + "id_part_entry_number": 2, + "id_part_entry_offset": 2099200, + "id_part_entry_size": 39843840, + "id_part_entry_disk": "8:0" + } +] +``` ### crontab ``` $ cat /etc/crontab | jc --crontab -p # or: jc -p crontab -l @@ -946,6 +995,36 @@ $ jobs -l | jc --jobs -p # or: jc -p jobs } ] ``` +### last and lastb +``` +$ last | jc --last -p # or: jc -p last +[ + { + "user": "joeuser", + "tty": "ttys002", + "hostname": null, + "login": "Thu Feb 27 14:31", + "logout": "still logged in" + }, + { + "user": "joeuser", + "tty": "ttys003", + "hostname": null, + "login": "Thu Feb 27 10:38", + "logout": "10:38", + "duration": "00:00" + }, + { + "user": "joeuser", + "tty": "ttys003", + "hostname": null, + "login": "Thu Feb 27 10:18", + "logout": "10:18", + "duration": "00:00" + }, + ... +] +``` ### ls ``` $ ls -l /usr/bin | jc --ls -p # or: jc -p ls -l /usr/bin diff --git a/changelog.txt b/changelog.txt index 8d1aa908..780bfdda 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,6 +1,7 @@ jc changelog 20200227 v1.8.0 +- Added blkid command parser - Added last and lastb command parser 20200227 v1.7.5 diff --git a/setup.py b/setup.py index 62d38a27..6eabe9cc 100755 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ with open('README.md', 'r') as f: setuptools.setup( name='jc', - version='1.7.5', + version='1.8.0', author='Kelly Brazil', author_email='kellyjonbrazil@gmail.com', description='This tool serializes the output of popular command line tools and filetypes to structured JSON output.',