Install AppInspect on Linux

This topic includes details about installing the Splunk AppInspect Python-based package, including all required dependencies, on Linux operating systems. It contains the following sections:

Install AppInspect in a virtualenv virtual environment

Splunk recommends using virtualenv to create a virtual environment in which to install and use AppInspect. Using virtualenv enables you to install AppInspect in an isolated Python environment, and to ensure you're using versions of AppInspect dependencies that have been tested and are known to work with AppInspect. You can also install AppInspect without using virtualenv; see Install AppInspect without using virtualenv for more information.

Install pip

If pip isn't currently installed, first install it. Open a terminal window and enter the following command:

$ [sudo] apt-get install python-pip 

Upgrade pip

If your deployment does not have version 30 or greater of setuptools, upgrade setuptools before installing splunk-appinspect. Open a terminal window and enter the following command:

$ [sudo] pip install --upgrade pip setuptools

Install virtualenv and prepare a virtual environment

First, install virtualenv and create a virtual environment.

  1. Install virtualenv:

    $ [sudo] pip install virtualenv

    For more installation options, see Installation in virtualenv Installation.

  2. Create a new virtual environment by running the following command:

    $ virtualenv venv
    Note: venv is the name we've chosen to give to the directory where the virtual environment lives. You can use whatever name you want.

    For more information about creating a new virtual environment, see Usage in the virtualenv User Guide.

  3. Activate and enter the new virtual environment by running the following command:

    $ source venv/bin/activate

    For more information about activating virtualenv, see activate script in the virtualenv User Guide.

  4. Install prerequisites

    Next, install the dependencies for Splunk AppInspect.

    Note: The AppInspect installation script will attempt to install all dependencies automatically, which may make this step unnecessary. To try this, skip to Install AppInspect and follow the instructions there. If the installation can't complete or has problems, return to this section and try manually installing prerequisites.
    1. Update the package manager and resync package index files by running the following command:

      (venv)$ [sudo] apt-get update
    2. Install dependencies. You can either install them all at once or one at a time:

      To install third-party dependencies all at once:

      • Run the following command:

        (venv)$ apt-get install -y libxml2-dev libxslt-dev lib32z1-dev python-lxml

      To install third-party dependencies individually:

      1. Install libxml2-dev. Run the following command:

        (venv)$ apt-get install libxml2-dev

        Verify libxml2-dev is installed by running the following command, which returns several directories with "libxml2" in their names:

        (venv)$ find / -name "*libxml2*" 2>/dev/null
      2. Install libxslt-dev. Run the following command:

        (venv)$ apt-get install libxslt-dev

        Verify libxslt-dev is installed by running the following command, which returns several directories with "libxslt" in their names:

        (venv)$ find / -name "*libxslt*" 2>/dev/null
      3. Install lib32z1-dev. Run the following command:

        (venv)$ apt-get install lib32z1-dev

        Verify lib32z1-dev is installed by running the following command, which returns several directories with "lib32z1" in their names:

        (venv)$ find / -name "*lib32z1*" 2>/dev/null
      4. Install lxml. Run the following command:

        (venv)$ apt-get install python-lxml

        Verify lxml is installed by running the following command, which returns several directories with "libxml" in their names:

        (venv)$ find / -name "libxml" 2>/dev/null
    Note: If you experience problems installing lxml, see the LXML installation guide.

    Install AppInspect

    To install the AppInspect installation tarball on Linux:

    1. Download the AppInspect installation tarball, but do not decompress it. To download AppInspect, you must first agree to the following:

      "By downloading AppInspect here, I hereby accept the terms of the Splunk Software License Agreement. This tool is published by Splunk but is not supported." To verify the integrity of the downloaded ZIP file:
    2. The following command installs all additional Python dependencies in the virtual environment and configures it so you can run splunk-appinspect. Be sure to replace <version> so that the name of the file matches the one you downloaded.

      (venv)$ [sudo] pip install splunk-appinspect-<version>.tar.gz
    3. Verify that AppInspect is installed by running the following command:

      (venv)$ splunk-appinspect --help

    Install AppInspect without using virtualenv

    If you prefer to run AppInspect without using a virtualenv virtual environment, do the following:

    Install pip

    If pip isn't currently installed, first install it. Open a terminal window and enter the following command:

    $ [sudo] apt-get install python-pip 

    Upgrade pip

    If your deployment does not have version 30 or greater of setuptools, upgrade setuptools before installing splunk-appinspect. Open a terminal window and enter the following command:

    $ [sudo] pip install --upgrade pip setuptools

    Install prerequisites

    Next, install the dependencies for Splunk AppInspect.

    Note: The AppInspect installation script will attempt to install all dependencies automatically, which may make this step unnecessary. To try this, skip to Install AppInspect and follow the instructions there. If the installation can't complete or has problems, return to this section and try manually installing prerequisites.
    1. Update the package manager and resync package index files by running the following command:

      $ [sudo] apt-get update
    2. Install dependencies. You can either install them all at once or one at a time:

      To install third-party dependencies all at once:

      • Run the following command:

        $ [sudo] apt-get install -y libxml2-dev libxslt-dev lib32z1-dev python-lxml

      To install third-party dependencies individually:

      1. Install libxml2-dev. Run the following command:

        $ apt-get install libxml2-dev

        Verify libxml2-dev is installed by running the following command, which returns several directories with "libxml2" in their names:

        $ find / -name "*libxml2*" 2>/dev/null
      2. Install libxslt-dev. Run the following command:

        $ apt-get install libxslt-dev

        Verify libxslt-dev is installed by running the following command, which returns several directories with "libxslt" in their names:

        $ find / -name "*libxslt*" 2>/dev/null
      3. Install lib32z1-dev. Run the following command:

        $ apt-get install lib32z1-dev

        Verify lib32z1-dev is installed by running the following command, which returns several directories with "lib32z1" in their names:

        $ find / -name "*lib32z1*" 2>/dev/null
      4. Install lxml. Run the following command:

        $ apt-get install python-lxml

        Verify lxml is installed by running the following command, which returns several directories with "libxml" in their names:

        $ find / -name "libxml" 2>/dev/null
    Note: If you experience problems installing lxml, see the LXML installation guide.

    Install AppInspect

    To install the AppInspect installation tarball on Linux:

    1. Download the AppInspect installation tarball, but do not decompress it. To download AppInspect, you must first agree to the following:

      "By downloading AppInspect here, I hereby accept the terms of the Splunk Software License Agreement. This tool is published by Splunk but is not supported."

      To verify the integrity of the downloaded ZIP file:

    2. The following command installs all additional Python dependencies in the virtual environment and configures it so you can run splunk-appinspect. Be sure to replace <version> so that the name of the file matches the one you downloaded.

      $ [sudo] pip install splunk-appinspect-<version>.tar.gz
    3. Verify that AppInspect is installed by running the following command:

      $ splunk-appinspect --help