Skip to content

Commit 6781963

Browse files
'Add new script' (#9090)
1 parent 93bcba1 commit 6781963

File tree

4 files changed

+174
-0
lines changed

4 files changed

+174
-0
lines changed

ct/headers/splunk-enterprise

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
_____ __ __ ______ __ _
2+
/ ___/____ / /_ ______ / /__ / ____/___ / /____ _________ _____(_)_______
3+
\__ \/ __ \/ / / / / __ \/ //_/_____/ __/ / __ \/ __/ _ \/ ___/ __ \/ ___/ / ___/ _ \
4+
___/ / /_/ / / /_/ / / / / ,< /_____/ /___/ / / / /_/ __/ / / /_/ / / / (__ ) __/
5+
/____/ .___/_/\__,_/_/ /_/_/|_| /_____/_/ /_/\__/\___/_/ / .___/_/ /_/____/\___/
6+
/_/ /_/

ct/splunk-enterprise.sh

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
#!/usr/bin/env bash
2+
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func)
3+
# Copyright (c) 2021-2025 community-scripts ORG
4+
# Author: rcastley
5+
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
6+
# Source: https://www.splunk.com/en_us/download.html
7+
8+
APP="Splunk-Enterprise"
9+
var_tags="${var_tags:-monitoring}"
10+
var_cpu="${var_cpu:-4}"
11+
var_ram="${var_ram:-8192}"
12+
var_disk="${var_disk:-40}"
13+
var_os="${var_os:-ubuntu}"
14+
var_version="${var_version:-24.04}"
15+
var_unprivileged="${var_unprivileged:-1}"
16+
17+
header_info "$APP"
18+
variables
19+
color
20+
catch_errors
21+
22+
function update_script() {
23+
header_info
24+
check_container_storage
25+
check_container_resources
26+
if [[ ! -d /opt/splunk ]]; then
27+
msg_error "No ${APP} Installation Found!"
28+
exit
29+
fi
30+
msg_error "Currently we don't provide an update function for this ${APP}."
31+
exit
32+
}
33+
34+
start
35+
build_container
36+
description
37+
38+
msg_ok "Completed Successfully!\n"
39+
echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}"
40+
echo -e "${INFO}${YW}Access the Splunk Enterprise Web interface using the following URL:${CL}"
41+
echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:8000${CL}"
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
{
2+
"name": "Splunk Enterprise",
3+
"slug": "splunk-enterprise",
4+
"categories": [
5+
9
6+
],
7+
"date_created": "2025-11-06",
8+
"type": "ct",
9+
"updateable": false,
10+
"privileged": false,
11+
"interface_port": 8000,
12+
"documentation": "https://help.splunk.com",
13+
"config_path": "",
14+
"website": "https://www.splunk.com/en_us/download/splunk-enterprise.html",
15+
"logo": "https://cdn.jsdelivr.net/gh/selfhst/icons/webp/splunk.webp",
16+
"description": "Platform for searching, monitoring, and analyzing machine-generated data at scale for operational intelligence and security.",
17+
"install_methods": [
18+
{
19+
"type": "default",
20+
"script": "ct/splunk-enterprise.sh",
21+
"resources": {
22+
"cpu": 4,
23+
"ram": 8192,
24+
"hdd": 40,
25+
"os": "Ubuntu",
26+
"version": "24.04"
27+
}
28+
}
29+
],
30+
"default_credentials": {
31+
"username": null,
32+
"password": null
33+
},
34+
"notes": [
35+
{
36+
"text": "The credentials to login can be found in splunk.creds.",
37+
"type": "info"
38+
},
39+
{
40+
"text": "Trial license allows indexing 500 MB/Day. After 60 days you can convert to a perpetual free license or purchase a Splunk Enterprise license to continue using the expanded functionality designed for enterprise-scale deployments.",
41+
"type": "warning"
42+
},
43+
{
44+
"text": "About Splunk Free License: https://help.splunk.com/en/splunk-enterprise/administer/admin-manual/10.0/configure-splunk-licenses/about-splunk-free",
45+
"type": "info"
46+
}
47+
]
48+
}
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
#!/usr/bin/env bash
2+
# Copyright (c) 2021-2025 community-scripts ORG
3+
# Author: rcastley
4+
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
5+
# Source: https://www.splunk.com/en_us/download.html
6+
7+
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
8+
color
9+
verb_ip6
10+
catch_errors
11+
setting_up_container
12+
network_check
13+
update_os
14+
15+
echo -e "${TAB3}┌─────────────────────────────────────────────────────────────────────────┐"
16+
echo -e "${TAB3}│ SPLUNK GENERAL TERMS │"
17+
echo -e "${TAB3}└─────────────────────────────────────────────────────────────────────────┘"
18+
echo ""
19+
echo -e "${TAB3}Before proceeding with the Splunk Enterprise installation, you must"
20+
echo -e "${TAB3}review and accept the Splunk General Terms."
21+
echo ""
22+
echo -e "${TAB3}Please review the terms at:"
23+
echo -e "${TAB3}${GATEWAY}${BGN}https://www.splunk.com/en_us/legal/splunk-general-terms.html${CL}"
24+
echo ""
25+
26+
while true; do
27+
echo -e "${TAB3}Do you accept the Splunk General Terms? (y/N): \c"
28+
read -r response
29+
case $response in
30+
[Yy]|[Yy][Ee][Ss])
31+
msg_ok "Terms accepted. Proceeding with installation..."
32+
break
33+
;;
34+
[Nn]|[Nn][Oo]|"")
35+
msg_error "Terms not accepted. Installation cannot proceed."
36+
msg_error "Please review the terms and run the script again if you wish to proceed."
37+
exit 1
38+
;;
39+
*)
40+
msg_error "Invalid response. Please enter 'y' for yes or 'n' for no."
41+
;;
42+
esac
43+
done
44+
45+
msg_info "Setup Splunk Enterprise"
46+
DOWNLOAD_URL=$(curl -s "https://www.splunk.com/en_us/download/splunk-enterprise.html" | grep -o 'data-link="[^"]*' | sed 's/data-link="//' | grep "https.*products/splunk/releases" | grep "\.deb$")
47+
RELEASE=$(echo "$DOWNLOAD_URL" | sed 's|.*/releases/\([^/]*\)/.*|\1|')
48+
$STD curl -fsSL -o "splunk-enterprise.deb" "$DOWNLOAD_URL" || {
49+
msg_error "Failed to download Splunk Enterprise from the provided link."
50+
exit 1
51+
}
52+
$STD dpkg -i "splunk-enterprise.deb"
53+
rm -f "splunk-enterprise.deb"
54+
msg_ok "Setup Splunk Enterprise v${RELEASE}"
55+
56+
msg_info "Creating Splunk admin user"
57+
ADMIN_USER="admin"
58+
ADMIN_PASS=$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | head -c13)
59+
{
60+
echo "Splunk-Credentials"
61+
echo "Username: $ADMIN_USER"
62+
echo "Password: $ADMIN_PASS"
63+
} >> ~/splunk.creds
64+
65+
cat > "/opt/splunk/etc/system/local/user-seed.conf" << EOF
66+
[user_info]
67+
USERNAME = $ADMIN_USER
68+
PASSWORD = $ADMIN_PASS
69+
EOF
70+
msg_ok "Created Splunk admin user"
71+
72+
msg_info "Starting Service"
73+
$STD /opt/splunk/bin/splunk start --accept-license --answer-yes --no-prompt
74+
$STD /opt/splunk/bin/splunk enable boot-start
75+
msg_ok "Started Service"
76+
77+
motd_ssh
78+
customize
79+
cleanup_lxc

0 commit comments

Comments
 (0)