Package: itsicli
The ITSI Command Line Interface (CLI)Setup Virtualenvpython3 -m venv /path/to/new/virtual/environment

source /path/to/new/virtual/environment/bin/activateFor more info about venv, clickhere.itsi-content-packoverviewTheitsi-content-packcommand assists in creating and managing ITSI Content Packs. The main functionality is to convert an itsi backup zip file into Splunk App for Content Packs supported format for itsi objects. Supported backup version is 4.9.0The general end-to-end workflow is as follows with example provided in each step:DependenciesTheitsi-content-packcommand depends on theitsimodelspython module to convert an itsi backup to itsi object jsons used by Splunk App for Content Packs. Here'ssource linktoitsimodels. The packageditsimoduleis publishedhereon PyPI, and can be installed via pip (see below).Steps to create content packClone the reposPrep your environmentInitialize content packImport itsi backupClone the reposClone the following repos on your local box. It is recommended that you do this on a linux box.itsi-cli(current repo)itsi-modelsitsi-contentPrep your environmentInstall the latest dependent python packagespip install --upgrade itsicli
pip install --upgrade itsimodelsUpdate PATH to includeitsi-cli/binso we can invokeitsi-content-packcommand from anywhere:export PATH=$PATH:<path to itsi-cli/bin>Example:export PATH=$PATH:/my/git/itsi-cli/bin:bulb: If you are a developer working on fixing itsicli or itsimodels and would like to test with unpublished changes in your own environment, then set your PYTHONPATH to includeitsi-modelsanditsi-clitop level folders to utilize your local changes:export PYTHONPATH=<path to itsi-cli>:<path to itsi-models>Example:export PYTHONPATH=/my/git/itsi-cli:/my/git/itsi-modelsInitialize content packThis step only needs to be done once if you are starting fresh content pack. You can always remove the directory created below and start over if needed. Steps below shows how to create a new content pack in your local clone ofitsi-contentrepo. You can always create the content pack in some other folder on your system and then copy intosrcof youritsi-contentfolder when you are ready to test/build/push changes.Create a new git branch for your changes in your local clone ofitsi-contentCreate an empty folder undersrcof your local clone of itsi-content repomkdir DA-ITSI-CP-<your-cp-name>This will be the main folder of your content pack, see other content pack foldershere.Go into the folder you just createdcd DA-ITSI-CP-<your-cp-name>Create skeleton files/foldersitsi-content-pack initFollow the prompt to provide a content pack id and title. Please prefix id withDA-ITSI-CP-. Once completed, you should see the following folders and files created├── appserver
│   └── static
│       └── screenshots
├── default
│   └── app.conf
└── itsi
    ├── README.md
    ├── config.json
    └── manifest.jsonYou should update README.md to explain what your content pack is for. See other content packs for inspirations. You should also add thumbnails and screenshots for your content pack.Import itsi backupOnce the content pack is initialized, you can create content pack ITSI objects by importing your itsi backup zip file. Perform the command from within yourDA-ITSI-CP-<your-cp-name>directory.itsi-content-pack importbackup <path-to-backup-zip-file>Example:itsi-content-pack importbackup /full/path/to/my_cp_itsi_partial_backup490.zipYou will see logging messages and maybe some warnings as well. Take a look at the warnings to see if there are any real issues.You can rerun this step many times. You may want to first backup your previousDA-ITSI-CP-<your-cp-name>\itsifolder for comparison/backup before you runimportbackupagain.Continue to add, remove, or edit content from the Content PackYou can add or remove objects inside each object type directory, make sure to update manifest.json as part of your changes.Add any supporting Splunk knowledge objectsThis DA-ITSI-CP-* is a Splunk app, so feel free to add lookups, transforms, props, etc that are Splunk compatible.Validate the Content Pack through thevalidatecommandInside DA-ITSI-CP-*, run following command to validate if this content pack is compatible with ITSI.itsi-content-pack validateSubmit content packPlease follow README in itsi-content repoBuild content pack appInstall content pack appInstall your content packSubmit content pack via PRSubmit the Content Pack to either:
- Splunkbase (must first run thebuildcommand)
- The ITSI Splunk App for Content Packs via a pull request on Github repo: itsi-contentBuild the itsicli distribution archive and upload it to PyPiFor releasing the packages you must have Maintainer access on PyPiThere are two ways:Build and release itsicli packages manuallyBuild and release itsicli packages automaticallyBuild and release itsicli packages manually:exclamation:Please build the package on linux boxInstall the build dependencies:pip install --upgrade setuptools wheelGenerate the Python packageClean up distribution:make cleanGenerate the Python distribution archive:makeUpload to the Python Package IndexInstall the dependencies required for uploading to the index:pip install --upgrade twineUpload to PyPI:make uploadBuild and release itsicli packages automaticallyOn the left sidebar, select CI/CD > Pipelines.Select Run Pipeline.In the Run for branch name select the branch to run the pipeline for.Select Run pipeline.base_stage job will run automaticallysast and whitesource_python are manual jobs that do not need to be triggered if you are trying to release the packages on PyPi.After successfully completion of previous job you have to click on the Settings icon ofbuildjob to fill variables for providing username and passwordFill the data as followsKey: username
Value: <username of PYPI>Key: password
Value: <password of PYPI>Click onTrigger this manual actionto start the pipelinePlease wait for thebuildjob to completeTroubleshootingLog file name:itsi_contentpacks_itsicli.log
itsi_contentpacks_itsimodels.logIf you have $SPLUNK_HOME environment set, then you can find the log file in:$SPLUNK_HOME/var/log/splunk/Otherwise, you will find the log file in~/