Packaging your app

To package an app, we need to be sure that there are a few values in default/app.conf, and only then will we build the archive.

First, edit default/app.conf like this:

[install] 
is_configured = 0 
build = 1 
[ui] 
is_visible = 1 
label = Implementing Splunk App One 
[launcher] 
author = My name 
description = My great app! 
version = 1.0 
[package] 
check_for_updates = 1 
id = is_app_one 

The identifier build is used in all URLs, so it should be incremented to defeat browser caching and the identifier ID should be a unique value in Splunkbase—you will be alerted if the value is not unique.

Next, we need to build a .tar file compressed with gzip. With a modern version of tar, the command is simply the following:

cd /tmp
tar -czvf is_app_one.tgz ...

Get Implementing Splunk 7 - Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.