How to uncompress a .xz file in Red Hat Enterprise Linux

You have generated a sosreport and now want to take a look at the files. To extract the files you need to have installed xz

root@linux:~ # rpm -qi xz
Name : xz
Version : 5.2.2
Release : 1.el7
Architecture: x86_64
Install Date: Thu 05 Jan 2017 12:36:49 PM EST
Group : Applications/File
Size : 798066
License : LGPLv2+
Signature : RSA/SHA256, Thu 05 May 2016 10:16:16 AM EDT, Key ID 199e2f91fd431d51
Source RPM : xz-5.2.2-1.el7.src.rpm
Build Date : Fri 04 Mar 2016 07:57:32 AM EST
Build Host :
Relocations : (not relocatable)
Packager : Red Hat, Inc.
Vendor : Red Hat, Inc.
Summary : LZMA compression utilities
Description :
XZ Utils are an attempt to make LZMA compression easy to use on free (as in
freedom) operating systems. This is achieved by providing tools and libraries
which are similar to use than the equivalents of the most popular existing
compression algorithms.

LZMA is a general purpose compression algorithm designed by Igor Pavlov as
part of 7-Zip. It provides high compression ratio while keeping the
decompression speed fast.

Then run unxz and extract the tarball with tar

root@linux:/var/tmp # unxz
root@linux:/var/tmp # tar -xf