Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions scripts/ingest.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,39 @@ function Write-ErrorMsg {
Write-Host "[ERROR] $Message" -ForegroundColor Red
}

function Write-ParseableBanner {
$accent = "$([char]27)[38;2;158;158;240m"
$reset = "$([char]27)[0m"
$logo = @(
' ____ _ ____ ____ _____ _ ____ _ _____',
'| _ \ / \ | _ \/ ___|| ____| / \ | __ )| | | ____|',
'| |_) / _ \ | |_) \___ \| _| / _ \ | _ \| | | _|',
'| __/ ___ \| _ < ___) | |___ / ___ \| |_) | |___| |___',
'|_| /_/ \_\_| \_\____/|_____/_/ \_\____/|_____|_____|'
)

Write-Host ""
$logo | ForEach-Object { Write-Host "$accent$_$reset" }
Write-Host ""
Write-Host "Host metrics setup" -ForegroundColor White
Write-Host "Installing and configuring the metrics agent for Parseable..."
Write-Host ""
}

function Write-SetupComplete {
param([string]$StreamName)

$accent = "$([char]27)[38;2;158;158;240m"
$ok = "$([char]27)[38;2;52;211;153m"
$reset = "$([char]27)[0m"
Write-Host ""
Write-Host "${ok}✓ You're all set!${reset}"
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Outdated
Write-Host "Host metrics are now being sent to Parseable."
Write-Host "Dataset: " -NoNewline
Write-Host "${accent}${StreamName}${reset}"
Write-Host "Return to Parseable and click Continue to verify your data."
}

function Test-FluentBitRunning {
if (Test-Path $PID_FILE) {
$processId = Get-Content $PID_FILE
Expand Down Expand Up @@ -282,6 +315,8 @@ function Setup-FluentBit {
exit 1
}

Write-ParseableBanner

$tlsSetting = "On"
$defaultPort = "443"
if ($IngestorHost -like "https://*") {
Expand Down Expand Up @@ -360,6 +395,7 @@ function Setup-FluentBit {

Write-Host ""
Start-FluentBit
Write-SetupComplete -StreamName $StreamName
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Outdated
}

function Show-Help {
Expand Down
29 changes: 29 additions & 0 deletions scripts/ingest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ set -e
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
ACCENT='\033[38;2;158;158;240m'
OK='\033[38;2;52;211;153m'
BOLD='\033[1m'
NC='\033[0m' # No Color

# File locations
Expand All @@ -34,6 +37,29 @@ print_warning() {
echo -e "${YELLOW}[WARNING]${NC} $1"
}

print_parseable_banner() {
echo ""
printf '%b%s%b\n' "$ACCENT" ' ____ _ ____ ____ _____ _ ____ _ _____' "$NC"
printf '%b%s%b\n' "$ACCENT" '| _ \ / \ | _ \/ ___|| ____| / \ | __ )| | | ____|' "$NC"
printf '%b%s%b\n' "$ACCENT" '| |_) / _ \ | |_) \___ \| _| / _ \ | _ \| | | _|' "$NC"
printf '%b%s%b\n' "$ACCENT" '| __/ ___ \| _ < ___) | |___ / ___ \| |_) | |___| |___' "$NC"
printf '%b%s%b\n' "$ACCENT" '|_| /_/ \_\_| \_\____/|_____/_/ \_\____/|_____|_____|' "$NC"
echo ""
echo -e "${BOLD}Host metrics setup${NC}"
echo "Installing and configuring the metrics agent for Parseable..."
echo ""
}

print_setup_complete() {
local stream_name="$1"

echo ""
echo -e "${OK}${BOLD}✓ You're all set!${NC}"
echo "Host metrics are now being sent to Parseable."
echo -e "Dataset: ${BOLD}${stream_name}${NC}"
echo "Return to Parseable and click Continue to verify your data."
}

# Function to check if Fluent Bit is running
is_running() {
if [ -f "$PID_FILE" ]; then
Expand Down Expand Up @@ -256,6 +282,8 @@ setup_fluent_bit() {
exit 1
fi

print_parseable_banner

if [[ "$INGESTOR_HOST" =~ ^[Hh][Tt][Tt][Pp][Ss]:// ]]; then
INGESTOR_HOST="${INGESTOR_HOST#*://}"
TLS_SETTING="On"
Expand Down Expand Up @@ -340,6 +368,7 @@ EOF
# Start Fluent Bit
echo ""
start_fluent_bit
print_setup_complete "$STREAM_NAME"
}

# Main script logic
Expand Down
Loading