commit
88f1a41292
@ -0,0 +1,37 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Prompt for the app name
|
||||
read -p "Enter the name of your Splunk app: " APP_NAME
|
||||
|
||||
# Prompt for the app description
|
||||
read -p "Enter a description for your Splunk app: " APP_DESCRIPTION
|
||||
|
||||
# Define the base directory for the app, adjust it if you have a different Splunk apps directory
|
||||
SPLUNK_APPS_DIR="/opt/splunk/etc/apps"
|
||||
|
||||
# Construct the app directory path
|
||||
APP_DIR="$SPLUNK_APPS_DIR/$APP_NAME"
|
||||
|
||||
# Create the directory structure
|
||||
mkdir -p "$APP_DIR/bin"
|
||||
mkdir -p "$APP_DIR/default"
|
||||
mkdir -p "$APP_DIR/local"
|
||||
mkdir -p "$APP_DIR/metadata"
|
||||
mkdir -p "$APP_DIR/static"
|
||||
mkdir -p "$APP_DIR/lookups"
|
||||
|
||||
# Create a basic app.conf file
|
||||
cat <<EOT > "$APP_DIR/default/app.conf"
|
||||
[launcher]
|
||||
version = 1.0
|
||||
description = $APP_DESCRIPTION
|
||||
|
||||
[ui]
|
||||
is_visible = 1
|
||||
label = $APP_NAME
|
||||
|
||||
[install]
|
||||
is_configured = false
|
||||
EOT
|
||||
|
||||
echo "Splunk app $APP_NAME has been created successfully in $APP_DIR"
|
Loading…
Reference in new issue